S32K388 (4×Cortex-M7): Running FreeRTOS on 3 cores in AMP mode Hello, I am developing with the S32K388 (4× Cortex-M7, ASIL D) and would like to run FreeRTOS on 3 of the 4 cores (each core runs its own FreeRTOS instance, AMP mode).So far I have not been able to find complete reference material for this multi-core FreeRTOS setup, so I would appreciate any guidance. My questions: 1. Is AMP (one FreeRTOS instance per core) the recommended approach for running FreeRTOS on 3 cores of the S32K388? Is there an NXP application note / user guide describing the multi-core setup, e.g. boot sequence and core start-up (who starts core1/core2/core3 and how), VTOR / vector table per core, memory partitioning (TCM/RAM), clock and interrupt routing per core? 2. Is there an official example project (S32K388 or any S32K3 variant) that runs FreeRTOS on more than 2 cores? Where can I download it? 3. What is the recommended inter-core communication mechanism on S32K3 (IPCF vs shared memory + interrupts), and are there FreeRTOS-aware examples? 4. How should the project be structured in S32 Design Studio for this use case (single multi-core project vs one project per core), and how can I debug all 3 cores simultaneously? Re: S32K388 (4×Cortex-M7): Running FreeRTOS on 3 cores in AMP mode Hello @LeeKen,
Neither AMP nor SMP is recommended; the choice depends on the application requirement. You can choose the multicore FreeRTOS approach that best fits the application.
For AMP, use one independent S32 Design Studio project per core, based on the single-core FreeRTOS example. The main core should configure XRDC. Memory, vector tables, stacks, and application sections must be divided in the per-core linker files. The main core may start the other cores, or sBAF can enable the cores specified in the boot header/boot configuration word.
IPCF 4.3.0 includes an S32K388 AMP FreeRTOS multicore example using CM7_1 and CM7_2, which can be used as a reference.
IPCF is optional, anyone can implement their own solution.
In general, debuggers provide multicore debug support.
Regards,
Daniel
Re: S32K388 (4×Cortex-M7): Running FreeRTOS on 3 cores in AMP mode Hi Daniel, Thanks a lot for your detailed explanation. There are still some questions that I would like you to answer. 1. If using the AMP mode, each core is regarded as a single-core Free RTOS project, is that correct? 2. Only the main core needs to configure XRDC? Are there any precautions when configuring? 3. If the configurations for each core's Memory, vector tables, stacks are completely independent, do we need to assess the dependencies between the multi-cores? 4. If I use the main core to start the other two slave cores, is there any limitation or must there be a certain sequence when starting multiple slave cores one after another? Re: S32K388 (4×Cortex-M7): Running FreeRTOS on 3 cores in AMP mode Hello @LeeKen,
1. Yes.
2. XRDC is a global configuration and normally needs to be configured only once by the main core before the other cores access protected resources.
https://docs.nxp.com/bundle/AN14715/page/topics/extensible_resource_domain_controllerxrdc.html
3. The system-level dependencies still need to be assessed. These include shared memory, IPCF channels, shared peripherals, semaphores, clocks, watchdogs, reset handling, startup synchronization, low-power mode, etc.
4. This is also a functional-safety consideration. The secondary cores should not have unrestricted access to certain memories or peripherals, so XRDC must be initialized before they use those resources. XRDC domain assignment is also required for hardware SEMA42 operation, because SEMA42 uses the master domain ID for gate ownership.
Regards,
Daniel
View full article