Not sure this is really a FreeRTOS issue, so tell me to go and ask somewhere else if it’s inappropriate, I won’t be at all offended.
I have FreeROS running on an STM32 and it runs fine in debug mode. However, when I run it in release mode it crashes. The debugger does at least seem to keep track of the call stack still and I can see that it’s when it tries to grab my SPI Port 2 mutex for the first time when it wants to read the EEPROM. Depending on the level of optimisation it either crashes (hard fault handler) in xQueueGenericReceive() or __aeabi_memcpy4().
At first I thought I’d sussed it because in a couple of places I Was trying to access a mutex before I’d started the scheduler, then a queue before I’d started the scheduler. However, after having fixed those two issues, it’s still crashing as soon as I access xSPI2Mutex in a task.
I must stress it works fine with no optimisation.
Does anyone have any ideas about what might be causing this please? Am happy to provide anny other information that might point us in the right direction.