# CME 9210 + RTC

**URL:** <https://forums.digi.com/t/cme-9210-rtc/6188>\
**Category:** Linux\
**Created:** [February 10, 2009, 7:06pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188 "2009-02-10T19:06:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 10, 2009, 7:06pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/1 "2009-02-10T19:06:59Z")

</div>

I’m trying to make the RTC feature work. I’ve enabled the following options in the kernel:

Device drivers -\> I2C support = Y  
Device drivers -\> I2C support -\> I2C device interface = Y  
Real Time Clock = Y  
Real Time Clock -\> Set system time from RTC on startup and resume = Y  
Real Time Clock -\> Dallas/Maxim DS1307/37/38/39/40 = Y

Besides, these options were already enabled:

Device drivers -\> I2C support -\> Autoselect pertinent helper modules = Y  
Device drivers -\> I2C support -\> I2C Hardware Bus support -\> Digi ns9360, ns921x = Y  
Real Time Clock -\> /sys/class/rtc/rtcN = Y  
Real Time Clock -\> /proc/driver/rtc = Y  
Real Time Clock -\> /dev/rtcN = Y

But this message appears during bootup:

/usr/local/DigiEL-4.2/kernel/linux/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

Indeed, no rtc device is added to /dev so subsequent calls to hwclock generate the same error (can’t open ‘/dev/misc/rtc’: No such file or directory). I’m using a Maxim DS1338 RTC IC connected to the CME 9210 I2C port. This IC worked fine with the old Connect-Me under LxNETES 2.3 through the simulated I2C interface.

Is anyone using the RTC feature on the CME 9210? Should this be managed as a separate module?

Thanks in advance for your help.

Daniel.

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 11, 2009, 6:02pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/2 "2009-02-11T18:02:58Z")

</div>

I know a little more about this issue.

1. Having enabled the “I2C device interface” in the Kernel, I should see a character device /dev/i2c-0, according to the Help pages. However, this device is not created by the kernel.

2. The folder /sys/bus/i2c/drivers/rtc-ds1307 does exist but /sys/bus/i2c/devices is empty

3. In “Table of devices and their hardware resources” from the Help pages, NS9210 does not appear as having support for any external RTC IC.

Besides point 3, I think that the problem could be in the I2C interface, not being loaded by the kernel. Tomorrow I’ll try to load the I2C/RTC stuff as a separate module.

Daniel.

---

<div class="post-metadata">

