S32K344 Basic SecureBoot Example Flash write TAG failed

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

S32K344 Basic SecureBoot Example Flash write TAG failed

318 Views
PaulHu
Contributor II

I am running Basic_SecureBoot example on S32K388 EVB which is located in S32K3_HSE_DemoExamples_1_0_0\S32K3_HSE_DemoExamples\Secure_Boot\S32K344_Basic_SecureBoot

It failed at Flash_write() step with status = 0x2c100, "Write the generated TAG to the end of the application in FLASHWrite the generated TAG to the end of the application in FLASH".

I have run HSE_FW_INSTALL -> CQC_DEMO (Program ADKP) -> PEmicro Authentication.

What else should I do to enable Flash_write()?

Tags (1)
0 Kudos
Reply
1 Reply

299 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @PaulHu 

If you run this code with no changes on S32K388, it won't work because the flash layout is different.
You can find in the code:

lukaszadrapa_0-1758106090587.png

On S32K344, first sector in block 1 is going to be programmed because S32K344_SecureBootBlinky is forced to this block:

lukaszadrapa_1-1758106113118.pnglukaszadrapa_2-1758106119993.png


But there are 2MB blocks on S32K388, so it's different here:

lukaszadrapa_3-1758106137009.png

It's still block 0, so you need to unlock different block and sector. 

And one more thing - be aware that read-while-write (RWW) is supported only between blocks. When block 0 is being programmed, the code must run from another flash block or from RAM. 

Regards,

Lukas

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2170927%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K344%20Basic%20SecureBoot%20Example%20Flash%20write%20TAG%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2170927%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EI%20am%20running%20Basic_SecureBoot%20example%20on%20S32K388%20EVB%20which%20is%20located%20in%20S32K3_HSE_DemoExamples_1_0_0%5CS32K3_HSE_DemoExamples%5CSecure_Boot%5CS32K344_Basic_SecureBoot%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIt%20failed%20at%20Flash_write()%20step%20with%20status%20%3D%200x2c100%2C%20%22Write%20the%20generated%20TAG%20to%20the%20end%20of%20the%20application%20in%20FLASHWrite%20the%20generated%20TAG%20to%20the%20end%20of%20the%20application%20in%20FLASH%22.%3C%2FP%3E%3CP%3EI%20have%20run%20HSE_FW_INSTALL%20-%26gt%3B%20CQC_DEMO%20(Program%20ADKP)%20-%26gt%3B%20PEmicro%20Authentication.%3C%2FP%3E%3CP%3EWhat%20else%20should%20I%20do%20to%20enable%20Flash_write()%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2171082%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K344%20Basic%20SecureBoot%20Example%20Flash%20write%20TAG%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2171082%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%2F249229%22%20target%3D%22_blank%22%3E%40PaulHu%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20run%20this%20code%20with%20no%20changes%20on%20S32K388%2C%20it%20won't%20work%20because%20the%20flash%20layout%20is%20different.%20%3CBR%20%2F%3EYou%20can%20find%20in%20the%20code%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-1758106090587.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_0-1758106090587.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357302i95A4631911E3969A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_0-1758106090587.png%22%20alt%3D%22lukaszadrapa_0-1758106090587.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOn%20S32K344%2C%20first%20sector%20in%20block%201%20is%20going%20to%20be%20programmed%20because%20S32K344_SecureBootBlinky%20is%20forced%20to%20this%20block%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lukaszadrapa_1-1758106113118.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_1-1758106113118.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357303iE96A89CC7A923210%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_1-1758106113118.png%22%20alt%3D%22lukaszadrapa_1-1758106113118.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lukaszadrapa_2-1758106119993.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_2-1758106119993.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357304i8F3729484B78A4AF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_2-1758106119993.png%22%20alt%3D%22lukaszadrapa_2-1758106119993.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBut%20there%20are%202MB%20blocks%20on%20S32K388%2C%20so%20it's%20different%20here%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lukaszadrapa_3-1758106137009.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_3-1758106137009.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357305iC6F7A85A4B180EFC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_3-1758106137009.png%22%20alt%3D%22lukaszadrapa_3-1758106137009.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIt's%20still%20block%200%2C%20so%20you%20need%20to%20unlock%20different%20block%20and%20sector.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20one%20more%20thing%20-%20be%20aware%20that%20read-while-write%20(RWW)%20is%20supported%20only%20between%20blocks.%20When%20block%200%20is%20being%20programmed%2C%20the%20code%20must%20run%20from%20another%20flash%20block%20or%20from%20RAM.%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