Hi @HaileyByun
"During the flashing process, we frequently encounter a "cannot access memory" error, and sometimes the MCU becomes locked. This issue seems to occur especially after programming the HSE image."
- This seems to be the most important point. Did you select the right flash algorithm once HSE firmware is installed? You can take a look at:
https://www.pemicro.com/arm/device_support/NXP_Automotive/S32K3xx/S32K312/index.cfm
There are three algorithms:
nxp_s32k312_1x32x500k_hse_disabled.arp
nxp_s32k312_1x32x424k_ab_swap.arp
nxp_s32k312_1x32x456k_hse_enabled.arp
When HSE feature flash in UTEST is programmed, flash areas reserved for FULL_MEM version of firmware are removed from the memory map. Once AB_SWAP firmware is installed, additional area for active block is reserved in the memory.
Pemicro programmer needs to be informed about this - it's necessary to select the right algorithm. Then it will not touch those reserved areas.
Isn't this the root cause?
To answer your questions:
- Is a full power cycle (complete power-off and power-on) strictly required after programming the HSE image?
No, reset is sufficient. Notice that two resets are necessary after installation of AB_SWAP version because the firmware needs to be copied to both active and passive partition (it's done automatically).
- Are there any recommended flash sequences or precautions when using Cyclone scripts for S32K312, especially regarding HSE and memory swap?
It's necessary to select the right flash algorithm as mentioned above.
- Are there any additional considerations when using the memory swap feature?
After each swap, it takes about 1s to backup the HSE firmware to passive partition. Application (and also flash programmer in this case) should wait until this operation is finished (until HSE_STATUS_INIT_OK is set).
- If the MCU becomes locked, what are the recommended recovery methods (e.g., Secure Boot Recovery Tool)?
It depends what "locked" means. Does your application configure secure boot? Is ADKP set and is life cycle advanced? Are you able to establish a connection via your debugger?
Regards,
Lukas