Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN
I am using the Halcogen generated FreeRTOS code for the TMS570LC4357 MCU. Also using TI's ARM compiler.
I set up the following example task, which runs every 1 ms and toggles a GPIO. There are no other tasks running:

The results of looking at the logic analyzer are as follows:

This result is as expected, as you can see the GPIO has a frequency of 1000Hz
Now, if I set opt_level = 2, we see the following results:


Usually the GPIO toggle behaves as expected, however, sometimes the first GPIO toggle will happen before the delay takes place. It seems as if some code is executing in the task before the task can block.
Now, if I turn off optimizations for vTaskDelayUntil (but all other code has opt_level = 2), like so:

We are back to getting as expected results:

I'm wondering, is this an issue with Halcogen's generated code? From what I've read online, FreeRTOS is able to run with optimizations using the ARM compiler. Has anyone else seen this issue?











