Hello @zhou_gaga,
The MCU stays unloked as long as the MCU is not reset.
After any reset, the MCU is locked again.
So, the programmer must not reset the MCU.
Please contact SEGGER support if you want to reprogram the MCU using J-Flash.
Thank you,
BR, Daniel
For example, the PEMicro plugin in the S32DS IDE has this feature that allow connecting the programmer without reset.
This way, we can attach the debugger while the MCU is unlocked and running.
For more information about the J-Flash flashing algorithm, please contact SEGGER.
Thank you,
BR, Daniel
Hello @zhou_gaga,
In the attach debug session, the MCU is not being programmed, it is just attached to the MCU while the MCU is running the previously loaded project.
I would recommend contacting PEMicro support and ask for an algorithm the does not reset the MCU before the flashing.
You could also you J-link commander:
Once the MCU is unlocked, a special J-Link script is necessary, which can be found here: https://wiki.segger.com/S32Kxxx#Attach_to_debug_session
J-Link commander need to be called in the following way:
C:\Programm\SEGGER\JLink\JLink.exe -JLinkScriptFile NXP_Kinetis_S32_Attach.JLinkScript
Then, the MCU is not reseted and access to all memory and registers is possible.
You can try to load the project via the commander.
Or please contact SEGGER support.
Regards,
Daniel
Hello @zhou_gaga,
You are supposed to get a warning, the core is running.
The debugger is attached to a running target.
Can you halt the execution?
Regards,
Daniel