I am trying to use the hardware timer peripherals on the Arduino Due (Atmel SAM3X8E) with FreeRTOS. I can setup a bare project without FreeRTOS and get TC8 working using the following code:
Here’s my code for setting up Timer2, Channel2 (TC8) in my FreeRTOS project:
I don’t know that processor so this is just some generic advice, your call to xSemaphoreGiveFromISR looks wrong. the last parameter you are giving as ‘pdFALSE’ is supposed to be a pointer to a variable which the call will set to indicate the the scheduler should be run at the end of the ISR as a task was woken up. pdFALSE will have the value 0, so this looks like a null pointer, which is syntactly correct, but is an indicaation that your ISR intentionally either knows that it can’t be wakeing up a new higher priority task, or doesn’t care, or something of that like. You should look at the documentation for the function to see exaples of how this is done. The exact way you call the scheduler can vary a bit port to port.
Another possibility is that the interrupt has too high of a priority (which for Arm Cortexes means too low of a number, and they often default to 0) and FreeRTOS is catching in an assert or otherwise breaking.
The last parameter in xSemaphoreGiveFromISR() is optional, so NULL
(pdFALSE in this case, but as you point out, that is the same thing) is
a valid parameter and means no variable is being passed in. The
consequence of that is that a switch to a ‘higher priority task that was
woken’ will not happen until the next tick interrupt (or the current
task blocks).