Hello All,
I built and flash led a flash project on S32DS with linker file update as shown below:
Before:
After change linker:
When connecting to flash to the board, S32DS reports an error as below:
I used Kinetis_Recovery_Utility to recover but It still cannot flash
Please help me solve this error
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.
S32k116 Timeout while unsecuring device. Erase never stops.
BR, VaneB
Hi @VaneB
Refer your comment, I did create the sample project and in the startup_S32K144.S , I added Flash Configuration as below picture
but the issue still occur
I don't know whether I have missed something to do it. please help me solve it. Sorry for my inconvenient
Best regards
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.
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
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.
Hi @VaneB ,
Actually, I succeeded unlock the device
but after that, I connect and get the error as upper my comment
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.