Bootloader and debugging issues on the s32k311 chip

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

Bootloader and debugging issues on the s32k311 chip

跳至解决方案
901 次查看
feixingren1
Contributor I

s32ds:3.5.6
rtd:7.0.0

I encountered an issue while conducting a bootloader experiment using the s32k311 chip. I configured a regular CAN and attempted to verify that the program jumps from the BL program to the app. However, after adding the jump function, the CAN send function of the BL program stopped working. Unless I connect to J-Link for debugging, and once debugging starts, I always receive output from the debug print
Program received signal SIGTRAP, Trace/breakpoint trap.
0x20008008 in ?? ()
I would appreciate any possible assistance in solving this problem. Thank you

0 项奖励
回复
1 解答
880 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @feixingren1 

 

I can see there’s no problem with the jump itself. But what I can see in main.c in the bootloader – you are jumping to the application without any de-initialization. This is usually the main source of troubles. I recommend:

  1. Jump to the application directly after reset. You can write some minimalist code to the startup files which will jump to the application based on some condition. Whenever the bootloader needs to jump to the application, it should just trigger software reset and then it will jump to the application right after reset before all the initialization. This is the most safe option.
  2. If you want to jump to the application later in the bootloader (once a lot of resources is initialized), it’s important to perform the de-initialization. Disable all interrupts (globally by the core, locally  by peripherals’ registers…), de-initialize peripherals etc. The application either expects default reset conditions or it must be fully aware of features which are not in default reset state.

 

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
2 回复数
881 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @feixingren1 

 

I can see there’s no problem with the jump itself. But what I can see in main.c in the bootloader – you are jumping to the application without any de-initialization. This is usually the main source of troubles. I recommend:

  1. Jump to the application directly after reset. You can write some minimalist code to the startup files which will jump to the application based on some condition. Whenever the bootloader needs to jump to the application, it should just trigger software reset and then it will jump to the application right after reset before all the initialization. This is the most safe option.
  2. If you want to jump to the application later in the bootloader (once a lot of resources is initialized), it’s important to perform the de-initialization. Disable all interrupts (globally by the core, locally  by peripherals’ registers…), de-initialize peripherals etc. The application either expects default reset conditions or it must be fully aware of features which are not in default reset state.

 

Regards,

Lukas

