J-Flash Version: V7.94g
Firmware code: just empty main code
S32DS version: S32DS 3.5
RTD version: 4.0.0
We are using our own board, so I wanna know how to unlock the sector to erase or program the sector, because I can successful connect the s32k311 mcu.
When using Jlink to burn the MCU program to the chip of S32k311, the following error occurred.
I have tried the following methods, but the problem still exists:
Trying another Jlink emulator for burning.
Update J-Flash version to V7.94h
- Data file opened successfully (27020 bytes, 1 range, CRC of data = 0x9F3362FB, CRC of file = 0x9F3362FB)
Auto programming target (27020 bytes, 1 range) ...
- Checking if selected data fits into selected flash sectors.
- Start of preparing flash programming
- End of preparing flash programming
- Start of determining dirty areas in flash cache
- End of determining dirty areas
- CPU speed could not be measured.
- Start of erasing sectors
- Blank checking 0x00400000 - 0x00407FFF
- End of erasing sectors
- Start of flash programming
- Programming range 0x00400000 - 0x00407FFF ( 4 Sectors, 32 KB)
- ERROR: Programming failed @ address 0x20000954 (sector is locked)
- End of flash programming
- ERROR: Program failed
- Start of restoring
- ERROR: Timeout while restoring target, RAMCode did not respond in time (PC = 0x2000035A, XPSR = 0x21000000, SP = 0x200008C0)!
- ERROR: Failed to restore target. RAMCode never stops
- End of restoring
- ERROR: Failed to auto program target
Hi @bestegg,
This problem could be because the sector is protected in FPROT.
This is a common practice to protect the bootloader areas as this code does not get erased. If the sectors are protected, they cannot be erased/programmed.
The protection can be removed by a mass erase or the ERSALLU FTFC command. If the CSEc register is enabled, it is blocked.
Just as a note, J-link is not an NXP product, you would get better support from SEGGER: Ticket | SEGGER.
Best regards,
Julián