S32K146 Unsecuring Problem

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

S32K146 Unsecuring Problem

Jump to solution
940 Views
wane
Contributor I
Hello.
 
Can anyone help for unsecure my board?
I had erased all flash blocks using SDK driver function FLASH_DRV_EraseAllBlock().
After this job, I can't access to MCU resources using JTAG connection.
Hence I tried to mass erase using MDM-AP as follows but I didn't get success.
 
1) MDM-AP Status Read after power on reset
 Two values of 0x34 and 0x36 are repeated. It seems the Flash Memory Ready bit is changing.
2) MDM-AP Status Read after mass erase request
 Two values of 0x35 and 0x37 are repeated. It also seems the Flash Memory Ready bit is changing.
3) Mass Erase Step
- WHILE (Data.Long(EDBG:0x40000100)&0x02)!=0x02 {} // wait flash ready
- Data.Set EDBG:0x40000104 %long 0x1               // mass erase
- WHILE (Data.Long(EDBG:0x40000104)&0x01)==0x01 {} // wait mass erade done
- Data.Set EDBG:0x40000104 %long 0x18              // system reset
4) Test of Mass Erase on normal unsecured board
 I have checked upper 3) Mass Erase Step works well.
 
Best Regards,
J.W.Park
Tags (1)
0 Kudos
Reply
1 Solution
906 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @wane,

The FLASH_DRV_EraseAllBlock() always puts the MCU in the secure state. The flash operation could have failed and it could left the flash in an undefined state with ECC errors.

In case the FlexNVM was partitioned with CSEC keys allocated, the Mass erase will be blocked by the engine regardless of the MDM-AP Status[Flash ready].

Have you tried erasing the MCU while it is in reset? After power-on reset keep PTA5 (reset_b) connected to the ground externaly? If this does not resolve it, I'm afraid there is nothing we can do.

 

Regards,

Daniel

 

 

View solution in original post

0 Kudos
Reply
2 Replies
891 Views
wane
Contributor I

Hi Daniel,

 

Thanks for your information.

I'll try again with your suggestion.

 

Regards,

0 Kudos
Reply
907 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @wane,

The FLASH_DRV_EraseAllBlock() always puts the MCU in the secure state. The flash operation could have failed and it could left the flash in an undefined state with ECC errors.

In case the FlexNVM was partitioned with CSEC keys allocated, the Mass erase will be blocked by the engine regardless of the MDM-AP Status[Flash ready].

Have you tried erasing the MCU while it is in reset? After power-on reset keep PTA5 (reset_b) connected to the ground externaly? If this does not resolve it, I'm afraid there is nothing we can do.

 

Regards,

Daniel

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2026120%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K146%20Unsecuring%20Problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2026120%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3EHello.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ECan%20anyone%20help%20for%20unsecure%20my%20board%3F%3C%2FDIV%3E%3CDIV%3EI%20had%20erased%20all%20flash%20blocks%20using%20SDK%20driver%20function%20FLASH_DRV_EraseAllBlock().%3C%2FDIV%3E%3CDIV%3EAfter%20this%20job%2C%20I%20can't%20access%20to%20MCU%20resources%20using%20JTAG%20connection.%3C%2FDIV%3E%3CDIV%3EHence%20I%20tried%20to%20mass%20erase%20using%20MDM-AP%20as%20follows%20but%20I%20didn't%20get%20success.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E1)%20MDM-AP%20Status%20Read%20after%20power%20on%20reset%3C%2FDIV%3E%3CDIV%3E%26nbsp%3BTwo%20values%20of%200x34%20and%200x36%20are%20repeated.%20It%20seems%20the%20Flash%20Memory%20Ready%20bit%20is%20changing.%3C%2FDIV%3E%3CDIV%3E2)%20MDM-AP%20Status%20Read%20after%20mass%20erase%20request%3C%2FDIV%3E%3CDIV%3E%26nbsp%3BTwo%20values%20of%200x35%20and%200x37%20are%20repeated.%20It%20also%20seems%20the%20Flash%20Memory%20Ready%20bit%20is%20changing.%3C%2FDIV%3E%3CDIV%3E3)%20Mass%20Erase%20Step%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E-%20WHILE%20(Data.Long(EDBG%3A0x40000100)%26amp%3B0x02)!%3D0x02%20%7B%7D%20%2F%2F%20wait%20flash%20ready%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E-%20Data.Set%20EDBG%3A0x40000104%20%25long%200x1%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F%2F%20mass%20erase%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E-%20WHILE%20(Data.Long(EDBG%3A0x40000104)%26amp%3B0x01)%3D%3D0x01%20%7B%7D%20%2F%2F%20wait%20mass%20erade%20done%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E-%20Data.Set%20EDBG%3A0x40000104%20%25long%200x18%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%2F%2F%20system%20reset%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E4)%20Test%20of%20Mass%20Erase%20on%20normal%20unsecured%20board%3C%2FDIV%3E%3CDIV%3E%26nbsp%3BI%20have%20checked%20upper%203)%20Mass%20Erase%20Step%20works%20well.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EBest%20Regards%2C%3C%2FDIV%3E%3CDIV%3EJ.W.Park%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2027032%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K146%20Unsecuring%20Problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2027032%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Daniel%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%20for%20your%20information.%3C%2FP%3E%3CP%3EI'll%20try%20again%20with%20your%20suggestion.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ERegards%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2026632%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K146%20Unsecuring%20Problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2026632%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229243%22%20target%3D%22_blank%22%3E%40wane%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThe%20FLASH_DRV_EraseAllBlock()%20always%20puts%20the%20MCU%20in%20the%20secure%20state.%20The%20flash%20operation%20could%20have%20failed%20and%20it%20could%20left%20the%20flash%20in%20an%20undefined%20state%20with%20ECC%20errors.%3C%2FP%3E%0A%3CP%3EIn%20case%20the%20FlexNVM%20was%20partitioned%20with%20CSEC%20keys%20allocated%2C%20the%20Mass%20erase%20will%20be%20blocked%20by%20the%20engine%20regardless%20of%20the%20MDM-AP%20Status%5BFlash%20ready%5D.%3C%2FP%3E%0A%3CP%3EHave%20you%20tried%20erasing%20the%20MCU%20while%20it%20is%20in%20reset%3F%20After%20power-on%20reset%20keep%20PTA5%20(reset_b)%20connected%20to%20the%20ground%20externaly%3F%20If%20this%20does%20not%20resolve%20it%2C%20I'm%20afraid%20there%20is%20nothing%20we%20can%20do.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E