S32K1 attach gdbserver without reset

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

S32K1 attach gdbserver without reset

跳至解决方案
3,194 次查看
peacefulcarrot
Contributor II

Hi,

I am trying to attach my debugger (SEGGER J-Link) to a running target to debug it. However, when starting the gdb server, the target seems to reset.

Steps to reproduce this issue:

1. Start SEGGER J-Link Remote Server

2. Start gdb server (in WSL2) using the following command: `JLinkGDBServerCLExe -device S32K144W -endian little -if SWD -speed auto -noir -noLocalhostOnly -nologtofile -TelnetPort 19020 -select IP=192.168.x.y -noreset -nohalt`

Observer behaviour:

When the command is run, the RESET pin is pulled down for 160ms. The running program is stopped (observed by the blinking led that stops). After ~4 seconds, the gdbserver is attached (> `Connected to target`) and the application starts again (led blinking). However, the application was reset, which is not as desired.

Any idea to why this would be or what I could do to find the cause? The reset reason seems to be SW reset.

The used MCU is a S32K144W on a custom board. Debugging etc works without a problem, the issue I am having is just that I cannot attach to a running target.

0 项奖励
回复
1 解答
3,173 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

HI @peacefulcarrot,

It is necessary that the MCU is in the unlocked state.


A special JLink script is needed, which can be found here:

https://wiki.segger.com/S32Kxxx#Attach_to_debug_session

JLink commander has to be called in following way:

C:\Programme\SEGGER\JLink\JLink.exe -JLinkScriptFile NXP_Kinetis_S32_Attach.JLinkScript

Then, the MCU is not reset, and access to all memory and registers is possible.

 

Please contact SEGGER support if you have any questions,

 

Regards,

Daniel

在原帖中查看解决方案

2 回复数
3,174 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

HI @peacefulcarrot,

It is necessary that the MCU is in the unlocked state.


A special JLink script is needed, which can be found here:

https://wiki.segger.com/S32Kxxx#Attach_to_debug_session

JLink commander has to be called in following way:

C:\Programme\SEGGER\JLink\JLink.exe -JLinkScriptFile NXP_Kinetis_S32_Attach.JLinkScript

Then, the MCU is not reset, and access to all memory and registers is possible.

 

Please contact SEGGER support if you have any questions,

 

Regards,

Daniel

3,169 次查看
peacefulcarrot
Contributor II

Hi @danielmartynek ,

Using the script when starting the gdb server solved the problem.

`JLinkGDBServerCLExe -device S32K144W -endian little -if SWD -speed auto -noir -noLocalhostOnly -nologtofile -TelnetPort 19020 -select IP=192.168.x.y -JLinkScriptFile NXP_Kinetis_S32_Attach.JLinkScript -nohalt`

Thank you very much and have a nice day!

