[Feature Request] <Support CmBacktrace to avoid repeated code modifications能否原生支持 CmBacktrace?减少重复修改代码的麻烦>
Dear FreeRTOS Team, First of all, I'd 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 项目组的大佬好! 首先由衷感谢大家的无私贡献,让我们能在 MCU 上便捷地开发多任务项目。我一直深度使用 FreeRTOS,它的稳定性和易用性都非常出色。 近期我在开发一个复杂项目时,偶尔会遇到 HardFault 问题。为了快速定位故障根源,我引入了 CmBacktrace 调试组件,但遇到了一个小麻烦:CmBacktrace 在 FreeRTOS 环境下追踪故障时,需要获取任务的栈地址、栈大小和任务名等信息,这就要求我手动修改 FreeRTOS 的 task.c 和 freertos.h(比如在 TCB 中新增栈大小成员、添加获取任务信息的接口函数)。 问题在于,我使用 CubeMX 频繁重新生成代码时,这些手动修改会被覆盖,每次都要重新调整 —— 长期下来重复操作繁琐,手腕都快扛不住了(笑)。 所以想向各位大佬提议:能否在 FreeRTOS 源码中直接添加这些基础变量(如任务栈大小)和简单接口,以原生支持 CmBacktrace 这类调试工具的集成?这样既能降低开发者的调试门槛,也能让 FreeRTOS 的生态兼容性更完善。 再次感谢大家的付出,期待各位的回复!
Source: FreeRTOS/FreeRTOS