Bootloader and debugging issues on the s32k311 chip

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bootloader and debugging issues on the s32k311 chip

ソリューションへジャンプ
613件の閲覧回数
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 解決策
592件の閲覧回数
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 返答(返信)
593件の閲覧回数
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 件の賞賛
返信
552件の閲覧回数
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%E3%83%81%E3%83%83%E3%83%97%E3%81%AE%E3%83%96%E3%83%BC%E3%83%88%E3%83%AD%E3%83%BC%E3%83%80%E3%83%BC%E3%81%A8%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E5%95%8F%E9%A1%8C%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%3E%20rtd%EF%BC%9A7.0.0%3C%2FP%3E%3CP%3Es32k311%E3%83%81%E3%83%83%E3%83%97%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%83%96%E3%83%BC%E3%83%88%E3%83%AD%E3%83%BC%E3%83%80%E3%83%BC%E3%81%AE%E5%AE%9F%E9%A8%93%E3%82%92%E8%A1%8C%E3%81%A3%E3%81%A6%E3%81%84%E3%81%9F%E9%9A%9B%E3%81%AB%E5%95%8F%E9%A1%8C%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E9%80%9A%E5%B8%B8%E3%81%AECAN%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%97%E3%80%81%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%8CBL%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%8B%E3%82%89%E3%82%A2%E3%83%97%E3%83%AA%E3%81%AB%E5%88%87%E3%82%8A%E6%9B%BF%E3%82%8F%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E3%81%97%E3%81%8B%E3%81%97%E3%80%81%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E6%A9%9F%E8%83%BD%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%97%E3%81%9F%E5%BE%8C%E3%80%81BL%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AECAN%E9%80%81%E4%BF%A1%E6%A9%9F%E8%83%BD%E3%81%8C%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%AA%E3%81%8F%E3%81%AA%E3%81%A3%E3%81%9F%E3%80%82%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%AE%E3%81%9F%E3%82%81%E3%81%ABJ-Link%E3%81%AB%E6%8E%A5%E7%B6%9A%E3%81%97%E3%81%AA%E3%81%84%E9%99%90%E3%82%8A%E3%80%81%E3%81%9D%E3%81%97%E3%81%A6%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%8C%E9%96%8B%E5%A7%8B%E3%81%95%E3%82%8C%E3%82%8B%E3%81%A8%E3%80%81%E5%B8%B8%E3%81%AB%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E5%87%BA%E5%8A%9B%E3%81%8B%E3%82%89%E3%81%AE%E5%87%BA%E5%8A%9B%E3%82%92%E5%8F%97%E3%81%91%E5%8F%96%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%8C%E3%82%B7%E3%82%B0%E3%83%8A%E3%83%ABSIGTRAP%EF%BC%88%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B9%2F%E3%83%96%E3%83%AC%E3%83%BC%E3%82%AF%E3%83%9D%E3%82%A4%E3%83%B3%E3%83%88%E3%83%88%E3%83%A9%E3%83%83%E3%83%97%EF%BC%89%E3%82%92%E5%8F%97%E4%BF%A1%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3CBR%20%2F%3E0x20008008%20in%20%3F%3F%20()%3CBR%20%2F%3E%E3%81%93%E3%81%AE%E5%95%8F%E9%A1%8C%E3%81%AE%E8%A7%A3%E6%B1%BA%E3%81%AB%E3%81%94%E5%8D%94%E5%8A%9B%E3%81%84%E3%81%9F%E3%81%A0%E3%81%91%E3%82%8C%E3%81%B0%E5%B9%B8%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%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%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E5%95%8F%E9%A1%8C%E3%81%AF%E6%97%A2%E3%81%AB%E8%A7%A3%E6%B1%BA%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%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%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F260925%22%20target%3D%22_blank%22%3E%40feixingren1%E3%81%95%E3%82%93%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E8%87%AA%E4%BD%93%E3%81%AB%E3%81%AF%E5%95%8F%E9%A1%8C%E3%81%8C%E3%81%AA%E3%81%84%E3%82%88%E3%81%86%E3%81%A7%E3%81%99%E3%80%82%E3%81%97%E3%81%8B%E3%81%97%E3%80%81%E3%83%96%E3%83%BC%E3%83%88%E3%83%AD%E3%83%BC%E3%83%80%E3%83%BC%E3%81%AEmain.c%E3%82%92%E8%A6%8B%E3%82%8B%E3%81%A8%E3%80%81%E5%88%9D%E6%9C%9F%E5%8C%96%E8%A7%A3%E9%99%A4%E3%82%92%E8%A1%8C%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%82%88%E3%81%86%E3%81%A7%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E9%80%9A%E5%B8%B8%E3%80%81%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%81%AE%E4%B8%BB%E3%81%AA%E5%8E%9F%E5%9B%A0%E3%81%A8%E3%81%AA%E3%82%8B%E3%80%82%E3%81%8A%E5%8B%A7%E3%82%81%E3%81%97%E3%81%BE%E3%81%99%EF%BC%9A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E5%BE%8C%E3%80%81%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AB%E7%9B%B4%E6%8E%A5%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E8%B5%B7%E5%8B%95%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E3%80%81%E7%89%B9%E5%AE%9A%E3%81%AE%E6%9D%A1%E4%BB%B6%E3%81%AB%E5%9F%BA%E3%81%A5%E3%81%84%E3%81%A6%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%E6%9C%80%E5%B0%8F%E9%99%90%E3%81%AE%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E8%A8%98%E8%BF%B0%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%E3%83%96%E3%83%BC%E3%83%88%E3%83%AD%E3%83%BC%E3%83%80%E3%83%BC%E3%81%8C%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E3%82%92%E3%83%88%E3%83%AA%E3%82%AC%E3%83%BC%E3%81%99%E3%82%8B%E3%81%A0%E3%81%91%E3%81%A7%E3%82%88%E3%81%8F%E3%80%81%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E5%BE%8C%E3%80%81%E5%88%9D%E6%9C%9F%E5%8C%96%E5%87%A6%E7%90%86%E3%81%AE%E5%89%8D%E3%81%AB%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%8C%E6%9C%80%E3%82%82%E5%AE%89%E5%85%A8%E3%81%AA%E9%81%B8%E6%8A%9E%E8%82%A2%E3%81%A7%E3%81%99%E3%80%82%3C%2FLI%3E%0A%3CLI%3E%E3%83%96%E3%83%BC%E3%83%88%E3%83%AD%E3%83%BC%E3%83%80%E3%83%BC%E3%81%AE%E5%BE%8C%E5%8D%8A%EF%BC%88%E5%A4%9A%E3%81%8F%E3%81%AE%E3%83%AA%E3%82%BD%E3%83%BC%E3%82%B9%E3%81%8C%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E5%BE%8C%EF%BC%89%E3%81%A7%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%97%E3%81%9F%E3%81%84%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E5%88%9D%E6%9C%9F%E5%8C%96%E8%A7%A3%E9%99%A4%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E9%87%8D%E8%A6%81%E3%81%A7%E3%81%99%E3%80%82%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%82%92%E7%84%A1%E5%8A%B9%E3%81%AB%E3%81%99%E3%82%8B%EF%BC%88%E3%82%B3%E3%82%A2%E3%81%AB%E3%82%88%E3%82%8B%E3%82%B0%E3%83%AD%E3%83%BC%E3%83%90%E3%83%AB%E3%81%AA%E7%84%A1%E5%8A%B9%E5%8C%96%E3%80%81%E3%83%9A%E3%83%AA%E3%83%95%E3%82%A7%E3%83%A9%E3%83%AB%E3%81%AE%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%81%AB%E3%82%88%E3%82%8B%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%81%AA%E7%84%A1%E5%8A%B9%E5%8C%96%E3%81%AA%E3%81%A9%EF%BC%89%E3%80%81%E3%83%9A%E3%83%AA%E3%83%95%E3%82%A7%E3%83%A9%E3%83%AB%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%E8%A7%A3%E9%99%A4%E3%81%AA%E3%81%A9%E3%80%82%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AF%E3%80%81%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E7%8A%B6%E6%85%8B%E3%82%92%E6%83%B3%E5%AE%9A%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%81%8B%E3%80%81%E3%81%BE%E3%81%9F%E3%81%AF%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E7%8A%B6%E6%85%8B%E3%81%AB%E3%81%AA%E3%81%84%E6%A9%9F%E8%83%BD%E3%82%92%E5%AE%8C%E5%85%A8%E3%81%AB%E8%AA%8D%E8%AD%98%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E3%82%88%E3%82%8D%E3%81%97%E3%81%8F%E3%81%8A%E9%A1%98%E3%81%84%E3%81%84%E3%81%9F%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3E%E3%83%AB%E3%83%BC%E3%82%AB%E3%82%B9%3C%2FP%3E%3C%2FLINGO-BODY%3E