Hello guys,
I am dealing with a problem, i have two tasks with two different spi instances, alone they work fine, but when i want to run both tasks they crash!!
Hello guys,
I am dealing with a problem, i have two tasks with two different spi instances, alone they work fine, but when i want to run both tasks they crash!!
You need to give us more information on your initialization and other task related arguments for us to understand more. Code snippets or attaching the project file will significantly increase your chance of finding a solution here.
Hi Susheel,
so the initialization is the regular FreeRTOS initialization for tasks, where each task receive the instace parameteres
UNUSED_VARIABLE(xTaskCreate(helloWorld, "LED0", configMINIMAL_STACK_SIZE+200 , NULL, 7, NULL)); UNUSED_VARIABLE(xTaskCreate(spi_Task, "SP0", configMINIMAL_STACK_SIZE+200 , spi_0_mem_str_pointer, 6, NULL)); UNUSED_VARIABLE(xTaskCreate(spi_Task, "SP1", configMINIMAL_STACK_SIZE+200 , spi_1_mem_str_pointer, 2, NULL));
The instances are not the problem as each work correctly separatedly, so i am guessing it has something to do with the clock being unable to supply both instances at the same time , besides, they work correctly without freeRTOS
what happens is, that after initializing the tasks (the previous code ) it calls the scheduler start function, seems that the idle task is also started correctly, nevertheless, the code gets out and does not start the scheduler (it jumps over to the prohibited while )
Javiehm said:so i am guessing it has something to do with the clock being unable to supply both instances at the same time
I would not suspect the clocks in this case, since you said that it works without FreeRTOS. So i am assuming this either has to do something with the task priorities or the memory corruption. The stack size you assigned for the tasks would not be tested without freeRTOS.
In any case, it is hard to diagnose a crash without knowing the context of the crash and the module in which this crash happens. I have seen many other users using multiple peripheral instances combination with FreeRTOS, so hardware issue would be the last thing i would debug. This very much sounds like a configuration issue.
So, the problem was related to the heap. The task size was too big.