Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage fault下没输出关键的call_stack信息 #36

Open
ueJone opened this issue Jul 10, 2020 · 2 comments
Open

Usage fault下没输出关键的call_stack信息 #36

ueJone opened this issue Jul 10, 2020 · 2 comments

Comments

@ueJone
Copy link

ueJone commented Jul 10, 2020

和bt库似乎没关系,后来增加调试信息发现print_call_stack()执行一半mcu就停止运行了,最重要的调用关系没来得及打印,不知道为什么会没执行到最后

[5103078] E/cmb: 
[5103078] E/cmb: Firmware name: rtthread, hardware version: 1.0, software version: 1.0
[5103078] E/cmb: Fault on interrupt or bare metal(no OS) environment
[5103078] E/cmb: ===== Thread stack information =====
[5103078] E/cmb:   addr: 24000a18    data: 9000040b
[5103078] E/cmb:   addr: 24000a1c    data: fffffff1
[5103078] E/cmb:   addr: 24000a20    data: fffffff1
[5103078] E/cmb:   addr: 24000a24    data: fffffff1
[5103078] E/cmb:   addr: 24000a28    data: 00000000
[5103078] E/cmb:   addr: 24000a2c    data: 24000310
[5103078] E/cmb:   addr: 24000a30    data: 24000310
[5103078] E/cmb:   addr: 24000a34    data: 00000000
[5103078] E/cmb:   addr: 24000a38    data: 00000000
[5103078] E/cmb:   addr: 24000a3c    data: 7ffffffe
[5103078] E/cmb:   addr: 24000a40    data: 24001084
[5103078] E/cmb:   addr: 24000a44    data: deadbeef
[5103078] E/cmb:   addr: 24000a48    data: 00000000
[5103078] E/cmb:   addr: 24000a4c    data: 00000000
[5103078] E/cmb:   addr: 24000a50    data: 2400fda4
[5103078] E/cmb:   addr: 24000a54    data: 684a171c
[5103078] E/cmb:   addr: 24000a58    data: 00000000
[5103078] E/cmb:   addr: 24000a5c    data: 90004847
[5103078] E/cmb:   addr: 24000a60    data: 900239aa
[5103078] E/cmb:   addr: 24000a64    data: 0100000f
[5103078] E/cmb:   addr: 24000a68    data: 00000000
[5103078] E/cmb:   addr: 24000a6c    data: 24000df4
[5103078] E/cmb:   addr: 24000a70    data: 24013004
[5103078] E/cmb:   addr: 24000a74    data: 24012ff0
[5103078] E/cmb:   addr: 24000a78    data: 24000df4
[5103078] E/cmb:   addr: 24000a7c    data: 90004847
[5103078] E/cmb:   addr: 24000a80    data: 00000004
[5103078] E/cmb:   addr: 24000a84    data: 24000c6c
[5103078] E/cmb:   addr: 24000a88    data: deadbeef
[5103078] E/cmb:   addr: 24000a8c    data: deadbeef
[5103078] E/cmb:   addr: 24000a90    data: deadbeef
[5103078] E/cmb:   addr: 24000a94    data: deadbeef
[5103078] E/cmb:   addr: 24000a98    data: deadbeef
[5103078] E/cmb:   addr: 24000a9c    data: 9002184f
[5103078] E/cmb:   addr: 24000aa0    data: 00000000
[5103078] E/cmb:   addr: 24000aa4    data: fffffffd
[5103078] E/cmb:   addr: 24000aa8    data: 24000acc
[5103078] E/cmb:   addr: 24000aac    data: 10000000
[5103078] E/cmb:   addr: 24000ab0    data: 00000000
[5103078] E/cmb:   addr: 24000ab4    data: 00000003
[5103078] E/cmb:   addr: 24000ab8    data: 00000020
[5103078] E/cmb:   addr: 24000abc    data: 9000193f
[5103078] E/cmb:   addr: 24000ac0    data: 900003d6
[5103078] E/cmb:   addr: 24000ac4    data: 21000200
[5103078] E/cmb:   addr: 24000ac8    data: 90021453
[5103078] E/cmb: ====================================
[5103078] E/cmb: =================== Registers information ====================
[5103078] E/cmb:   R0 : 06000000  R1 : 24003080  R2 : 24000a20  R3 : 00000000
[5103078] E/cmb:   R12: 90004ab5  LR : 684a171c  PC : 00000000  PSR: 24000310
[5103078] E/cmb: ==============================================================
[5103078] E/cmb: Usage fault is caused by attempts to execute an undefined instruction
@chenyingchun0312
Copy link

我这边也出现同样的问题, 原因我这边大致找到了,在打印堆栈调用信息的地方,如果使用的是ulog日志模块,那么打印不出来,只需要 print_call_stack 函数中,
cmb_println(print_info[PRINT_CALL_STACK_INFO], fw_name, CMB_ELF_FILE_EXTENSION_NAME, cur_depth * (8 + 1), call_stack_info); 中, cmb_println 替换成 rt_kprintf,堆栈调用信息就可以打印出来了。

@ueJone
Copy link
Author

ueJone commented Aug 5, 2020

我这边也出现同样的问题, 原因我这边大致找到了,在打印堆栈调用信息的地方,如果使用的是ulog日志模块,那么打印不出来,只需要 print_call_stack 函数中,
cmb_println(print_info[PRINT_CALL_STACK_INFO], fw_name, CMB_ELF_FILE_EXTENSION_NAME, cur_depth * (8 + 1), call_stack_info); 中, cmb_println 替换成 rt_kprintf,堆栈调用信息就可以打印出来了。

有道理,系统崩溃的时候ulog线程不一定能跑,谢谢提醒,我验证一下您的方法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants