Hi Peter,
Thank you for the quick reply. I am using a bare-metal approach which should simplify things on this front.
Due to the legal framework I'm working in, managing multiple executables on a single controller would be far from ideal. Additionally, since there's some coupling between the cores, I would need to duplicate some code between projects which is undesirable.I have written plenty of bare-metal startup codes in IAR for ARM with custom linker scripts, so I have some expertise in this. However, PPC and S32DS is new to me.
If my understanding is correct, this is what I need to do:
- Let the SDK's startup script run on Z4_0 without turning on any of the cores. This takes care of watchdog, memory, and vector table initialisation.
- Initialise my hardware's internal (Clock, I2C, SPI, CAN, etc..) and external peripherals (DAC, ADC, etc..) on Z4_0
- Turn on the desired cores (z2 in my case) and point them to a startup script. This is done though MC_ME[CCTL3], MC_ME[CADDR3]
- Issue a mode transition (DRUN -> DRUN) to turn on the extra cores at their startup script through the MC_ME[MCTL].
- Do stuff on all cores happily
My gap in knowledge currently is in the startup script as I'm not yet versed in PA assembly. I need to understand what sections to include/modify/update in the GCC linker script and what's the minimum necessary startup code to start the core(s).