Unable to debug S32k311 mcu using Segger j-link V9 debugger

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

Unable to debug S32k311 mcu using Segger j-link V9 debugger

跳至解决方案
2,538 次查看
ce_ritesh
Contributor II
I have been working with an eval board by Elekronika India for 18s BMS solution based on S32k311 MCU. The Segger j-link V9-G JTAG debugger is being used for flashing and debugging.
But when we debug the sample code, after flashing, the PC goes to random RAM locations and not to the main function. Enclosed image for your reference. There are no breakpoints except main. But PC does not halt at the main and goes to random RAM locations and halts there. I tried with another example code for S32k311 and it gave the same output. 
 
Kindly suggest a solution.
 
image001.png
标记 (4)
0 项奖励
回复
1 解答
2,159 次查看
ce_ritesh
Contributor II

Issue was with the Segger connector to JTAG adapter board. It wasn't able to reset the controller before debug session. It is resolved now.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,160 次查看
ce_ritesh
Contributor II

Issue was with the Segger connector to JTAG adapter board. It wasn't able to reset the controller before debug session. It is resolved now.

0 项奖励
回复
2,522 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

But when we debug the sample code, after flashing, the PC goes to random RAM locations and not to the main function

Ok, seems to me weird. The core will execute the instruction loaded in it. Not some random ones.

There must be executed in your SW some branch (jump) to that RAM location. And the RAM location must be defined in your core registers, to perform branch.

If you do step by step debug, you will see exactly where the branch to RAM is happening, and also its preconditions.

 

But PC does not halt at the main and goes to random RAM locations and halts there. I tried with another example code for S32k311 and it gave the same output.

Yes, if the main is not reached, it wont halt at main breakpoint.

Since the another example gives you the same result, it could be some jumper settings on the board if you use our EVB.

We supply the EVBs with getting started guide, where all necessary HW settings are described.

But debugging of startup will simply tell you where the issue lie.

Best regards,

Peter

0 项奖励
回复
2,530 次查看
ce_ritesh
Contributor II

