Hello everyone
I am try porting freertos smp to arm cortex-a7 which owns two cores.
The problem is when running, one core will hang on prvMinimalIdleTask and not switch context, I do not know why whis happens and how to debug it.
(gdb) i threads
Id Target Id Frame
* 1 Thread 1.1 (CPU#0 [running]) prvIdleTask (pvParameters=0x0) at ../../Source/tasks.c:4366
2 Thread 1.2 (CPU#1 [running]) prvMinimalIdleTask (pvParameters=0x0) at ../../Source/tasks.c:4308
Kind regards.
aggarg
(Gaurav Aggarwal)
April 19, 2023, 4:12pm
2
You need to implement a macro which one core uses to interrupt the other. Have you implemented it correctly and is it working?
Thanks for your reply!
I have implemented it which send IPI interrupt to another core.
portmacro.h:#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
Now I notice that the problem is that only core 0 can run tasks Only happens when vTaskCoreAffinitySet() and vTaskDelay() are used at the same time .
The example is as followed.
void vTask1( void *pvParameters )
{
int i;
int core_id;
for( ;; )
{
core_id = PortGetCoreId();
printf("T1 %d\r\n",core_id);
vTaskDelay(xDelay1000ms);
}
}
void vTask2( void *pvParameters )
{
int i;
int core_id;
for( ;; )
{
core_id = PortGetCoreId();
printf("T2,%d\r\n",core_id);
vTaskDelay(xDelay1000ms);
}
}
===========================================
/* Two print task both only run once and then print nothing */
T1 1
T2,1
===========================================
aggarg
(Gaurav Aggarwal)
April 21, 2023, 8:22am
4
First thing to verify is that the tick interrupt is firing - You can examine the xTickCount variable for that. Next is to verify that the tasks are placed on the ready list after the delay time has expired. And then next is to verify that tasks are picked on the next run of scheduler.