Forum Discussion
Hi Snehal
I took a look at your source code and the screenshots.
It seems like the i2c is working as the log shows that the application is able to connect to the i2c device.
A little comment on the main function, the calling of the "rtc_get" and "rtc_set " there are no pointers being passed into those function.
To interact with the rtc module the i2c you would need to set the device register first.
You might need multiple set and get function call:
"i2cset- 1 0x68 0x6"
"i2cget -1 0x68 0x00"
Below is a snippet from the datasheet of the DS3231.
"
Data transfer from a master transmitter to a slave receiver. The first byte transmitted by the master is the slave address. Next follows a number of data bytes. The slave returns an acknowledge bit after each received byte. Data is transferred with the most significant bit (MSB) first.
Data transfer from a slave transmitter to a master receiver. The first byte (the slave address) is transmitted by the master. The slave then returns an acknowledge bit. Next follows a number of data bytes transmitted by the slave to the master. The master returns an acknowledge bit after all received bytes other than the last byte. At the end of the last received byte, a not acknowledge is returned. The master device generates all the serial clock pulses and the START and STOP conditions. A transfer is ended with a STOP condition or with a repeated START condition. Since a repeated START condition is also the beginning of the next serial transfer, the bus will not be released. Data is transferred with the most significant bit (MSB) first"
Regards
Jingyang, Teh
Hello Jingyang,
Thanks!
PFA screenshot of debug console. Can you please help me understand the output of i2cdetect as UU.
I'm also facing issue with .dtb file, PFA debuglog , after switching on the system it works well but after I switch it off and on again it hangs after Starting kernel. Can you help me diagnose the issue
Thanks and regards,
snehal_p