Hello,
I am struggling to create a project with a single elf output where after my own hardware initialisation, the z4_0 core turns on the z2 core to take over tasks.
I am aware of the SingleElf_MPC5748G and multi-core example projects like the interrupt_control_multicore, however I would need their merger, ideally with the least extra custom code (using the SDK's startup code for example).
Is there a way to do this? I understand that I may need to modify my linker file for this.
Thanks for any help!
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:
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).
Hello,
Your approach is basically correct.
Yes
Initialize my hardware's internal (Clock, I2C, SPI, CAN, etc..) and external peripherals (DAC, ADC, etc..) on Z4_0
Not necessarily. This is application specific. But usually you initialize those before going into the safety application execution.
3.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]
This also depends. If you do initialization on Z4, as the memories and peripherals are common. You can start with code execution directly, if they are already configured/initialized.
4. Issue a mode transition (DRUN -> DRUN) to turn on the extra cores at their startup script through the MC_ME[MCTL].
Yes
Best regards,
Peter
Hi Peter,
Thank you, in the meantime I managed to make it work with minimal extra code.
David
Hello,
Creating a single elf for multicore project is quite challenging. I am not sure what you want to achieve by it, but it requires good knowledge on compiler and project manager. (no matter which one you use).
I do not expect there is already example code in SDK for such case.
As you are talking about tasks I expect you are using some OS, this makes things even harder.
Do you really want to use the single output file for multiple cores? What is the reason for that?
Best regards,
Peter