Interfacing

[solved] RTC DS3231 Android Support

9 824
Edited by Tido at May 08, 2016 10:29

Hi,

I want to use a guitar in my car. Now i have the problem that on every start the system reset the system time because missing data connection.

Is it possible to use a ds3231 board with the guitar and the android?

If yes. What is to do. On which pins I have to connect the ds3231 board.

Thanks for your help.
12458  
I suggest you use the DS3231M instead.

Hello,

i have now a ds3231 and will it use with android.

I deactivated the internal rtc and activated the kernel driver for the ds1307.

I recompiled the whole image.

With the Terminal-Emulator I use the follow commands to activate the rtc as rtc0 and sync the system time with the rtc time.

  1. echo ds1307 0x68 | sudo tee /sys/class/ic2-adapter/i2c-2/new_device
Copy the Code
  1. sudo hwclock -s
Copy the Code


All is working with this manual steps.

But where i  have to write this in the system to do it automatically?

I have tried it in the init.gs705a.rc above the hwclock-s command but it failed.

Thanks for your help

No one can help me?

Tido  
Edited by Tido at May 06, 2016 10:33
wiederre replied at May 06, 2016
I deactivated the internal rtc and activated the kernel driver for the ds1307.

you have recompiled the kernel.
Isn't it possible to side load the necessary software with:  insmod: insert module into Kernel ?

yes i have recompiled the kernel.

and with the 2 manual steps above in the terminal emulator the external ds3231 rtc is working.

My problem now is, that I don't now where and how I have to put this code to execute at startup.



Tido  
wiederre replied at May 06, 2016 11:36
yes i have recompiled the kernel.

and with the 2 manual steps above in the terminal emulator the ex ...

I tried to give you a hint with insmod.
Read this article to load your stuff there are different variants insmod depmod and so on

Edited by wiederre at May 06, 2016 06:55

Sorry I know. But I thought if I compiled it in the kernel with  DS1307=y then i need no insmod or something else.

Actually i create the /dev/rtc0 with the command "echo ds1307 0x68 | sudo tee /sys/class/ic2-adapter/i2c-2/new_device" and sync the system time and rtc with the command "hwclock -s".

And this is working for me. But the problem is, that i have to do it manually.

I have read its possible to use a i2c_board_info section in a file with the command I2C_BOARD_INFO("ds1307", 0x68) but i didn't found this section or the file for the lemaker guitar in the source code.

In which file is the initializing of the onboard rtc?  

I have found the solution.

I added this code to the lemaker_guitar_bbb.dts file at the row 865 in the i2c@b0178000 section

  1. ds1307@68{
  2. compatible = "maxim,ds1307";
  3. reg = <0x68>;
  4. status = "okay";
  5. };
Copy the Code


All is working now.

finger  
Edited by finger at May 08, 2016 16:11

Hi @wiederre,

I am just curious, i have some issues with DS1307 in linux, if i reboot several times (without ethernet/wifi connected), sometimes it trashes the DS1307 registers, possibly during shutdown and the values are wrong.

Can you please test with your solution (Android) and shutdown several times (turn power off also) with no ethernet or wifi connected and see it works?

I tested it with your solution and got the same issues, and had some hope this would fix that problem.

BR,
Finger

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

Points Rules