This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAPL138 INTERNAL RTC

Other Parts Discussed in Thread: OMAPL138

Hi,

       I am using Omapl138 internal RTC for one of my project, I want to know the importance and usage of  SWRESET bit of Oscillator register, i have found few issues in my internal RTC

   1. It has been observed  that seconds, minutes, hours registers were not updating, but i can see in status register The Run bit  of  RTC is set, then after forcefully enabling the SWRESET bit of oscillator register, the seconds, minutes, hours       registers started updating.

But as per spruh77a , section 28.2.10 a software reset should be performed during initial power on, but if i do software reset, all previous date and time information will be lost, then how to over come this.

I dont know where the exact problem, kindly help me in solving this issue.

  • Hi,

    What board are you using ?
    Custom or EVM ?
    If its custom, have you tried it on EVM board ?

    Are you using your own code or TI example ?
    Refer to the following starterware RTC (internal) example code.
    C:\ti\OMAPL138_StarterWare_1_10_04_01\build\armv5\cgt_ccs\omapl138\lcdkOMAPL138\rtc

    What type of OS are you using ?
    Starterware or BIOS or Linux ?
  • Hi,

           I am using custom board, with linux OS, we are using TI example code only as reference.

    But this problem is with not all boards, in some boards i can see by default  either RTC disable bit or Set32 counter bit in control register is set

  • Hi,

    Have you tried to reproduce the issue with EVM board ?

    But this problem is with not all boards, in some boards i can see by default either RTC disable bit or Set32 counter bit in control register is set

    what do you mean by some boards? Do you mean to say that on some custom boards RTC works fine and on some it does not ?
    On hardware side what customization you have done?
  • But as per spruh77a , section 28.2.10 a software reset should be performed during initial power on, but if i do software reset, all previous date and time information will be lost, then how to over come this.

    This is a mandatory step for reliable working for RTC. If this is not done, you can see the board to board variation that you are observing. I do not understand what you mean by loss of information , this is a one time step when powering up the entire device (including RTC) and initializing the RTC to keep the data and time information , you do not have to do this if the RTC is kept enabled but rest of the chip is powered down etc. You have to do it if the entire device is powered off (including RTC) , in which case there is no "previous date & time information" 

  • Hi,

          I mean to say that on some of our customs boards its working fine, but in some custom boards it is not working, i have observed that in non working boards RTC disable bit and 32 bit counter bit  of control register was enabled, but in working boards these bits were disabled.

     since  RTC disable and 32 bit counter bit of control register was set the seconds, minutes, hours register is not updating its value, on the other hand we have tried to forcefully disable this bits in non working boards, at that time it seems to be working fine and also the seconds, minutes, hours registers were also updating its value, but once it is powered off once again this bits are enabled.

       WE dint find such a problem in evm, it occurs in some of our custom boards only.

    I want to know in what means these control bits will get enabled and also in driver code of RTC any modifications are required, we are using TI's RTC code for Linux RTOS.

    the code can be seen in this link

    lxr.free-electrons.com/.../rtc-omap.c

    Kindly guide me in solving this issue.

  • Hi,

           Thanks for your kind reply, But it is necessary to so set the bit SWRESET  of Oscillator register of RTC everytime when we power on the circuit or during RTC driver initialization , if so done then all registers of RTC will be cleared, so that how to keep track of seconds, hours, minutes which ever persists during power off period. 

  • Hi,

    Are you using different bootloader for both working and non-working boards ?

    In how boards you have seen this behavior ? only one ?

    Check the sw used in both boards, whether we used any wrong image like that.

    Able to reproduce the problem on non-working board i.,e always able to see the same behavior that CTRL.RTCDISABLE bit was set (RTC disabled) ?

    Else, having this problem intermittently ?

    Could you attach the both bootup log for working and non-working boards ?

    Try to see the RTC CTRL register to check the CTRL.RTCDISABLE bit at u-boot stage on both working and non-working boards.

    I've checked EVM board and confirmed that RTC.DISABLE bit was disabled.

    Could you please try this let me know for both working and non-working boards.

  • Hi,
    Also, RTC reset would happen if RTC power failure detected and for very first time on the board from factory.
    Check the "omap_rtc_set_time" function in RTC driver.
    linux/drivers/rtc/rtc-omap.c
    BTW, what is your kernel version ?
    Is that TI released one or from kernel.org ?