Hi,
Does anyone know how can I get time stamp with RL-ARM? Is there a convenient API to get a time? I searched the examples and googled but came up with nothing.
Thanks.
My boards (STM320F103VB) are still in the process of fabrication. Meanwhile, I am working with the simulator. By the way, I am ok to look at any examples regarding how to build a time keeping feature with any target, if I can't get one for STM320F103VB. I believe this will benefit my learning.
I should have researched a little before replying. RL-RTX relies on a periodic timer interrupt (SysTick in the Cortex-M3 port) for task scheduling. So it has access to a timekeeping facility. If it doesn't expose up time information then it does look odd.
Thank you so much. I came across some document RL-ARM is using SysTick, but I still cannot find any API that is exposed to user to tap on it. I will continue to work on that lead.
For your information, I found the stm32f103x_rtc.h and stm32f103x_rtc.c and it looks promising to work on my own timer.
I found an example how to create timer in RL-ARM. It's in the Traffic example. It uses os_itv_set() and os_itv_wait() to construct a timer.
But this will not allow you to set a time reference as RTX timers do not maintain the system time, and they are vulnerable to usage violations and disabled interrupts. As mentioned, you should use an external RTC or program the internal one.
Best is to use a hw timer to generate an interrupt every x milliseconds and then update a software counter. If you have a battery-backed RTC you could implement a real clock and integrate it with the CRTL so that time() returns the seconds since 1970-01-01 00:00.