Hi,
I'm working with the S32K312 and implementing a dual-application bootloader with A/B swap OTA update functionality.
I’d like to understand:
Any Design for how A/B swap working, application note, and memory layout detailed explanation would be helpful.
I referred from NXP is Unified bootloader Demo - NXP Community
Thanks in advance for your help!
解決済! 解決策の投稿を見る。
Hi @DiaDev
AB Swap feature is a HW feature which can be used when HSE firmware is installed.
So, first step is to install HSE firmware (AB Swap version).
The HSE Firmware package can be downloaded from S32K3 Standard Software:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-STDSW-D
Just click on the link and then select „Automotive SW - S32K3 - HSE Firmware “. Here search for latest version for your derivative.
We provide application note which explains how to install the firmware. It’s also available in Documentation -> Secure files: https://www.nxp.com/products/S32K3
Search for document “HSE FW install for S32K3xx”.
It’s also described in HSE-B Firmware Reference Manual rev. 2.4 in section “3 HSE Firmware Installation”.
There are three methods how to install HSE firmware. Please take a look at section “3 HSE Firmware Installation” in HSE-B Firmware Reference Manual v2.4.
The most convenient method for you is probably installation via IVT. Following steps are requires:
- Program HSE feature flag at 0x1B000000. You can do this anywhere and anytime, by your code or by your debugger. It doesn’t matter.
- Load pink file anywhere to flash (together with your application). Do not use areas reserved for HSE.
- Then put an address of the pink file to IVT. See “14.2.2 IVT Structure” in HSE FW RM v2.4.
You can find an example in HSE DemoExamples for this:
https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples
Then search for:
c:\NXP\S32K3_HSE_DemoExamples_1_0_0\S32K3_HSE_DemoExamples\Device_Configuration\S32K344_HSE_FW_INSTALL\
This demo shows all the steps.
Then you can study "S32K3XX HSE and OTA Advance Training" which can be also found in Documentation -> Secure files on S32K3 page.
Here you can find how to swap the partitions (passive and active block):
https://community.nxp.com/t5/S32K/s32k3-flash-swap-requirements/m-p/1920123/highlight/true#M38475
Or we provide OTA Demos which can be find in S32K3 Reference Software package:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-REFSW-D
So, when loading new application to the flash, you are always loading it to passive block. And your application always runs from active blocks. The addresses are always the same. It's remapped by hardware.
Notice that Unified bootloader does not use HSE, so it does not use AB Swap feature.
Regards,
Lukas
Hi @DiaDev
AB Swap feature is a HW feature which can be used when HSE firmware is installed.
So, first step is to install HSE firmware (AB Swap version).
The HSE Firmware package can be downloaded from S32K3 Standard Software:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-STDSW-D
Just click on the link and then select „Automotive SW - S32K3 - HSE Firmware “. Here search for latest version for your derivative.
We provide application note which explains how to install the firmware. It’s also available in Documentation -> Secure files: https://www.nxp.com/products/S32K3
Search for document “HSE FW install for S32K3xx”.
It’s also described in HSE-B Firmware Reference Manual rev. 2.4 in section “3 HSE Firmware Installation”.
There are three methods how to install HSE firmware. Please take a look at section “3 HSE Firmware Installation” in HSE-B Firmware Reference Manual v2.4.
The most convenient method for you is probably installation via IVT. Following steps are requires:
- Program HSE feature flag at 0x1B000000. You can do this anywhere and anytime, by your code or by your debugger. It doesn’t matter.
- Load pink file anywhere to flash (together with your application). Do not use areas reserved for HSE.
- Then put an address of the pink file to IVT. See “14.2.2 IVT Structure” in HSE FW RM v2.4.
You can find an example in HSE DemoExamples for this:
https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples
Then search for:
c:\NXP\S32K3_HSE_DemoExamples_1_0_0\S32K3_HSE_DemoExamples\Device_Configuration\S32K344_HSE_FW_INSTALL\
This demo shows all the steps.
Then you can study "S32K3XX HSE and OTA Advance Training" which can be also found in Documentation -> Secure files on S32K3 page.
Here you can find how to swap the partitions (passive and active block):
https://community.nxp.com/t5/S32K/s32k3-flash-swap-requirements/m-p/1920123/highlight/true#M38475
Or we provide OTA Demos which can be find in S32K3 Reference Software package:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-REFSW-D
So, when loading new application to the flash, you are always loading it to passive block. And your application always runs from active blocks. The addresses are always the same. It's remapped by hardware.
Notice that Unified bootloader does not use HSE, so it does not use AB Swap feature.
Regards,
Lukas