pull/15/merge
LinTeX9527 8 years ago committed by GitHub
commit 7e6a2d3252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,7 +110,7 @@ static const char * const print_info[] = {
[PRINT_MAIN_STACK_INFO] = "====== Main stack information ======",
[PRINT_THREAD_STACK_OVERFLOW] = "Error: Thread stack(%08x) was overflow",
[PRINT_MAIN_STACK_OVERFLOW] = "Error: Main stack(%08x) was overflow",
[PRINT_CALL_STACK_INFO] = "Show more call stack info by run: addr2line -e %s%s -a -f %.*s",
[PRINT_CALL_STACK_INFO] = "Show more call stack info by run: addr2line -e %s%s -a -f ",
[PRINT_CALL_STACK_ERR] = "Dump call stack has an error",
[PRINT_FAULT_ON_THREAD] = "Fault on thread %s",
[PRINT_FAULT_ON_HANDLER] = "Fault on interrupt or bare metal(no OS) environment",
@ -140,7 +140,7 @@ static const char * const print_info[] = {
[PRINT_DFSR_EXTERNAL] = "Debug fault is caused by EDBGRQ signal asserted",
[PRINT_MMAR] = "The memory management fault occurred address is %08x",
[PRINT_BFAR] = "The bus fault occurred address is %08x",
#elif (CMB_PRINT_LANGUAGE == CMB_PRINT_LANUUAGE_CHINESE)
#elif (CMB_PRINT_LANGUAGE == CMB_PRINT_LANGUAGE_CHINESE)
[PRINT_FIRMWARE_INFO] = "固件名称:%s硬件版本号%s软件版本号%s",
[PRINT_ASSERT_ON_THREAD] = "在线程(%s)中发生断言",
[PRINT_ASSERT_ON_HANDLER] = "在中断或裸机环境下发生断言",
@ -148,7 +148,7 @@ static const char * const print_info[] = {
[PRINT_MAIN_STACK_INFO] = "============ 主堆栈信息 ============",
[PRINT_THREAD_STACK_OVERFLOW] = "错误:线程栈(%08x)发生溢出",
[PRINT_MAIN_STACK_OVERFLOW] = "错误:主栈(%08x)发生溢出",
[PRINT_CALL_STACK_INFO] = "查看更多函数调用栈信息请运行addr2line -e %s%s -a -f %.*s",
[PRINT_CALL_STACK_INFO] = "查看更多函数调用栈信息请运行addr2line -e %s%s -a -f ",
[PRINT_CALL_STACK_ERR] = "获取函数调用栈失败",
[PRINT_FAULT_ON_THREAD] = "在线程(%s)中发生错误异常",
[PRINT_FAULT_ON_HANDLER] = "在中断或裸机环境下发生错误异常",
@ -408,8 +408,9 @@ static void print_call_stack(uint32_t sp) {
}
if (cur_depth) {
cmb_println(print_info[PRINT_CALL_STACK_INFO], fw_name, CMB_ELF_FILE_EXTENSION_NAME, cur_depth * (8 + 1),
call_stack_info);
// Keil5 may not parse %.*s properly, `call_stack_info` has to be parsed on a new print call.
cmb_print(print_info[PRINT_CALL_STACK_INFO], fw_name, CMB_ELF_FILE_EXTENSION_NAME, cur_depth * (8 + 1));
cmb_println("%s", call_stack_info);
} else {
cmb_println(print_info[PRINT_CALL_STACK_ERR]);
}

@ -30,6 +30,7 @@
#define _CMB_CFG_H_
/* print line, must config by user */
#define cmb_print(...) /* e.g., printf(__VA_ARGS__); */
#define cmb_println(...) /* e.g., printf(__VA_ARGS__);printf("\r\n") */
/* enable bare metal(no OS) platform */
/* #define CMB_USING_BARE_METAL_PLATFORM */
@ -42,5 +43,5 @@
/* enable dump stack information */
/* #define CMB_USING_DUMP_STACK_INFO */
/* language of print information */
/* #define CMB_PRINT_LANGUAGE CMB_PRINT_LANGUAGE_ENGLISH(default) or CMB_PRINT_LANUUAGE_CHINESE */
/* #define CMB_PRINT_LANGUAGE CMB_PRINT_LANGUAGE_ENGLISH(default) or CMB_PRINT_LANGUAGE_CHINESE */
#endif /* _CMB_CFG_H_ */

@ -47,7 +47,7 @@
#define CMB_OS_PLATFORM_FREERTOS 3
#define CMB_PRINT_LANGUAGE_ENGLISH 0
#define CMB_PRINT_LANUUAGE_CHINESE 1
#define CMB_PRINT_LANGUAGE_CHINESE 1
/* name max length, default size: 32 */
#ifndef CMB_NAME_MAX

@ -1,3 +1,5 @@
/Output
*.uvgui.*
*.uvopt
*.dep

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save