Hi @Ranjith_kumar
We provide HSE DemoExamples:
https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples
It contains project S32K344_HSE_FW_INSTALL which can be quite easily ported to other S32K3 derivatives.
But you can use any project to install HSE firmware. It’s just necessary to do following steps:
- program HSE feature flag in OTP UTEST memory at 0x1B00_0000. This can be done either “manually” by normal flash programming (this is shown in mentioned S32K344_HSE_FW_INSTALL) or this can be done automatically by SBAF if you set FW_USAGE_FLAG_PROGRAM bit in boot configuration word. Notice that this automatic programming feature is available only on SBAF version 0.15.0 and higher. If you have some very old device, it may not work and manual programming will be required.
- program pink file somewhere to flash memory and add pointer to the pink file to IVT at offset 0x2C.
Then just reset the MCU (2x in case of FULL_MEM firmware, 3x in case of AB_SWAP firmware) and that’s it.
At low level, it looks like this:
This is IVT of some application (several locations can be used, data flash is used in this case) which has FW_USAGE_FLAG_PROGRAM set and which contains pointer to FW image:

The pink file is programmed to 0x480000:

After the resets, the feature flag is automatically programmed in the UTEST and HSE firmware is installed (bit 0 in HSE GPR register at 0x4039_C028 is set):

In the S32K344_HSE_FW_INSTALL, the feature flag is programmed by the software – see main.c file.
The pointer is added to IVT in file boot_header.c.
And pink file is linked to the project in S32K344_flash_full_mem.ld or in S32K344_flash_ab_swap.ld, depending on required configuration.
For details, see following resources in HSE-B firmware reference manual rev. 2.8:
Table 17. BCW content
Table 119. BCW bit mapping
Table 118. IVT structure
Table 143. Status Bits on HSE_CONFIG_GPR3 (0x4039C028)
How to implement it in your project if you have standard RTD project:
- open startup_cm7.s file and add pointer to pink file at offset 0x2C:

- set bit 9 in Boot Configuration Word which is also in IVT at offset 0x4:

- and then go to the linker file (like “linker_flash_s32k322.ld”) and link the pink file in the same way as you can see in project S32K344_HSE_FW_INSTALL.


That’s all, just build the project, load it to MCU and reset the device several times.
How to get latest production version of HSE firmware for S32K322:
Go to S32K3 Standard Software:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-STDSW-D
Select “Automotive SW - S32K3 - HSE Firmware”
Here search for 0.2.55.0 for S32K3x2 and S32K3x4:

Download HSE_FW_S32K342_0.2.55.0_D2512.exe – this one covers also S32K322.
And the last thing - if you use Trace32 from Lauterbach, you can use attached script to install the firmware. It uses default location method.
Regards,
Lukas