feat: pyocd调试成功

main
邱棚 2023-05-10 17:23:06 +08:00
parent 738de1b60e
commit 5a499c9c27
7 changed files with 237 additions and 8 deletions

2
.gitignore vendored
View File

@ -32,7 +32,7 @@ Midea-X1
GPATH
GRTAGS
GTAGS
.vscode
#.vscode
JLinkLog.txt
JLinkSettings.ini
DebugConfig/

View File

@ -0,0 +1 @@
[]

41
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,41 @@
{
"configurations": [
{
"name": "Win32",
"defines": [
"RT_USING_LIBC",
"RT_USING_NEWLIBC",
"STM32F107xC",
"USE_HAL_DRIVER",
"_POSIX_C_SOURCE=1",
"__RTTHREAD__"
],
"intelliSenseMode": "clang-x64",
"compilerPath": "/Users/qp/Applications/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc",
"cStandard": "c99",
"cppStandard": "c++11",
"includePath": [
"applications",
"rt-thread/components/libc/compilers/newlib",
"rt-thread/components/libc/compilers/common/include",
"rt-thread/libcpu/arm/common",
"rt-thread/libcpu/arm/cortex-m3",
"rt-thread/components/drivers/include",
"board",
"board/CubeMX_Config/Core/Inc",
"libraries/HAL_Drivers",
"libraries/HAL_Drivers/config",
"libraries/HAL_Drivers/CMSIS/Include",
"rt-thread/components/finsh",
".",
"rt-thread/include",
"libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Include",
"libraries/STM32F1xx_HAL/STM32F1xx_HAL_Driver/Inc",
"rt-thread/components/libc/posix/io/stdio",
"rt-thread/components/libc/posix/io/poll",
"rt-thread/components/libc/posix/ipc"
]
}
],
"version": 4
}

89
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,89 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "openOCD-Debug",
"cwd": "${workspaceRoot}",
"executable": "rt-thread.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"preLaunchTask": "Build",
"linux": {
"armToolchainPath": "/usr/bin/",
"configFiles": [
"/usr/share/openocd/scripts/interface/stlink.cfg",
"/usr/share/openocd/scripts/target/stm32f1x.cfg",
],
},
"windows": {
"armToolchainPath": "C://Program Files//",
"configFiles": [
"C://Program Files//openocd//scripts//interface//stlink.cfg",
"C://Program Files//openocd//scripts//target//stm32f1x.cfg",
],
},
"osx": {
"armToolchainPath": "/Users/qp/Applications/gcc-arm-none-eabi-10.3-2021.10/bin/",
"configFiles":[
"/opt/homebrew/Cellar/open-ocd/0.12.0/share/openocd/scripts/interface/stlink.cfg",
"/opt/homebrew/Cellar/open-ocd/0.12.0/share/openocd/scripts/target/stm32f1x.cfg"
]
},
"openOCDLaunchCommands": [
"reset_config none" // SWDRST线, 使
],
// "runToMain": false,
// "svdFile": "libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F0xx/STM32F072x.svd", // SVD,CPU
"runToEntryPoint": "rtthread_startup",
"rtos": "auto",
// "breakAfterReset":true,
// "postStartSessionCommands":[]
},
{
"name": "pyOCD-Debug",
"cwd": "${workspaceRoot}",
"executable": "rt-thread.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "pyocd",
"showDevDebugOutput": "both",
"targetId":"stm32f107vc",
"interface": "swd",
// "cmsisPack": "libraries/STM32F1xx_HAL/CMSIS/",
"preLaunchTask": "Build",
"linux": {
"name": "Launch",
"type": "cortex-debug",
"request": "launch",
"executable": "",
"armToolchainPath": "/usr/bin/",
},
"windows": {
"name": "Launch",
"type": "cortex-debug",
"request": "launch",
"executable": "",
"armToolchainPath": "C://Program Files//",
},
"osx": {
"name": "Launch",
"type": "cortex-debug",
"request": "launch",
"executable": "rt-thread.elf",
"armToolchainPath": "/Users/qp/Applications/gcc-arm-none-eabi-10.3-2021.10/bin/"
},
// "runToMain": false,
// "svdFile": "libraries/STM32F0xx_HAL/CMSIS/Device/ST/STM32F0xx/STM32F072x.svd", // SVD,CPU
"runToEntryPoint": "rtthread_startup",
// "breakAfterReset":true,
// "postStartSessionCommands":[]
}
]
}

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"files.associations": {
"*.txt": "cmake",
"drv_usart.h": "c"
}
}

92
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,92 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "scons -j8",
"detail":"scons -j8",
"group": "build",
},
{
"label": "Rebuild",
"type": "shell",
"command": "scons -c && scons -j8",
"detail":"scons -c && scons -j8",
"group": "build"
},
{
"label": "Clean",
"type": "shell",
"command": "scons -c",
"detail":"scons -c",
"group": "build"
},
{
"label": "Download",//openocd
"type": "shell",
"detail":"openocd",
"group": "build",
"command": "openocd",
"args": [
//"-d", //openocd
"-f",
"interface/stlink.cfg", // /usr/share/openocd/scripts/
"-f",
"target/stm32f1x.cfg", // /usr/share/openocd/scripts/
"-c",
"reset_config none",
"-c",
"init",
"-c",
"reset init",
"-c",
"halt",
"-c",
"sleep 10",
"-c",
"flash write_image erase rt-thread.elf", //
"-c",
"sleep 10",
"-c",
"shutdown",
"-c",
"exit"
]
},
{
"label": "Menuconfig",//rtthread
"type": "shell",
"command": "scons --menuconfig",
"detail":"scons --menuconfig",
"group": "build"
},
{
"label": "Update",// packagertthread
"type": "shell",
"command": "pkgs --update",
"detail":"pkgs --update",
"group": "build"
},
{
"label": "Package",//vscode
"type": "shell",
"command": "scons --target=vsc -s",
"detail":"scons --target=vsc -s",
"group": "build"
},
{
"label": "tty", //
"type": "shell",
"command": "picocom -b 115200 /dev/ttyUSB0",
"detail":"picocom -b 115200 /dev/ttyUSB0",
"group": "build",
"runOptions": {
"instanceLimit": 1
}
}
]
}

View File

@ -22,14 +22,14 @@
该开发板常用 **板载资源** 如下:
- MCUSTM32xxx主频 xxxMHzxxxKB FLASH xxxKB RAM
- 外部 RAM型号xMB
- 外部 FLASH型号xMB
- MCUSTM32F107VC主频 72MHz256KB FLASH 64KB RAM
- 外部 RAM型号xMB
- 外部 FLASH型号xMB
- 常用外设
- LEDx个DS0红色PB1DS1绿色PB0
- 按键:xK0兼具唤醒功能PA0K1PC13
- 常用接口USB 转串口、SD 卡接口、以太网接口、LCD 接口等
- 调试接口,标准 JTAG/SWD
- LED1个POW绿色PC5RUN绿色PE2
- 按键:0K0兼具唤醒功能PA0K1PC13
- 常用接口:CAN、USB 转串口、SD 卡接口、以太网接口、LCD 接口等
- 调试接口,标准 SWD
开发板更多详细信息请参考【厂商名】 [xxx开发板介绍](https://xxx)。