Skip to content

Commit 5b3fb4b

Browse files
OpenOCD Debugging Support for FreeRTOS Usage Instructions (#50)
* OpenOCD Debugging Support for FreeRTOS Usage Instructions * Modify 26-debugging_support_for_freertos_by_openocd.md * Format optimization * Format optimization --------- Co-authored-by: [email protected] <[email protected]>
1 parent d91ccb7 commit 5b3fb4b

File tree

7 files changed

+66
-0
lines changed

7 files changed

+66
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# OpenOCD对FreeRTOS的调试支持使用指南
2+
3+
通过更新您的Nuclei Studio IDE到202502版本和下载0.7.1的sdk-nuclei_sdk,并配合一些下面的修改,就可以使用OpenOCD对FreeRTOS进行调试。
4+
5+
### 环境准备
6+
7+
**Nuclei Studio**
8+
9+
- [NucleiStudio 202502 Windows](https://download.nucleisys.com/upload/files/nucleistudio/NucleiStudio_IDE_202502-win64.zip)
10+
- [NucleiStudio 202502 Linux](https://download.nucleisys.com/upload/files/nucleistudio/NucleiStudio_IDE_202502-lin64.tgz)
11+
12+
**Nuclei OpenOCD**
13+
14+
- 使用NucleiStudio 202502自带的的OpenOCD即可。
15+
16+
### 使用步骤
17+
18+
**step1:创建原始工程**
19+
20+
在NucleiStudio IDE下载好0.7.1版本的sdk-nuclei_sdk。
21+
22+
![image-20250513103947602](asserts\images\26\26-1.png)
23+
24+
创建一个900的项目,如下图。
25+
26+
![image-20250513170041690](asserts\images\26\26-2.png)
27+
28+
开发板烧写对应的bit即可,这里我们使用u900_best_config_ku060_50M_c1dd7f44af_915aefa97_202504141013_v4.1.0.bit
29+
30+
**step2:修改portmacro.h内容**
31+
32+
项目创建好,找到nuclei_sdk\OS\FreeRTOS\Source\portable\portmacro.h, 修改该文件内容如下
33+
34+
~~~
35+
typedef uint32_t TickType_t;
36+
#define portMAX_DELAY ( TickType_t )0xFFFFFFFFUL
37+
/* RISC-V TIMER is 64-bit long */
38+
//typedef uint64_t TickType_t;
39+
//#define portMAX_DELAY ( TickType_t )0xFFFFFFFFFFFFFFFFULL
40+
~~~
41+
42+
![image-20250513165844658](asserts\images\26\26-3.png)
43+
44+
**step3:修改openocd_evalsoc.cfg内容**
45+
46+
找到nuclei_sdk/SoC/evalsoc/Board/nuclei_fpga_eval/openocd_evalsoc.cfg,修改第118行内容
47+
48+
~~~
49+
target create $_TARGETNAME riscv -chain-position $_TARGETNAME -coreid $BOOTHART -rtos FreeRTOS
50+
~~~
51+
52+
![image-20250513165933970](asserts\images\26\26-4.png)
53+
54+
**step4:openocd调试工程**
55+
56+
Debug运行程序,打开Debugger Console视图。
57+
58+
在Debugger Console视图下输入info threads,回车。
59+
60+
![image-20250513165625083](asserts\images\26\26-5.png)
61+
62+
### 使用说明
63+
64+
目前支持**FreeRTOS**,不支持**Zephyr****ThreadX****UCOSII**
65+

asserts/images/26/26-1.png

142 KB
Loading

asserts/images/26/26-2.png

153 KB
Loading

asserts/images/26/26-3.png

208 KB
Loading

asserts/images/26/26-4.png

186 KB
Loading

asserts/images/26/26-5.png

223 KB
Loading

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ nav:
3030
- 23-nuclei_debug_map_register_analyze.md
3131
- 24-example_for_adding_new_instructions_in_binutils.md
3232
- 25-nuclei_cross_trigger_in_openocd.md
33+
- 26-debugging_support_for_freertos_by_openocd.md
3334
exclude_docs: |
3435
0-*.md
3536
theme:

0 commit comments

Comments
 (0)