%3CLINGO-SUB%20id%3D%22lingo-sub-1888731%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K1%E6%97%A0%E9%9C%80%E9%87%8D%E7%BD%AE%E5%8D%B3%E5%8F%AF%E8%BF%9E%E6%8E%A5gdbserver%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1888731%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%9D%E8%AF%95%E5%B0%86%E6%88%91%E7%9A%84%E8%B0%83%E8%AF%95%E5%99%A8%EF%BC%88SEGGER%20J-Link%EF%BC%89%E8%BF%9E%E6%8E%A5%E5%88%B0%E6%AD%A3%E5%9C%A8%E8%BF%90%E8%A1%8C%E7%9A%84%E7%9B%AE%E6%A0%87%E6%9D%A5%E8%B0%83%E8%AF%95%E5%AE%83%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E5%90%AF%E5%8A%A8%20gdb%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%EF%BC%8C%E7%9B%AE%E6%A0%87%E4%BC%BC%E4%B9%8E%E9%87%8D%E7%BD%AE%E4%BA%86%E3%80%82%3C%2FP%3E%3CP%3E%E9%87%8D%E7%8E%B0%E6%AD%A4%E9%97%AE%E9%A2%98%E7%9A%84%E6%AD%A5%E9%AA%A4%EF%BC%9A%3C%2FP%3E%3CP%3E1.%E5%90%AF%E5%8A%A8SEGGER%20J-Link%E8%BF%9C%E7%A8%8B%E6%9C%8D%E5%8A%A1%E5%99%A8%3C%2FP%3E%3CP%3E2.%20%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%E5%90%AF%E5%8A%A8%20gdb%20%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88%E5%9C%A8%20WSL2%20%E4%B8%AD%EF%BC%89%EF%BC%9A%60JLinkGDBServerCLExe%20-device%20S32K144W%20-endian%20little%20-if%20SWD%20-speed%20auto%20-noir%20-noLocalhostOnly%20-nologtofile%20-TelnetPort%2019020%20-select%20IP%3D192.168.xy%20-noreset%20-nohalt%60%3C%2FP%3E%3CP%3E%E8%A7%82%E5%AF%9F%E8%80%85%E8%A1%8C%E4%B8%BA%EF%BC%9A%3C%2FP%3E%3CP%3E%E5%BD%93%E8%BF%90%E8%A1%8C%E8%AF%A5%E5%91%BD%E4%BB%A4%E6%97%B6%EF%BC%8CRESET%20%E5%BC%95%E8%84%9A%E8%A2%AB%E6%8B%89%E4%BD%8E%20160ms%E3%80%82%E6%AD%A3%E5%9C%A8%E8%BF%90%E8%A1%8C%E7%9A%84%E7%A8%8B%E5%BA%8F%E5%81%9C%E6%AD%A2%EF%BC%88%E9%80%9A%E8%BF%87%E5%81%9C%E6%AD%A2%E9%97%AA%E7%83%81%E7%9A%84%20LED%20%E8%A7%82%E5%AF%9F%EF%BC%89%E3%80%82%E7%BA%A6%204%20%E7%A7%92%E5%90%8E%EF%BC%8Cgdbserver%20%E8%BF%9E%E6%8E%A5%E6%88%90%E5%8A%9F%EF%BC%88%26gt%3B%20%60%E8%BF%9E%E6%8E%A5%E5%88%B0%E7%9B%AE%E6%A0%87%60%EF%BC%89%E5%B9%B6%E4%B8%94%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%86%8D%E6%AC%A1%E5%90%AF%E5%8A%A8%EF%BC%88LED%20%E9%97%AA%E7%83%81%EF%BC%89%E3%80%82%E7%84%B6%E8%80%8C%EF%BC%8C%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E8%A2%AB%E9%87%8D%E7%BD%AE%E4%BA%86%EF%BC%8C%E8%BF%99%E5%B9%B6%E4%B8%8D%E5%A6%82%E4%BA%BA%E4%BB%AC%E6%89%80%E6%9C%9F%E6%9C%9B%E7%9A%84%E3%80%82%3C%2FP%3E%3CP%3E%E7%9F%A5%E9%81%93%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BC%9A%E8%BF%99%E6%A0%B7%E5%90%97%E6%88%96%E8%80%85%E6%88%91%E8%AF%A5%E6%80%8E%E4%B9%88%E5%81%9A%E6%89%8D%E8%83%BD%E6%89%BE%E5%88%B0%E5%8E%9F%E5%9B%A0%EF%BC%9F%E9%87%8D%E7%BD%AE%E5%8E%9F%E5%9B%A0%E4%BC%BC%E4%B9%8E%E6%98%AF%20SW%20%E9%87%8D%E7%BD%AE%E3%80%82%3C%2FP%3E%3CP%3E%E4%BD%BF%E7%94%A8%E7%9A%84%20MCU%20%E6%98%AF%E5%AE%9A%E5%88%B6%E6%9D%BF%E4%B8%8A%E7%9A%84%20S32K144W%E3%80%82%E8%B0%83%E8%AF%95%E7%AD%89%E5%B7%A5%E4%BD%9C%E6%B2%A1%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%88%91%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98%E6%98%AF%E6%88%91%E6%97%A0%E6%B3%95%E9%99%84%E5%8A%A0%E5%88%B0%E6%AD%A3%E5%9C%A8%E8%BF%90%E8%A1%8C%E7%9A%84%E7%9B%AE%E6%A0%87%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1889232%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AS32K1%E6%97%A0%E9%9C%80%E9%87%8D%E7%BD%AE%E5%8D%B3%E5%8F%AF%E8%BF%9E%E6%8E%A5gdbserver%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1889232%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%E5%90%AF%E5%8A%A8%20gdb%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%E4%BD%BF%E7%94%A8%E8%84%9A%E6%9C%AC%E8%A7%A3%E5%86%B3%E4%BA%86%E8%AF%A5%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%60JLinkGDBServerCLExe-%E8%AE%BE%E5%A4%87S32K144W-endian%20little-if%20SWD-speed%20auto-noir-noLocalhostOnly-nologtofile-TelnetPort%2019020-%E9%80%89%E6%8B%A9IP%3D192.168.xy-JLinkScriptFile%20NXP_Kinetis_S32_Attach.JLinkScript-nohalt%60%3C%2FP%3E%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%EF%BC%8C%E7%A5%9D%E6%82%A8%E6%9C%89%E6%84%89%E5%BF%AB%E7%9A%84%E4%B8%80%E5%A4%A9%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1889185%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AS32K1%E6%97%A0%E9%9C%80%E9%87%8D%E7%BD%AE%E5%8D%B3%E5%8F%AF%E8%BF%9E%E6%8E%A5gdbserver%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1889185%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F234079%22%20target%3D%22_blank%22%3E%40peacefulcarrot%3C%2FA%3E%20%EF%BC%8C%3C%2FP%3E%0A%3CP%3EMCU%E5%BF%85%E9%A1%BB%E5%A4%84%E4%BA%8E%E8%A7%A3%E9%94%81%E7%8A%B6%E6%80%81%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%E9%9C%80%E8%A6%81%E4%B8%80%E4%B8%AA%E7%89%B9%E6%AE%8A%E7%9A%84%20JLink%20%E8%84%9A%E6%9C%AC%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E8%BF%99%E9%87%8C%E6%89%BE%E5%88%B0%EF%BC%9A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwiki.segger.com%2FS32Kxxx%23Attach_to_debug_session%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwiki.segger.com%2FS32Kxxx%23Attach_to_debug_session%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EJLink%20%E6%8C%87%E6%8C%A5%E5%AE%98%E5%BF%85%E9%A1%BB%E6%8C%89%E7%85%A7%E4%BB%A5%E4%B8%8B%E6%96%B9%E5%BC%8F%E8%B0%83%E7%94%A8%EF%BC%9A%3C%2FP%3E%0A%3CP%3EC%3A%5CProgramme%5CSEGGER%5CJLink%5CJLink.exe%20-JLinkScriptFile%20NXP_Kinetis_S32_Attach.JLinkScript%3C%2FP%3E%0A%3CP%3E%E7%84%B6%E5%90%8E%EF%BC%8CMCU%20%E4%B8%8D%E4%BC%9A%E8%A2%AB%E9%87%8D%E7%BD%AE%EF%BC%8C%E5%B9%B6%E4%B8%94%E5%8F%AF%E4%BB%A5%E8%AE%BF%E9%97%AE%E6%89%80%E6%9C%89%E5%86%85%E5%AD%98%E5%92%8C%E5%AF%84%E5%AD%98%E5%99%A8%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E5%A6%82%E6%9C%89%E4%BB%BB%E4%BD%95%E7%96%91%E9%97%AE%EF%BC%8C%E8%AF%B7%E8%81%94%E7%B3%BB%20SEGGER%20%E6%94%AF%E6%8C%81%EF%BC%8C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E