#1377·FreeRTOS

[功能请求] <是否能原生支持 CmBacktrace?减少重复修改代码的麻烦>

作者: piogrammer创建于 2025年11月16日更新于 2025年11月17日
标签enhancement

Dear FreeRTOS Team, First of all, I would like to express my sincere gratitude for your selfless contributions. FreeRTOS has made multi-tasking development on MCUs incredibly convenient, and I’ve been using it extensively—it’s always performed stably and reliably. Recently, I encountered occasional HardFault issues while working on a complex project. To quickly identify the root cause, I integrated the CmBacktrace debugging component. However, I ran into a small problem: for CmBacktrace to trace faults in a FreeRTOS environment, it needs access to task-specific information like stack address, stack size, and task name. This requires manual modifications to FreeRTOS’s task.c and freertos.h (e.g., adding a stack size member to the TCB, implementing simple APIs to retrieve task info). The hassle is that every time I regenerate code with CubeMX, these manual changes get overwritten, forcing me to reapply them repeatedly. It’s become quite tedious over time—my wrist is practically begging for mercy (haha). So I’m writing to propose: Could you consider adding these basic variables (e.g., task stack size) and simple interfaces directly into the FreeRTOS source code? This would enable native support for debugging tools like CmBacktrace, lowering the debugging barrier for developers and enhancing FreeRTOS’s ecosystem compatibility. Thank you again for all your hard work. Looking forward to your thoughts!

内容来源: FreeRTOS/FreeRTOS