How to unlock S32K148 Chip

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

How to unlock S32K148 Chip

Jump to solution
5,484 Views
VinhNguyen13
Contributor II

I used J-Link V9 to connect and flash SW for FS32K148 chip, but I faced this issue as picture below.

VinhNguyen13_0-1608265265033.png

From my understanding, my chip is locked due to the wrong data is written to the flash at Address 0x400 -> 0x40F (related to protection bytes).

I tried to unlock chip by command:

[

J-Link>r0 // pull reset pin low

J-Link>swdwritedp 2,0x01000000 // MDM_AP status register

J-Link>swdreadap 0 // Read MDM_AP status register
J-Link>swdreadap 0 // Read MDM_AP status register (has to be done 2x) Flash memory ready and Mass erase enable bits should be set

J-Link>swdreadap 1 // Read MDM_AP control register
J-Link>swdreadap 1 // Read MDM_AP control register (has to be done 2x)

J-Link>unlock Kinetis // Erase and unsecure the MCU

]

But I can't. The error shown that:

VinhNguyen13_1-1608265584055.png

VinhNguyen13_2-1608265600338.png

 

Is there anyone faced this issue? Could you please to support for fixing this.

Thank you.

 

0 Kudos
Reply
1 Solution
5,452 Views
VinhNguyen13
Contributor II

Hello Alexis,

I unlocked the ECU successfully!

The hints are: connect the Reset Pin (in JTAG) to the GND. Then, performing the unlocking procedure. After that, I loaded the correct source code (srec file) by Production Programming. Now the ECU is alive. 

Best Regards

View solution in original post

0 Kudos
Reply
3 Replies
5,456 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @VinhNguyen13,

Writing to this register without taking care of the bits written will lock the MCU without the recovery option and for the messages in the debug probe looks like that this is the case.  You can take a look at the description of this register at the RM 36.4.1 Flash configuration field description.

Best Regards,

Alexis Andalon

0 Kudos
Reply
5,453 Views
VinhNguyen13
Contributor II

Hello Alexis,

I unlocked the ECU successfully!

The hints are: connect the Reset Pin (in JTAG) to the GND. Then, performing the unlocking procedure. After that, I loaded the correct source code (srec file) by Production Programming. Now the ECU is alive. 

Best Regards

0 Kudos
Reply
5,227 Views
KiranE
Contributor I

Hi VinhNguyen13,

I am also facing the same issue. Getting time out error while unlocking the device. I have followed the procedure as mentioned. I have connected reset pin to ground and executed the J-Link commands as follows

J-Link>r0

J-Link>si 1

J-Link>swdselect

J-Link>swdwritedp 2, 0x01000000

J-Link>swdreadap 0

J-Link>swdreadap 0

J-Link>swdreadap 1

J-Link>swdreadap 1

J-Link>unlock Kinetis

J-Link Command line Unlock.png

Am I missing anything here? Thanks

 

 

 

 

 

 

 

0 Kudos
Reply