Hi all!
I am porting freertos smp for arm ca7, I meet problem when set configRUN_MULTIPLE_PRIORITIES = 1 which hang on vListInsert. I read the comments on it but still can not find the reason.
I use the test example reference FreeRTOS-SMP-Demos/main.c at main · FreeRTOS/FreeRTOS-SMP-Demos · GitHub
My config shows as follew and I set assert function
#define configRUN_MULTIPLE_PRIORITIES 1
#define configUSE_CORE_AFFINITY 0
#define configMAX_API_CALL_INTERRUPT_PRIORITY 0x11
#define configCHECK_FOR_STACK_OVERFLOW 2
The causes listed:
- Stack overflow: I set the configCHECK_FOR_STACK_OVERFLOW and implement vApplicationStackOverflowHook.
- Interrupt priority assginment: I just run the demo, no external interrupts.
- Calling an API function from witch a critical section or when the scheduler is suspended. The function used in demo is all kernel API, and i did not change the kernel;
- At this time, I check the value of xSchedulerRunning, xSchedulerRunning is pdTrue.
- I did not set nested IRQ
The program hangs after queue reveive
QueueReceive: 1
#0 0x80409de8 in vListInsert (pxList=0x80421a1c <ucHeap+52>, pxNewListItem=0x80423ae8 <ucHeap+8448>) at ../../Source/list.c:166
#1 0x804052dc in vTaskPlaceOnEventList (pxEventList=0x80421a1c <ucHeap+52>, xTicksToWait=4294967295) at ../../Source/tasks.c:3964
#2 0x804087a0 in xQueueReceive (xQueue=0x804219f8 <ucHeap+16>, pvBuffer=0x80423aa4 <ucHeap+8380>, xTicksToWait=4294967295) at ../../Source/queue.c:1424
#3 0x80401f5c in prvQueueReceiveTask (pvParameters=0x0) at main.c:229
#4 0x00000000 in ?? ()
Thread 2 (Thread 1.2):
#0 prvIdleTask (pvParameters=0x0) at ../../Source/tasks.c:4394
#1 0x00000000 in ?? ()
Maybe the spinlock I implement is something wrong?
Kindly help
Thanks and Regards