**Author:** ![Derek](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@Derek](https://forums.digi.com/u/Derek)\
**Post date:** [February 11, 2009, 6:36pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/3 "2009-02-11T18:36:28Z")

</div>

Hi Daniel

I’ve been struggling with I2C as well, nothing I have tried has worked so far.

I have a support question asking if I2C is actualy available on the 9210 but no answer yet!

Derek

P.S. I have a blackfin dev board and this produces /dev/i2c-0 as expect with the I2C interface built into the kernel.

---

<div class="post-metadata">

**Author:** ![steved1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@steved1](https://forums.digi.com/u/steved1)\
**Post date:** [February 12, 2009, 8:34am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/4 "2009-02-12T08:34:15Z")

</div>

Derek,

I can at least confirm that the I2C on the ME9210 works! But I’m using it with Net+OS, and did my own RTC clock driver rather than try and work out what the Digi stuff really did (not sure that it worked the way I wanted, anyway). There was a small bug in the error handling in the Net+OS I2C driver (resulted in error status being latched once errors occurred) which has been fixed in the patches; not sure whether it was present in the Linux version.

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 12, 2009, 11:09am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/5 "2009-02-12T11:09:28Z")

</div>

Thanks Derek. At least we know that the I2C hardware works on the CME 9210.

I’ve tried loading the drivers as separate modules… with similar results.

doing:

modprobe i2c-ns9xxx  
modprobe i2c\_dev  
modprobe rtc-ds1307

does load the modules, as the lsmod command shows:

Module Size Used by Not tainted  
rtc\_ds1307 4256 0  
i2c\_dev 5636 0  
i2c\_ns9xxx 5408 0  
i2c\_core 17232 3 rtc\_ds1307, i2c\_dev, i2c\_ns9xxx

but no “rtc” nor “i2c” device is added to /dev. /sys/bus/i2c/devices is empty too.

Assuming that this is an i2c-related issue, I’ve left the rtc stuff aside for a while. I’ve also enabled the I2C debugging messages but dmesg just shows

i2c-core: driver [dev\_driver] registered  
i2c /dev entries driver

I’ve then looked into mach-cme9210.c, where compared to the rest of Digi mach-xxxxx.c files, the I2C controller should be added and any I2C device should be registered. However, mach-cme9210.c just contains a very basic MACHINE\_START code, no I2C init at all.

Well, I have not the skills to go much further… I’d just say that the CME9210 has no support for I2C on Linux at this moment.

Any chance of having a patch from Digi? 🙂

Daniel.

---

<div class="post-metadata">

**Author:** ![hpalacios](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/hpalacios/32/10637_2.png) [@hpalacios](https://forums.digi.com/u/hpalacios)\
**Post date:** [February 12, 2009, 3:40pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/6 "2009-02-12T15:40:59Z")

</div>

Greetings Daniel,

It is true the machine code for the cme9210 doesn’t have the code to enable the I2C interface.  
Next week Digi will provide a patch to fix this issue via the Package Manager tool.

## Thank you and best regards,

Héctor Palacios

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 12, 2009, 4:10pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/7 "2009-02-12T16:10:47Z")

</div>

Excellent!!

Thank you very much Héctor.

Daniel.

---

<div class="post-metadata">

**Author:** ![hpalacios](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/hpalacios/32/10637_2.png) [@hpalacios](https://forums.digi.com/u/hpalacios)\
**Post date:** [February 13, 2009, 9:26am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/8 "2009-02-13T09:26:54Z")

</div>

I must say, however, that this patch will only make available the I2C master driver of the processor.  
Currently, no I2C devices are attached to this interface either on the cme9210 module, nor on the ConnectME\_dev board.  
The NS9210 processor doesn’t have an internal RTC controller and there is no I2C RTC hardware available in the development board.  
If you need an RTC you must add this hardware (DS1337 for example) to your custom board plus a battery to keep it powered.  
The I2C lines are:  
I2C SDA: Module Pin 17 -\> MFGO  
I2C SCL: Module Pin 18 -\> MFGI

–  
Héctor Palacios

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 21, 2009, 11:29am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/9 "2009-02-21T11:29:44Z")

</div>

The patch for Digi Linux 4.2 is already available. Thanks a lot for solving the I2C issue so quickly. However, installing the patch halts with this error:

ERROR: Installation process of del-4\_2-hf2 failed

Any idea?

Daniel.

---

<div class="post-metadata">

**Author:** ![hpalacios](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/hpalacios/32/10637_2.png) [@hpalacios](https://forums.digi.com/u/hpalacios)\
**Post date:** [February 23, 2009, 5:00pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/10 "2009-02-23T17:00:22Z")

</div>

## The package had some problems with patching files that had been manually modified by the user. We have remade the package to overcome this problem and create backups of files to be overwritten by the Package Manager. The new Hotfix pack #2 should be available in a few hours. Simply try to install it again.

Héctor Palacios

---

<div class="post-metadata">

**Author:** ![Derek](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@Derek](https://forums.digi.com/u/Derek)\
**Post date:** [February 24, 2009, 11:00am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/11 "2009-02-24T11:00:15Z")

</div>

hi Daniel

How did you get hold of the patch?

I’ve tried package manager , but nothing.  
I wonder if it is having issues with our proxy server!

thanks

Derek

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 24, 2009, 3:03pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/12 "2009-02-24T15:03:07Z")

</div>

Hi Derek,

The second patch got installed correctly. However, I’m still not seeing /dev/rtcX

dmesg shows these messages:

i2c-ns9xxx i2c-ns9xxx: mapped I2C interface to virtual address0xc105a000  
I2C adapter driver [i2c-ns9xxx] forgot to specify physical device  
i2c-adapter i2c-0: adapter [i2c-ns9xxx] registered  
i2c-ns9xxx i2c-ns9xxx: NS9XXX I2C adapter

I’m now trying to modprobe each module individually as I did before this patch. The problem is that I’m not able to build rtc-dev (the driver that creates /dev/rtc) as a separate module.

Please Derek keep us posted about your progresses.

Daniel.

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 27, 2009, 8:43am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/13 "2009-02-27T08:43:49Z")

</div>

I’ve connected my scope to the SDA/SCL lines (I2C) on the Dev board P9 connector and can not see any I2C activity at startup. I now wonder if /dev/rtc is not created because the RTC IC is not queried or maybe that the RTC IC is not queried because the RTC driver has some kind of problem.

Is anyone using any I2C slave connected to the CME9210 under Linux?

Something to bear in mind is that /sys/bus/i2c/devices/ is empty even with i2c-dev and rtc-ds1307 loaded.

Searching the net, I’ve deduced that the external I2C RTC should be declared among the rest of I2C IC’s in mach-cme9210.c I think (for the CME). However, I guess that this declaration of I2C slaves is automatically done after enabling the RTC option/slave in the kernel config but I don’t know how to verify this.

Any comment/advice is welcome. Thanks again and sorry for the long thread.

Daniel.

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [February 24, 2009, 4:20pm UTC](https://forums.digi.com/t/cme-9210-rtc/6188/14 "2009-02-24T16:20:17Z")

</div>

Finally, I was not able to build rtc-dev as a module. Anyway, i2c-dev now mounts /dev/i2c-0 but modprobing rtc-ds1307 does not create any /dev/rtcX file.

On the other hand, /sys/bus/i2c/devices/ is still empty. I’m not discarding a problem in the RTC circuit so please, did anyone get to use the RTC feature on the CME 9210 using an external I2C IC?

Thanks,

Daniel.

---

<div class="post-metadata">

**Author:** ![estratos](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@estratos](https://forums.digi.com/u/estratos)\
**Post date:** [March 3, 2009, 9:59am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/15 "2009-03-03T09:59:58Z")

</div>

I’ve been able to read the time from the RTC chip and write new time into it using i2c-dev. This makes me think that the problem was in rtc-ds1307 or the way i2c-code loads this module.

Anyway, the i2c-dev method now lets me go ahead with my project so this issue has a minor importance for me at this moment.

Thanks all.

Daniel.

---

<div class="post-metadata">

**Author:** ![Derek](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@Derek](https://forums.digi.com/u/Derek)\
**Post date:** [March 3, 2009, 10:49am UTC](https://forums.digi.com/t/cme-9210-rtc/6188/16 "2009-03-03T10:49:18Z")

</div>

Hi

I can now see an entry in /sys/bus/i2C/devices for i2c-dev

I can see the SDA SDL lines behaving in the correct manner , just havn’t connected anything to it yet.

I moved onto looking at the SPI interface which also seems to be OK.

Derek
