S32K358 HSE not initializing after flash erase Hello NXP Team, I am working with an S32K358 and have enabled HSE with AB-SWAP (OTA). HSE was previously working, but after flashing a combined bootloader + application image and performing a partial code flash erase, HSE is no longer initializing. Environment MCU: S32K358 HSE: AB-SWAP / OTA enabled HSE FW: s32k358_hse_fw_1.14.0_2.40.0_pb230807.bin.pink Installer: S32K344_HSE_FW_INSTALL with AB-SWAP configuration Debugger: J-Link / PEmicro through S32 Design Studio Application: Custom BMS bootloader + application using HSE for SHA-256/RSA secure boot functionality Current Issue After the flash operation, Hse_Ip_GetHseStatus() does not return an initialized HSE status. The MU0 FSR (0x4038C104) remains 0x00000000, and the installer application gets stuck in HseFwInstall_WaitInitOk() and eventually reports HSE_INSTALL_MU_TIMEOUT. The following observations were made: 0x4038C104 (MU0 FSR) = 0x00000000 0x1B000000 (UTEST HSE feature flag) = DDCCBBAA AABBCCDD 0x00400000 contains data beginning with 60FFFFDB... HSE passive region 0x00BD4000 cannot be read through the debugger J-Link verification of the passive region fails Directly loading the .pink file with J-Link reports that the file format is unsupported We erased the application/code flash area: 0x00400000 – 0x0068FFFF Our understanding is that this does not overlap the HSE/sBAF reserved region: 0x00BD4000 – 0x00BFFFFF Questions Could you please advise on the correct HSE recovery/reinstallation procedure for S32K358 with AB-SWAP enabled when MU FSR remains 0x00000000? Specifically: Is the HSE passive region expected to be unreadable through J-Link after HSE is enabled/protected? For recovery, should we use the complete HSE installer ELF with the required IVT/boot header rather than directly programming the .pink file? If the UTEST HSE feature flag is already programmed and HSE firmware data is present at 0x00400000, what conditions could prevent sBAF from installing or initializing HSE firmware during POR? Could the LC state or compatibility between the sBAF version and HSE firmware version cause the installation to fail without an obvious error? When MU0 FSR remains 0x00000000, which registers or status bits should we check to identify the reason for the HSE boot/install failure? Is there any specific AB-SWAP recovery sequence that should be followed after a partial code flash erase? The expected behavior is that after a successful POR and HSE initialization, MU0 FSR should indicate HSE_STATUS_INIT_OK and HSE_STATUS_RNG_INIT_OK, allowing HSE services to be used. Any guidance on the correct recovery procedure and the registers/debug information we should collect would be greatly appreciated. Thank you. Re: S32K358 HSE not initializing after flash erase I think the first thing to clarify is whether HSE was ever successfully installed and running on this device, or whether you are trying to perform the initial HSE installation after programming the UTEST flag and flashing the HSE image to 0x00400000.
From your description, it is not clear whether HSE was previously installed and working and then stopped initializing after the flash erase, or whether this is the first installation attempt and sBAF never installed the HSE firmware during POR.
This information would significantly narrow down the possible root causes. If HSE was working before, we would focus on what changed and whether the firmware was invalidated or erased. If it never worked, we would focus on the installation prerequisites and image validity. Re: S32K358 HSE not initializing after flash erase Hello David, To confirm, HSE was successfully installed and was working correctly on this device before the flash erase operation. This is not the initial HSE installation attempt. After the HSE installation, I verified that HSE was functioning correctly using the HSE Crypto example. In particular, I successfully performed the SHA-256 hash algorithm, which confirmed that HSE was initialized and the HSE crypto services were working properly. The sequence of events was: I successfully installed HSE with AB-SWAP/OTA configuration. I verified that HSE initialization was successful. I tested the HSE Crypto functionality and successfully executed SHA-256. I then programmed my combined bootloader + application image. During the subsequent debugging/programming activity, I performed a partial code flash erase from: 0x00400000 – 0x0068FFFF After this erase operation and POR, HSE stopped initializing. Currently, Hse_Ip_GetHseStatus() does not indicate an initialized HSE, and the installer gets stuck in HseFwInstall_WaitInitOk() and eventually reports HSE_INSTALL_MU_TIMEOUT. Therefore, I believe the issue is related to something that changed during the flash erase/programming operation, rather than an initial HSE installation problem. I would like to understand whether the erase range could have affected any HSE firmware, AB-SWAP metadata, boot configuration, or other HSE-related information required for HSE initialization. Please let me know what additional memory locations or register values I should check to determine what was affected.
View full article