I have an application running on Microchip dsPIC33 with FreeRTOS. I use the default options, that is, dynamic allocation everywhere for all FreeRTOS objects.
The application has 5 tasks and 3 queues of 20 items of 34 bytes each. The heap_3.c version is used.
I came across a bug, where the application would crash when accessing the queues. I eventually found that the 3 queues were created within one of the tasks, and when I looked at the addresses of the queues, they seem to overlap the stack of one of the tasks.
I moved the creation of the 3 queues to the main() function, and the problem disappeared. So my question is : how is the dynamic memory allocation handled? Is it forbidden to allocate a queue from within a task?
On another project using a STM32, I currently also have instabilities, and I now realize that one task is creating a recursive mutex. Could this be the same problem again? In any case I will try and create the mutex from the main() function to see if it does any good.