Please find gdb server log for your reference

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2105838%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20Segger%20j-link%20V9%20%E8%B0%83%E8%AF%95%E5%99%A8%E8%B0%83%E8%AF%95%20S32k311%20%E5%BE%AE%E6%8E%A7%E5%88%B6%E5%99%A8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2105838%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%E6%88%91%E4%B8%80%E7%9B%B4%E5%9C%A8%E4%BD%BF%E7%94%A8%20Elekronika%20India%20%E7%9A%84%E8%AF%84%E4%BC%B0%E6%9D%BF%E5%BC%80%E5%8F%91%E5%9F%BA%E4%BA%8E%20s32k311%20MCU%20%E7%9A%84%2018s%20%E7%94%B5%E6%B1%A0%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%20%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E3%80%82Segger%20j-link%20V9-G%20JTAG%20%E8%B0%83%E8%AF%95%E5%99%A8%E7%94%A8%E4%BA%8E%E9%97%AA%E5%AD%98%E5%92%8C%E8%B0%83%E8%AF%95%E3%80%82%3C%2FDIV%3E%3CDIV%3E%E4%BD%86%E5%BD%93%E6%88%91%E4%BB%AC%E8%B0%83%E8%AF%95%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%E6%97%B6%EF%BC%8C%E9%97%AA%E5%AD%98%E9%97%AA%E7%83%81%E5%90%8E%EF%BC%8CPC%20%E8%BF%9B%E5%85%A5%E9%9A%8F%E6%9C%BA%20RAM%20%E4%BD%8D%E7%BD%AE%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E4%B8%BB%E5%87%BD%E6%95%B0%E3%80%82%E9%99%84%E4%B8%8A%E5%9B%BE%E7%89%87%E4%BE%9B%E6%82%A8%E5%8F%82%E8%80%83%E3%80%82%E9%99%A4%E4%B8%BB%E6%96%AD%E7%82%B9%E5%A4%96%EF%BC%8C%E6%B2%A1%E6%9C%89%E5%85%B6%E4%BB%96%E6%96%AD%E7%82%B9%E3%80%82%E4%BD%86%E7%94%B5%E8%84%91%E6%B2%A1%E6%9C%89%E5%81%9C%E5%9C%A8%E4%B8%BB%E5%86%85%E5%AD%98%EF%BC%8C%E8%80%8C%E6%98%AF%E8%BD%AC%E5%88%B0%E9%9A%8F%E6%9C%BA%E5%86%85%E5%AD%98%E4%BD%8D%E7%BD%AE%E5%B9%B6%E5%81%9C%E5%9C%A8%E9%82%A3%E9%87%8C%E3%80%82%E6%88%91%E7%94%A8%20S32k311%20%E7%9A%84%E5%8F%A6%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%E8%BF%9B%E8%A1%8C%E4%BA%86%E5%B0%9D%E8%AF%95%EF%BC%8C%E5%BE%97%E5%88%B0%E4%BA%86%E7%9B%B8%E5%90%8C%E7%9A%84%E8%BE%93%E5%87%BA%E7%BB%93%E6%9E%9C%E3%80%82%20%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%E8%AF%B7%E6%8F%90%E5%87%BA%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E3%80%82%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image001.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image001.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340094i79305759E11053BE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image001.png%22%20alt%3D%22image001.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2160945%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Unable%20to%20debug%20S32k311%20mcu%20using%20Segger%20j-link%20V9%20debugger%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2160945%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E9%97%AE%E9%A2%98%E5%87%BA%E5%9C%A8%20JTAG%20%E9%80%82%E9%85%8D%E5%99%A8%E6%9D%BF%E4%B8%8A%E7%9A%84%20Segger%20%E8%BF%9E%E6%8E%A5%E5%99%A8%E4%B8%8A%E3%80%82%E5%AE%83%E6%97%A0%E6%B3%95%E5%9C%A8%E8%B0%83%E8%AF%95%E4%BC%9A%E8%AF%9D%E4%B9%8B%E5%89%8D%20RESET%20%E6%8E%A7%E5%88%B6%E5%99%A8%E3%80%82%E7%8E%B0%E5%9C%A8%E5%B7%B2%E7%BB%8F%E8%A7%A3%E5%86%B3%E4%BA%86%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2105897%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Unable%20to%20debug%20S32k311%20mcu%20using%20Segger%20j-link%20V9%20debugger%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2105897%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E5%BD%93%E6%88%91%E4%BB%AC%E8%B0%83%E8%AF%95%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%E6%97%B6%EF%BC%8C%E9%97%AA%E5%AD%98%E9%97%AA%E7%83%81%E5%90%8E%EF%BC%8CPC%20%E4%BC%9A%E8%BF%9B%E5%85%A5%E9%9A%8F%E6%9C%BA%20RAM%20%E4%B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4%BD%BF%E7%94%A8%E6%88%91%E4%BB%AC%E7%9A%84%20EVB%EF%BC%8C%E5%8F%AF%E8%83%BD%E6%98%AF%E7%94%B5%E8%B7%AF%E6%9D%BF%E4%B8%8A%E7%9A%84%E4%B8%80%E4%BA%9B%E8%B7%B3%E7%BA%BF%E8%AE%BE%E7%BD%AE%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%88%91%E4%BB%AC%E4%B8%BA%20EVB%20%E6%8F%90%E4%BE%9B%E4%BA%86%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97%EF%BC%8C%E5%85%B6%E4%B8%AD%E4%BB%8B%E7%BB%8D%E4%BA%86%E6%89%80%E6%9C%89%E5%BF%85%E8%A6%81%E7%9A%84%E7%A1%AC%E4%BB%B6%E8%AE%BE%E7%BD%AE%E3%80%82%3C%2FP%3E%0A%3CP%3E%E4%BD%86%E5%90%AF%E5%8A%A8%E8%B0%83%E8%AF%95%E5%8F%AA%E4%BC%9A%E5%91%8A%E8%AF%89%E4%BD%A0%E9%97%AE%E9%A2%98%E5%87%BA%E5%9C%A8%E5%93%AA%E9%87%8C%E3%80%82%3C%2FP%3E%0A%3CP%3E%E9%A1%BA%E7%A5%9D%E5%95%86%E7%A5%BA%EF%BC%81%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2105868%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Unable%20to%20debug%20S32k311%20mcu%20using%20Segger%20j-link%20V9%20debugger%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2105868%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%AF%B7%E6%9F%A5%E6%89%BE%20gdb%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%A5%E5%BF%97%E4%BB%A5%E4%BE%9B%E5%8F%82%E8%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E