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.

For Adeneo: How to modify the AM335x WEC 7 to safely remove RTC support

HI,

In our custom board for AM335x, we decided not to use the RTC block.

I tried simply removing the RTC initialization in the OEMInit call in one sample AM335x board that runs with your BSP, but I get a lot of exceptions and the board stopped booting.

The board though have circuit that enables the RTC. So that could be cause.

But our board does not have anything now to support RTC. So we simply want to remove the code dependencies on RTC.

Any ideas where I should start/

  • Marlon,

    Windows CE does require a minimum of RTC support, so you will not be able to remove all of that code from the BSP. Required functions include OEMGetRealTime, OEMSetRealTime, and OEMSetAlarmTime, and these must behave sensibly, e.g. OEMGetRealTime must return a valid SYSTEMTIME or you will see all sorts of weird behaviour.

    If your platform does not have a battery-backed RTC (or you don't care about maintaining a correct system time), my suggestion would be to remove just the code that talks to the external RTC, and initialize the system time to a valid, fixed value like 2013-01-01 00:00:00. The CPU could then maintain a progressing time/date by adding the system tick count to the base offset whenever OEMGetRealTime is called.

  • Thank you Carsten.

    So this means I still have to access the RTC registers?

    I posted in another thread a problem with data abort on accessing the RTC register here -> http://e2e.ti.com/support/arm/sitara_arm/f/791/p/282294/984633.aspx#984633

    I need to fix this issue if I still need to access RTC. Any advise on this?

  • No, you do not need to access any RTC registers (unless there are other HW/SW considerations that require you to do this).

    Just initialize a SYSTEMTIME to a fixed value, say 2013-01-01.

    Then when OEMGetRealTime is called, return the fixed value with the number of (1 ms) system ticks added.

    Windows CE does not require the system date/time to be maintained across power cycles/reboot operations, so you should be in the clear as long as you 1) return a valid SYSTEMTIME from OEMGetRealTime, 2) ensure the system time is incremented at a reasonably accurate rate.