sarnovian wrote on Saturday, November 02, 2019:
freeRTOS tasks do not run on APU#2,#3 on mpsoc+
Is anyone succesfully running freeRTOS on a MPSoc+ APU #2 or 3? If so did you have to do anything special in the hardware setup or BSP alterations to make it work?
I’ve found that our application (freeRTOS on A53) works fine on APU #0, #1, but when we use it on APU #2 or 3 the task never execute. E.g. it appears the tickInterrupt isnt occuring so the scheduler never swaps which task is run.
I’ve tried using different TTC counter sources, and I have verified they are correctly setup by the BSP to generate the IRQ to the specific core, and that the counter is interval setup and counting correctly. The GIG SPI IRQ also seems to be set correctly.
If I Change the vTaskDelay(500) statements to vTaskDelay(0), then the seperate two threads do execute and continously swap between them.
This implies the scheduler and its associate interrupt is running ok when the vTaskDelay(0) is set since this tells the RTOS to swap tasks every TICK. I’ve verified that in portASM.s, FreeRTOS_SWI_Handler ASM function is also being called.
However, FreeRTOS_IRQ_Handler ASM function in same file never gets called. I think this is the IRQ used by the schedular when tasks are put to IDLE for >0 ticks…
Anyone have any ideas?
This is repeatable with even a very simple test design:
NOTE: This test design and BSP works fine on CPU 0 and CPU 1 if I change the BSP CPU ID parameter (which controls where the SPI IRQ from the GIG400 Distributor is sent). For this test I’m only running one of the CPU’s at a time to be sure there is no corruption of shared memory, or IRQ conflicts between the CPU applications.
#include <sleep.h>
#include <stdbool.h>
#include <stdlib.h>
/* FreeRTOS includes. */
#include “FreeRTOS.h”
#include “semphr.h”
#include “task.h”
#include “queue.h”
#include “timers.h”
void testThread1 (void *p)
{
while(1) {
vTaskDelay (500);
xil_printf(" TASK Thread1\n");
}
}
void testThread2 (void *p)
{
while(1) {
vTaskDelay (500);
xil_printf(" TASK Thread2\n");
}
}
int main( void )
{
BaseType_t threadCreateStatus[2];
xil_printf(" APU2 Starting APP...\n");
threadCreateStatus[0] =xTaskCreate(testThread1, "testThread1", 1024, NULL, 2, NULL);
threadCreateStatus[1] =xTaskCreate(testThread2, "testThread2", 1024, NULL, 2, NULL);
// monitor main big threads to see if we have memory configured correctly:
if (threadCreateStatus[0] == pdPASS &&
threadCreateStatus[1] == pdPASS)
{
vTaskStartScheduler();
} else {
// memory allocation issues:
while (1);
}
while (1);
return;
}