PSDK3.9.0 FreeRTOS openocd调试问题
已完成PSDK 3.9.0 stm32 arm-none-eabi-gcc
window下VScode使用cortex-debug插件调试
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceFolder}",
"executable": "D:/STM32test/Payload-SDK-master/build/samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc/dji_sdk_demo_rtos.elf",
"request": "launch",
"type": "cortex-debug",
"configFiles": ["D:/STM32test/Payload-SDK-master/openocd.cfg"],
"runToEntryPoint": "main",
"servertype": "openocd",
"rtos": "FreeRTOS",
"showDevDebugOutput": "raw"
}
]
}
发现始终无法正常调试,main函数好像可以打断点,但在其他任务中打断点无反应,debug暂停时,终端报错uxTopUsedPriority未定义
把FreeRTOS-openocd.c文件放进PSDK一起编译后可才正常调试
FreeRTOS-openocd.c
/*
* Since at least FreeRTOS V7.5.3 uxTopUsedPriority is no longer
* present in the kernel, so it has to be supplied by other means for
* OpenOCD's threads awareness.
*
* Add this file to your project, and, if you're using --gc-sections,
* ``--undefined=uxTopUsedPriority'' (or
* ``-Wl,--undefined=uxTopUsedPriority'' when using gcc for final
* linking) to your LDFLAGS; same with all the other symbols you need.
*/
#include "FreeRTOS.h"
#ifdef __GNUC__
#define USED __attribute__((used))
#else
#define USED
#endif
const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1;
看了下PSDK的RTOS版本:FreeRTOS Kernel V10.3.1,好像FreeRTOS Kernel V10.3.1发布的时候还没有解决这个问题
https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/33
请先登录再写评论。
评论
1 条评论