Bananian

RTC DS3231 Module

28 6209
Edited by Sebastian at Tue Aug 25, 2015 02:25

Hi guys,

I've built my own hardware RTC with the DS3231 chip which is working as expected. I'm stuck on getting the module installed on my BananaPro (running with Bananian Linux).
Steps I've already done:
  • downloaded the i2c-tools
output of "i2cdetect -y 2":
  1.      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  2. 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
  3. 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  4. 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  5. 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  6. 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  7. 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  8. 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
  9. 70: -- -- -- -- -- -- -- --
Copy the Code
  • added the following lines to the /etc/rc.local:
  1. echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-2/new_device
  2. hwclock -s
Copy the Code
  • "dmesg | grep ds3231" shows:
  1. [   27.735733] i2c i2c-2: new_device: Instantiated device ds3231 at 0x68
  2. [   37.774854] i2c i2c-2: Failed to register i2c client ds3231 at 0x68 (-16)
Copy the Code
  • "modprobe rtc-ds3231" fails with:
  1. FATAL: Module rtc-ds3231 not found.
Copy the Code
  • edited the /etc/init.d/hwclock.sh:
  1. HCTOSYS_DEVICE=rtc0
Copy the Code
  • "cat /proc/devices | grep rtc" shows:
  1. 254 rtc
Copy the Code
  • "ls -l /dev/rtc /dev/rtc0" shows:
  1. ls: cannot access /dev/rtc: No such file or directory
  2. crw------- 1 root root 254, 0 Jan  1 01:00 /dev/rtc0
Copy the Code
  • I already added the RTC module DS1307 in the menuconfig of the BPro (makes no difference).


Dunno what else I could do or what I'm doing wrong. Everytime the BPro reboots the "hwclock" command shows the correct time and date (which I manually added with "date MMDDHH........" beforehand). If the BPro powers down the clock always resets instead of getting the time from the RTC during restart.
The BPro is not connected to the internet - maybe a useful information as well.

Any help is appreciated.
Thanks in advance!

Sebastian
tkaiser  
Have you tried to check whether the necessary driver is available in your running kernel?

  1. zgrep CONFIG_RTC_DRV_DS13 /proc/config.gz
Copy the Code

Edited by Sebastian at Tue Aug 25, 2015 03:56
tkaiser replied at Tue Aug 25, 2015 03:34
Have you tried to check whether the necessary driver is available in your running kernel?

Not yet, but I guess it's not...
  1. # CONFIG_RTC_DRV_DS1307 is not set
  2. # CONFIG_RTC_DRV_DS1374 is not set
  3. # CONFIG_RTC_DRV_DS1305 is not set
  4. # CONFIG_RTC_DRV_DS1390 is not set
Copy the Code
Well, how do I install it?

This is what's in the /usr/src/linux-.../.config file:
  1. #
  2. # I2C RTC drivers
  3. #
  4. CONFIG_RTC_DRV_DS1307=y
  5. # CONFIG_RTC_DRV_DS1374 is not set
  6. # CONFIG_RTC_DRV_DS1672 is not set
  7. # CONFIG_RTC_DRV_DS3232 is not set
Copy the Code


tkaiser  
I would define it as M and then simply let the module build and install -- Bananian should include the necessary stuff (but I'm not sure)

tkaiser replied at Tue Aug 25, 2015 04:16
I would define it as M and then simply let the module build and install -- Bananian should include t ...

Thank you so much for your help.But there's still an issue I'm running into when I'm trying to execute "make" to start the build. It exits with an error:
  1.    HOSTLD  scripts/kconfig/conf
  2. scripts/kconfig/conf --silentoldconfig Kconfig
  3. drivers/net/wireless/ap6210/Kconfig:42:warning: defaults for choice values not supported
  4.    CHK     include/linux/version.h
  5.    CHK     include/generated/utsrelease.h
  6. make[1]: *** No rule to make target `arch/arm/tools/gen-mach-types', needed by `include/generated/mach-types.h'.  Stop.
  7. make: *** [archprepare] Error 2
  8. make  4.10s user 2.52s system 71% cpu 9.226 total
Copy the Code
Any hints on that one?

I do suggest you can try make menuconfig ARCH=arm to select the CONFIG_RTC_DRV_DS1307 to M.

Which linux kernel source do you get from?

tony_zhang replied at Tue Aug 25, 2015 05:53
I do suggest you can try make menuconfig ARCH=arm to select the CONFIG_RTC_DRV_DS1307 to M.

Which  ...

Thanks for your reply.
That sadly didn't work. I'm still facing the same issue as stated above.

The kernel version I'm using is 3.4.104-bananian.

Show out your compile process here.

And what is the result before you modify the kernel config.

Edited by Sebastian at Tue Aug 25, 2015 06:46

Sorry, don't get exactly what you mean.
After "make menuconfig" and setting the DS1307 as M I'm facing:
  1. xx@bananapro ~src/linux-headers-3.4.104-bananian # make menuconfig
  2. scripts/kconfig/mconf Kconfig
  3. drivers/net/wireless/ap6210/Kconfig:42:warning: defaults for choice values not supported


  4. *** End of the configuration.
  5. *** Execute 'make' to start the build or try 'make help'.

  6. make menuconfig  7.56s user 2.74s system 50% cpu 20.445 total
  7. xx@bananapro ~src/linux-headers-3.4.104-bananian # make
  8.   CHK     include/linux/version.h
  9.   CHK     include/generated/utsrelease.h
  10. make[1]: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'.  Stop.
  11. /usr/src/linux-headers-3.4.104-bananian/arch/arm/Makefile:282: recipe for target 'archprepare' failed
  12. make: *** [archprepare] Error 2
Copy the Code

tkaiser  
Can you please provide the output of "uname -a && cat /etc/bananian_version"? Did you cloned the Bananian kernel repository? What happens if you do a

  1. make ARCH=arm sun7i_defconfig
  2. make -j$(nproc) ARCH=arm modules
Copy the Code

You have to log in before you can reply Login | Sign Up

Points Rules