Hi all RIOT OS gurus,
let me introduce myself, I am Jerome a newbie in the embedded world. I was previously Java architect as a freelance during 17 years (yes nobody is perfect!!).
I want to start a project with a quite tiny MCU (Cortex ARM M3 L serie or maybe Cortex ARM M0+).
I checked the RTOS landscape and I was seduced by your project:
- C naming conventions are standard (I can't read FreeRTOS code it's horrible)
- quite well documented
- the idea to provide a Docker image is nice but I was unable to launch it!!!
- your build system is really nice , being able to launch the build natively is a genious idea!!! I tried to use NuttX but was unable to build it...
I try to read the code (samples) and the docs ....
I have just a small question, even if I am a newbie with RTOS I am quite surprised not to see in the samples/interfaces a way to schedule timers ? This is a classical from the RTOS isn't it ? These small schedulers just run jobs...I saw in the samples, threads (OK) and message queues (perfect for inter threads communication) but no timers...
I'd like to thank you for your work. I imagine I will have many other questions and may be some kinds of proposals to your community (adding drivers/boards).
Jerome akka deadbrain
welcome to the RIOT community.
With your Docker problem I can’t help sadly, since I never used the image, but to your timer question: Currently we are in a transition period: The older vtimer , based on hwtimer , that is on its way to be replaced by an new API xtimer  which utilizes the peripheral timer API . If you want to schedule an event with both of them you use the vtimer_set_msg() or xtimer_set_msg() functions respectively. It schedules an IPC message send by the ISR at the scheduled time. Note that this is independent from the kernel’s thread scheduler since it is tick-less and purely event based. The *_set_msg() function allow you to schedule such events based on time.
Hope this was helpful,
thanks Martine for this quick reply.
You talk about a transition period…Is it stable enough to use the new vtimer interface or when will the old hwtimer will be deprecated ? I am not an expert but it makes sense to avoid using ticks and to have a pure event based mechanism.
Thanks once again
I’m only using the old vtimer API to date and since I don’t use it for longterm events I don’t face many problems. As such I can’t say much about the stability of the new API. The problem with the old (and one of the main reasons why it is about to be phased out) is that it can’t reliably handle integer overflows, so if you plan to schedule events longer than about an hour and a few minutes in the future (the equivalent of 2^32 - 1 ticks) prepare for crashes with the old API. But I think it’s in general a good idea if someone with me knowledge about the timer architecture would help you
Is it stable enough to use the new vtimer interface or when will the old
hwtimer will be deprecated ? I am not an expert but it makes sense to
avoid using ticks and to have a pure event based mechanism.
Both timer implementations are tickless and event-based. The old stuff (mainly vtimer) was just badly designed internally, while the new code is (hopefully) not.
I guess for now you can safely just use vtimer. If you happen to run into strange problems with those timers, pull request #3525 provides a seamless upgrade to the new timer code.
Thanks for your help...
This project is really cool....
I used grep a lot through the source code and found valuable samples in the tests folder (very nice for newbies like me)...
I did not find the xtimer API even after cloning the repository on Github .I will have a look to this pull request...
I think I will compose a new mail with a bunch a questions...