Re: FreeRTOS
Posted: Thu Jan 23, 2014 12:55 pm
Nice update Dave!
So,
using the hardware timer as Dave suggested looks like it works.
I have slightly changed Bianco's project and make FreeRTOS a module that will be started by the main XC file but I don't think that this can affect the project anyway.
However there are still the 21s problem
The FreeRTOS core is halting every 21 seconds. As I excpected, that is caused by a timer overflowing. The XMOS data sheets refer to timers being unsigned 32-bit, however the maximum time interval they can handle is 21.xxx secs (I would expect 42.xxx for a 32bit timer). After 21 seconds you can see $r2 (which holds the time for the next interrupt) having a negative value. This is something that the FreeRTOS doesn't not handle.
There is also another strange behaviour when FreeRTOS is running a single task. I have a single task toggling a led, with a vTaskDelay(500) sitting on top of it. The function does trigger every 500ms but the leds won't stay on for that period of time. I have to check that again though.
So,
using the hardware timer as Dave suggested looks like it works.
I have slightly changed Bianco's project and make FreeRTOS a module that will be started by the main XC file but I don't think that this can affect the project anyway.
However there are still the 21s problem
The FreeRTOS core is halting every 21 seconds. As I excpected, that is caused by a timer overflowing. The XMOS data sheets refer to timers being unsigned 32-bit, however the maximum time interval they can handle is 21.xxx secs (I would expect 42.xxx for a 32bit timer). After 21 seconds you can see $r2 (which holds the time for the next interrupt) having a negative value. This is something that the FreeRTOS doesn't not handle.
There is also another strange behaviour when FreeRTOS is running a single task. I have a single task toggling a led, with a vTaskDelay(500) sitting on top of it. The function does trigger every 500ms but the leds won't stay on for that period of time. I have to check that again though.