Guidance needed for troubleshooting vTaskDelay() and vTaskDelayUntil() issues

mdeleo wrote on Saturday, November 04, 2017:

I recently ported FreeRTOS 9.0.0 to the ATmega1284 microcontroller and am noticing some strange behavior when vTaskDelay() or vTaskDelayUntil() is called. The behavior is that both calls, regardless of the delay specified, return at the next tick. Toggling a gpio line and examining with an oscilliscope revealed this.

Some further digging revealed that the call to prvAddCurrentTaskToDelayedList() in tasks.c is failing. By failing I mean that the body of that function isn’t being executed. I toggle a gpio line, in vTaskDelayUntil(), right before the call and can see that it’s about to be called but move the same gpio toggling into the actual function and the gpio isn’t toggled.

Strange, I know… Unfortunately, my STK500 programming board doesn’t have debugging support.

I have both the stack overflow and malloc failed hooks enabled but those aren’t getting hit.

Any pointers you can provide would be greatly appreciated,

Thanks in advance,


mdeleo wrote on Sunday, November 05, 2017:

Source files

rtel wrote on Sunday, November 05, 2017:

I’m afraid without being able to ask you to step into the functions so
you are able to report back what the code is doing all we can do is take
guesses. I would recommend investing in a debugger.