S32K144 Connection Issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K144 Connection Issue

2,861 次查看
Billi2110
Contributor II

Hello All,

I built and flash led a flash project on S32DS with linker file update as shown below:
Before:

 
 

Before.PNG

After change linker:

After.PNG

When connecting to flash to the board, S32DS reports an error as below:

Error1.PNGError2.PNG

I used Kinetis_Recovery_Utility to recover but It still cannot flashCapture.PNG

Please help me solve this error

0 项奖励
回复
7 回复数

2,842 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Billi2110 

The memory range from 0x400 to 0x40F corresponds to the Flash Configuration Field, which stores several flash settings, including important configurations like several flash settings, most importantly the flash protection and system security settings. These settings are copied to the flash registers upon reset.

To prevent accidental locking of devices, the flash configuration field requires special handling. we recommend that, by default, flash programmers write the following value to the flash configuration field:

/* Flash Configuration */
    .section .FlashConfig, "a"
    .long 0xFFFFFFFF     /* 8 bytes backdoor comparison key           */
    .long 0xFFFFFFFF     /*                                           */
    .long 0xFFFFFFFF     /* 4 bytes program flash protection bytes    */
    .long 0xFFFF7FFE     /* FDPROT:FEPROT:FOPT:FSEC(0xFE = unsecured) */

This value places the device in an unsecured state with no flash regions protected. 

When you manipulated the linker file, you might manipulate the system security settings, therem you have disable the JTAG interface.

Refer to the following community threads, which have information related to the topic, it might be useful for you.

S32K148 Secured?

Unbricking S32K146

S32k116 Timeout while unsecuring device. Erase never stops.

 

BR, VaneB

0 项奖励
回复

2,835 次查看
Billi2110
Contributor II

Hi @VaneB 

Refer your comment, I did create the sample project and in the startup_S32K144.S , I added  Flash Configuration as below picture

 

Capture1.PNG

but the issue still occur 

Error1.PNG

 

Capture2.PNG

I don't know whether I have missed something to do it. please help me solve it. Sorry for my inconvenient

Best regards

0 项奖励
回复

2,812 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Billi2110 

The message "Erase to unsecure?" indicates that mass erase is still enabled, which means there is a possibility of unsecuring the device. Please refer to the following community thread, which should be helpful.

Device is secure , erase to unsecure

Additionally, do you still have the changes previously made to the linker file? If so, please use the default project files created by S32DS.

0 项奖励
回复

2,719 次查看
Billi2110
Contributor II

Hi @VaneB ,

Sorry for my reply to late, when I use Jlink to erase secure refer your suggest and get some error, please help me resolve it

Capture3.PNG

0 项奖励
回复

2,709 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Billi2110

As mentioned in the previous community thread, have you already tried using the unlock Kinetis command with J-Link Commander? I am attaching additional threads where this topic has been discussed.

 S32K148 Unsecurity 

How to unlock S32K148 Chip

S32K can not connect after program

0 项奖励
回复

2,698 次查看
Billi2110
Contributor II

Hi @VaneB ,

Actually, I succeeded unlock the device

Capture4.PNG

but after that, I connect and get the error as upper my comment

 

0 项奖励
回复

2,663 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Billi2110 

Could you try using the swdwriteap 1, 0x1 command, which will launch a mass erase operation directly and set Control[0] = 1 after unlocking the Kinetis device?

Additionally, based on your previous responses, I infer that you may have a PEMicro device. If so, could you try selecting the "Emergency Kinetis Device Recovery by Full Chip Erase" option in the S32 Design Studio debug configuration? This will help rule out any potential issues with the J-Link debugger.

0 项奖励
回复