Secure Boot Issue: Application Not Jumping After Firmware Update (S32K344, SHE/HSE Example)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Secure Boot Issue: Application Not Jumping After Firmware Update (S32K344, SHE/HSE Example)

504 Views
taraprasad
Contributor I

I am working with the NXP S32K344 Secure Boot example using SHE standard (HSE), and have encountered an issue where, after updating the firmware and following the proper SMR/CMAC update procedure, the application does not jump to the user code after reset. All status responses from the HSE API are OK, but the boot does not proceed as expected.

## Debug Information

Board: S32K3X4EVB-T172
Example Project: S32K344_Hse_SHE_SecureBoot_Example

1. Original (Working) Binary Properties
- File name: `S32K344_SecureBoot_AppBL.bin`
- Size: **4096bytes** (4 KB)
- Secure Boot passes and jumps to user code.

2. After Firmware Change (Increased Delay in Code)
- File name: Same as above.
- Size: **4096 bytes** (no change)
- Changed only a delay in the firmware.

3. Secure Boot/CMAC/SMR Steps Followed

- Generated new CMAC with `AesCmacGenerate` over the correct region (4096 bytes).
- Installed new SMR entry with `HSE_InstallSmrEntry` (received `HSE_SRV_RSP_OK`).
- Installed new Core Reset entry with `HSE_InstallCoreResetEntry` (received `HSE_SRV_RSP_OK`).
- All APIs return `HSE_SRV_RSP_OK`.
- After reset, **boot does not jump to application**.

4. Code/Configuration Details

- In `main.c` and SMR config, binary length (`smrSize`, `codeLength`, CMAC region) set to **4096** bytes (matches actual file size).
- App boot header uses `.codeLength = 4096`.
- No error responses from any HSE calls.
- Keys and catalog setup as per NXP example.

Why does Secure Boot not jump to the application after a minor firmware change, even though all SMR/CMAC updates and responses are OK?
Is there a known issue with the NXP example flow, or is there an undocumented step required (e.g., flash erasure, header field, alignment)?

Steps to Reproduce

1. Build and flash working example; Secure Boot passes.
2. Make a small code change (increase delay), rebuild. Binary size remains 4096 bytes.
3. Regenerate CMAC over new binary, update SMR entry, update Core Reset entry.
4. Flash new binary.
5. On reset, app does not start, even though all API calls return OK.





0 Kudos
Reply
1 Reply

479 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @taraprasad 

Have you got correct response from all services called from ConfigSHESecureBoot function? What was the content of smrCoreStatus_Get?
I would try to erase the HSE data flash by service HSE_SRV_ID_ERASE_HSE_NVM_DATA to start over from defined point.
If you use Lauterbach debugger, you can use attached script. Or you can do this in any debugger manually: disable data cache if it is enabled. Write value 0x50 to any 32bit word in RAM and then write address of this word to TR[0] register in MU_0 (address is 0x4038C200). This will launch the HSE_SRV_ID_ERASE_HSE_NVM_DATA service. The response then can be read from RR[0] register.
Please let me know if this doesn't help.

Regards,
Lukas

0 Kudos
Reply