CME 9210 + RTC

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.

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.

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.

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.

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? :slight_smile:

Daniel.

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

Excellent!!

Thank you very much Héctor.

Daniel.

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

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.

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

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

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.

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.

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.

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.

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