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

不使用cmb_fault.S汇编文件,改为在HardFault_Handler中调用cm_backtrace_fault的方法 #39

Open
yy505149 opened this issue Sep 29, 2020 · 3 comments

Comments

@yy505149
Copy link

由于本人使用CubeMX配置生成工程,每次在修改配置重新生成后,注释掉的HardFault_Handler就会被重新生成并启用,又要去重新注释,很麻烦,所以在cm_backtrace.c中增加以下函数,并在cm_backtrace.h中增加对应的函数定义,函数参考了.s汇编文件的写法。这样就可以很方便的直接调用,而且不用考虑cm_backtrace_fault入口参数了。

__asm void cm_backtrace_ErrorDiagnosis(void)
{
IMPORT cm_backtrace_fault
MOV r0, lr;
MOV r1, sp;
BL cm_backtrace_fault
}

@armink
Copy link
Owner

armink commented Sep 29, 2020

挺不错的想法,感谢分享,也可以写个文档,提交到 /doc 目录哈

@lanxb
Copy link
Contributor

lanxb commented Nov 18, 2020

那你应该修改 cubemx的配置 不启用生成HardFault_Handler
image

@yy505149
Copy link
Author

那你应该修改 cubemx的配置 不启用生成HardFault_Handler
image

谢谢分享,CubeMX确实还有很多不知道怎么使用。

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

3 participants