S32K312 Secureboot and Program Flash

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

S32K312 Secureboot and Program Flash

77 Views
jeongwoo
Contributor I

The attached CMM file is a script that writes the FBL and App to the S32K312 MCU and then activates SecureBoot, SecureDebug, and Configuration Lock.

We would like to request a review and improvement regarding the HardFault issue that occurs when running this CMM.

Previously, as shown in the screenshot, a HardFault occurred after the FBL and App were imported when executing "Go," with the JTAG Clock set to 5 MHz throughout.

As a change, we set SYStem.JtagClock to 1 MHz after importing the App file. With this change, HardFaults rarely occurred at the "Go" step when running the CMM, so we concluded that lowering the JTAG Clock speed is an effective approach. However, when the modified CMM is applied, a "stopped by vectbl" error occasionally occurs at "Go" after the FBL and App have been imported.

We kindly ask you to review the CMM so that it can run stably overall, and we would like to inquire about how to improve it so that the "stopped by vectbl" error does not appear at all.

Original CMM: GN7_PE_MAIN_G_SECURE_260412.cmm
Modified CMM (JTAG Clock changed to 1 MHz): GN7_PE_MAIN_G_SECURE_260412_0714RE.cmm


Additionally, we would like to import a different FBL after SecureBoot has been enabled. Is there a way to import a different FBL while SecureBoot is enabled? If it is possible, we would appreciate it if you could provide a guide.

0 Kudos
Reply
1 Reply

27 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @jeongwoo 

The main problem I can see is this:

lukaszadrapa_0-1784181532767.png

 

This means: you load the pink file and you reset the device. After this reset, SBAF is supposed to install HSE firmware. But the key point is - this operation takes about 1 second. But then you reset the MCU again in 0.1s and you are going to reprogram pink file at 0x40_0000 by fbl immediately after that. Increase the waiting time to 1.3s, at least. Otherwise SBAF tries to install HSE FW and you try to reprogram fbl at the same time. 

Regards,

Lukas

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2395220%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K312%20Secureboot%20and%20Program%20Flash%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395220%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20attached%20CMM%20file%20is%20a%20script%20that%20writes%20the%20FBL%20and%20App%20to%20the%20S32K312%20MCU%20and%20then%20activates%20SecureBoot%2C%20SecureDebug%2C%20and%20Configuration%20Lock.%3C%2FP%3E%3CP%3EWe%20would%20like%20to%20request%20a%20review%20and%20improvement%20regarding%20the%20HardFault%20issue%20that%20occurs%20when%20running%20this%20CMM.%3C%2FP%3E%3CP%3EPreviously%2C%20as%20shown%20in%20the%20screenshot%2C%20a%20HardFault%20occurred%20after%20the%20FBL%20and%20App%20were%20imported%20when%20executing%20%22Go%2C%22%20with%20the%20JTAG%20Clock%20set%20to%205%20MHz%20throughout.%3C%2FP%3E%3CP%3EAs%20a%20change%2C%20we%20set%20SYStem.JtagClock%20to%201%20MHz%20after%20importing%20the%20App%20file.%20With%20this%20change%2C%20HardFaults%20rarely%20occurred%20at%20the%20%22Go%22%20step%20when%20running%20the%20CMM%2C%20so%20we%20concluded%20that%20lowering%20the%20JTAG%20Clock%20speed%20is%20an%20effective%20approach.%20However%2C%20when%20the%20modified%20CMM%20is%20applied%2C%20a%20%22stopped%20by%20vectbl%22%20error%20occasionally%20occurs%20at%20%22Go%22%20after%20the%20FBL%20and%20App%20have%20been%20imported.%3C%2FP%3E%3CP%3EWe%20kindly%20ask%20you%20to%20review%20the%20CMM%20so%20that%20it%20can%20run%20stably%20overall%2C%20and%20we%20would%20like%20to%20inquire%20about%20how%20to%20improve%20it%20so%20that%20the%20%22stopped%20by%20vectbl%22%20error%20does%20not%20appear%20at%20all.%3C%2FP%3E%3CP%3EOriginal%20CMM%3A%20GN7_PE_MAIN_G_SECURE_260412.cmm%3CBR%20%2F%3EModified%20CMM%20(JTAG%20Clock%20changed%20to%201%20MHz)%3A%20GN7_PE_MAIN_G_SECURE_260412_0714RE.cmm%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EAdditionally%2C%20we%20would%20like%20to%20import%20a%20different%20FBL%20after%20SecureBoot%20has%20been%20enabled.%20Is%20there%20a%20way%20to%20import%20a%20different%20FBL%20while%20SecureBoot%20is%20enabled%3F%20If%20it%20is%20possible%2C%20we%20would%20appreciate%20it%20if%20you%20could%20provide%20a%20guide.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2395715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K312%20Secureboot%20and%20Program%20Flash%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F231811%22%20target%3D%22_blank%22%3E%40jeongwoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20main%20problem%20I%20can%20see%20is%20this%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lukaszadrapa_0-1784181532767.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_0-1784181532767.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392423i6C2F705CBF74565B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_0-1784181532767.png%22%20alt%3D%22lukaszadrapa_0-1784181532767.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThis%20means%3A%20you%20load%20the%20pink%20file%20and%20you%20reset%20the%20device.%20After%20this%20reset%2C%20SBAF%20is%20supposed%20to%20install%20HSE%20firmware.%20But%20the%20key%20point%20is%20-%20%3CSTRONG%3Ethis%20operation%20takes%20about%201%20second%3C%2FSTRONG%3E.%20But%20then%20you%20reset%20the%20MCU%20again%20in%200.1s%20and%20you%20are%20going%20to%20reprogram%20pink%20file%20at%200x40_0000%20by%20fbl%20immediately%20after%20that.%20Increase%20the%20waiting%20time%20to%201.3s%2C%20at%20least.%20Otherwise%20SBAF%20tries%20to%20install%20HSE%20FW%20and%20you%20try%20to%20reprogram%20fbl%20at%20the%20same%20time.%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3ELukas%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E