0 项奖励
回复
840 次查看
feixingren1
Contributor I
thank you,I have already solved the problem
0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2342064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k311%20%E8%8A%AF%E7%89%87%E7%9A%84%E5%90%AF%E5%8A%A8%E5%8A%A0%E8%BD%BD%E7%A8%8B%E5%BA%8F%E5%92%8C%E8%B0%83%E8%AF%95%E9%97%AE%E9%A2%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Es32ds%EF%BC%9A3.5.6%3CBR%20%2F%3Ertd%EF%BC%9A7.0.0%3C%2FP%3E%3CP%3E%E6%88%91%E5%9C%A8%E4%BD%BF%E7%94%A8%20s32k311%20%E8%8A%AF%E7%89%87%E8%BF%9B%E8%A1%8C%E5%BC%95%E5%AF%BC%E7%A8%8B%E5%BA%8F%E5%AE%9E%E9%AA%8C%E6%97%B6%E9%81%87%E5%88%B0%E4%BA%86%E4%B8%80%E4%B8%AA%E9%97%AE%E9%A2%98%E3%80%82%E6%88%91%E9%85%8D%E7%BD%AE%E4%BA%86%E4%B8%80%E4%B8%AA%E6%99%AE%E9%80%9A%20CAN%EF%BC%8C%E5%B9%B6%E5%B0%9D%E8%AF%95%E9%AA%8C%E8%AF%81%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E4%BB%8E%20BL%20%E7%A8%8B%E5%BA%8F%E8%B7%B3%E8%BD%AC%E5%88%B0%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E3%80%82%E7%84%B6%E8%80%8C%EF%BC%8C%E5%9C%A8%E6%B7%BB%E5%8A%A0%E8%B7%B3%E8%BD%AC%E5%8A%9F%E8%83%BD%E5%90%8E%EF%BC%8CBL%20%E7%A8%8B%E5%BA%8F%E7%9A%84%20CAN%20%E5%8F%91%E9%80%81%E5%8A%9F%E8%83%BD%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C%E3%80%82%E9%99%A4%E9%9D%9E%E6%88%91%E8%BF%9E%E6%8E%A5%E5%88%B0%20J-Link%20%E8%BF%9B%E8%A1%8C%E8%B0%83%E8%AF%95%EF%BC%8C%E5%90%A6%E5%88%99%E4%B8%80%E6%97%A6%E5%BC%80%E5%A7%8B%E8%B0%83%E8%AF%95%EF%BC%8C%E6%88%91%E6%80%BB%E6%98%AF%E4%BC%9A%E6%94%B6%E5%88%B0%E6%9D%A5%E8%87%AA%E8%B0%83%E8%AF%95%E6%89%93%E5%8D%B0%3CBR%20%2F%3E%E7%A8%8B%E5%BA%8F%E6%94%B6%E5%88%B0%E4%BF%A1%E5%8F%B7%20SIGTRAP%EF%BC%8C%E8%B7%9F%E8%B8%AA%2F%E6%96%AD%E7%82%B9%E9%99%B7%E9%98%B1%E7%9A%84%E8%BE%93%E5%87%BA%E3%80%82%3CBR%20%2F%3E0x20008008%20in%20%3F%3F%20()%3CBR%20%2F%3E%E5%A6%82%E8%83%BD%E5%B8%AE%E5%8A%A9%E6%88%91%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%EF%BC%8C%E6%88%91%E5%B0%86%E4%B8%8D%E8%83%9C%E6%84%9F%E6%BF%80%E3%80%82%E8%B0%A2%E8%B0%A2%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2342639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Bootloader%20and%20debugging%20issues%20on%20the%20s32k311%20chip%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E8%B0%A2%E8%B0%A2%EF%BC%8C%E6%88%91%E5%B7%B2%E7%BB%8F%E8%A7%A3%E5%86%B3%E4%BA%86%E9%97%AE%E9%A2%98%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2342173%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Bootloader%20and%20debugging%20issues%20on%20the%20s32k311%20chip%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342173%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%2F260925%22%20target%3D%22_blank%22%3E%40feixingren1%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E7%9C%8B%E5%BE%97%E5%87%BA%E6%9D%A5%EF%BC%8C%E8%B7%B3%E8%B7%83%E6%9C%AC%E8%BA%AB%E6%B2%A1%E6%9C%89%E9%97%AE%E9%A2%98%E3%80%82%E4%BD%86%E6%88%91%E5%9C%A8%E5%BC%95%E5%AF%BC%E5%8A%A0%E8%BD%BD%E7%A8%8B%E5%BA%8F%E7%9A%84%20main.c%20%E4%B8%AD%E7%9C%8B%E5%88%B0%E7%9A%84%E6%98%AF%EF%BC%8C%E6%82%A8%E5%9C%A8%E6%B2%A1%E6%9C%89%E4%BB%BB%E4%BD%95%E5%8E%BB%E5%88%9D%E5%A7%8B%E5%8C%96%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E8%B7%B3%E8%BD%AC%E5%88%B0%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E3%80%82%E8%BF%99%E9%80%9A%E5%B8%B8%E6%98%AF%E9%97%AE%E9%A2%98%E7%9A%84%E4%B8%BB%E8%A6%81%E6%A0%B9%E6%BA%90%E3%80%82%E6%88%91%E6%8E%A8%E8%8D%90%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%E9%87%8D%E7%BD%AE%E5%90%8E%E7%9B%B4%E6%8E%A5%E8%B7%B3%E8%BD%AC%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