Hi folks-
I have been playing with the new Hercules LaunchPad TMS570 for a few days now and I'm running into a snag with FreeRTOS.
I am writing a device driver for an SPI-based LCD display, and part of the initialization routine involves doing a mandatory 100ms wait before issuing any SPI commands to its controller. To implement this, I would like to use the FreeRTOS Timer subsystem. This appears to be fairly straightforward and since I am only using this timer once, I am allocating it from within the task using xTimerCreate(), running it with a callback function & volatile flag variable, then deleting it.
Apparently though, issuing xTimerCreate() from within a FreeRTOS task produces a PABT (prefetch abort) exception. While I am not fully versed yet on the MPU subsystem and how FreeRTOS interacts with it, one thing I've found surfing the source code produced by HALCoGen is that most of the task & queue-related operation functions are "wrapped" using MPU_* function names; os_mpu_wrappers.h has these details.
But none of the Timer-related functions are wrapped. Yet in os_timer.h, you see the PRIVILEGED_FUNCTION keyword next to some of the function prototypes, including xTimerCreate:
xTimerHandle xTimerCreate( const signed char * const pcTimerName, portTickType xTimerPeriodInTicks, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, t
mrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION;
So is this a bug or omission on HALCoGen's part, a bug on FreeRTOS's part, or neither? Is it a known issue? Seems like the obvious way to get around this is to allocate the resource in main() before the task scheduler starts.