The multi-core CPU(like TC275、TC367、TC397…) of the TRICORE architecture can only create threads on the corresponding cores. Core0 cannot create Core1 tasks, including IDLE tasks:
So the “prvCreateIdleTasks” function is not appropriate in TRICORE .
Moreover, TRICORE does not support thread switching between different CPUs, that is to say, when creating a thread, it must be bound to a specific CPU.
FREERTOS should provide a similar API:
prvCreateIdleTasks->xTaskCreate->xTaskCreateAffinitySet->prvInitialiseNewTask->pxPortInitialiseStack
in tricore :
pxPortInitialiseStack()
{
var csa=GetCurrentCpuFreeCsaArea();
init csa;
init sp;
int .....
}
For the TRICORE architecture, each core can only access its own CSA and cannot access the CSAs of other cores, so xTaskCreate must be executed on the corresponding core!
This is hard to achieve without delegating it to the application - is it possible to delay this initialization of CSA until the task starts and do it first thing in the task? If so, we can pin all the IDLE tasks to their respective cores and that would address your problem. Pardon my unfamiliarity with the TriCore architecture.
Hello, I also want to port freeRtos to T C397 tricore. At present, a single-core port has been implemented, but I can’t achieve multi-core porting. Do you have relevant GitHub files for reference?