I have been working on the firmware upgrade process for the S32K144 microcontroller. The memory architecture includes a bootloader and two applications, App1 and App2.
Here is what I have done so far:
Now, I am creating a single HEX file for both applications, starting at address 0x11000. When I download it at 0x11000, it downloads and jumps to the correct address. However, when I download the same HEX file at 0x42000, it successfully downloads but does not jump to 0x42000. Instead, it still jumps to 0x11000.
This issue seems to be related to the vector table. Before jumping to 0x42000, the SP and PC values are updated to 0x42000 but still it not jumps.
Let me know if this use case is possible and what changes are required.
Hi @stark21
You wrote:
"When I download it at 0x11000, it downloads and jumps to the correct address. However, when I download the same HEX file at 0x42000, it successfully downloads but does not jump to 0x42000. Instead, it still jumps to 0x11000."
If you load the same hex file to different addresses, it would have to be compiled as Position Independent Code. But according to your description, it's not compiled as PIC.
I know that PIC is supported by IAR compiler (it's also mentioned in our application note AN12323 S32K1xx Firmware updates). In case of S32DS it's not so straightforward. You can take a look at this article:
Read also the comments below.
Another option is to have the same application compiled for both addresses. Then just pick up the right image when loading new application to certain slot.
Regards,
Lukas
Hi Lukas,
We reviewed the article you mentioned, but the information provided seems to be insufficient. Could you please share any additional documentation or articles that outline the correct steps to follow in the case of S32DS?
Thank you
Could you please ask in this forum?
https://community.nxp.com/t5/S32-Design-Studio/bd-p/s32ds
I have never tried this but S32 Design Studio experts should be able to provide more help. Thank you.