feat: pyocd调试成功
parent
738de1b60e
commit
5a499c9c27
|
@ -32,7 +32,7 @@ Midea-X1
|
|||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
.vscode
|
||||
#.vscode
|
||||
JLinkLog.txt
|
||||
JLinkSettings.ini
|
||||
DebugConfig/
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -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
|
||||
}
|
|
@ -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" // SWD可能未连接RST线, 使用软件复位
|
||||
|
||||
],
|
||||
// "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":[]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"files.associations": {
|
||||
"*.txt": "cmake",
|
||||
"drv_usart.h": "c"
|
||||
}
|
||||
}
|
|
@ -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",//更新 package(rtthread)
|
||||
"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
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}
|
14
README.md
14
README.md
|
@ -22,14 +22,14 @@
|
|||
|
||||
该开发板常用 **板载资源** 如下:
|
||||
|
||||
- MCU:STM32xxx,主频 xxxMHz,xxxKB FLASH ,xxxKB RAM
|
||||
- 外部 RAM:型号,xMB
|
||||
- 外部 FLASH:型号,xMB
|
||||
- MCU:STM32F107VC,主频 72MHz,256KB FLASH ,64KB RAM
|
||||
- 无外部 RAM:型号,xMB
|
||||
- 无外部 FLASH:型号,xMB
|
||||
- 常用外设
|
||||
- LED:x个,DS0(红色,PB1),DS1(绿色,PB0)
|
||||
- 按键:x个,K0(兼具唤醒功能,PA0),K1(PC13)
|
||||
- 常用接口:USB 转串口、SD 卡接口、以太网接口、LCD 接口等
|
||||
- 调试接口,标准 JTAG/SWD
|
||||
- LED:1个,POW(绿色,PC5),RUN(绿色,PE2)
|
||||
- 按键:0个,K0(兼具唤醒功能,PA0),K1(PC13)
|
||||
- 常用接口:CAN、USB 转串口、SD 卡接口、以太网接口、LCD 接口等
|
||||
- 调试接口,标准 SWD
|
||||
|
||||
开发板更多详细信息请参考【厂商名】 [xxx开发板介绍](https://xxx)。
|
||||
|
||||
|
|
Loading…
Reference in New Issue