VsCode+OpenOCD 开发stm32系列_vscode openocd-程序员宅基地

技术标签: stm32  openocd  vscode  笔记收藏  

通常会用MDK调试stm32等arm cotex平台,但KEIL MDK很多商业公司是不能直接使用的,需要购买授权!VScode
搭配gcc-arm-none-eabi编译工具链和openocd(Open On-Chip Debugger)实现编译、下载、调试!

所需资源
环境搭建
1、mingw-w64安装(mingw-w64-install.exe)

在这里插入图片描述

并添加环境变量:C:\Program Files\mingw-w64\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin
同时将 C:\Program Files\mingw-w64\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin\mingw32-make.exe 备份并命名为make.exe

2、arm-gcc安装(gcc-arm-none-eabi-10.3-2021.10-win32.exe)

在这里插入图片描述

同时添加环境变量:C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin

3、openocd-20211118.7z解压到指定位置

在这里插入图片描述

并添加环境变量:D:\work\tool\OpenOCD-20211118-0.11.0\bin

4、VScode安装,并安装插件 C/C++,Cortex-Debug

在这里插入图片描述
在这里插入图片描述

工程搭建(以stm32h7为例)

1、STM32CubeMX 生成Makefile 工程

在这里插入图片描述

2、VScode 打开生成的工程,shift+ctrl+p,进入c/c++配置UI,设置如下配置

在这里插入图片描述
在这里插入图片描述

3、复制openOCD配置文件到工程目录(和makefile同一路径)

以CMSIS-DAP 为例,如果用ST-link或者Jlink、ulink等,需要复制对应的cfg文件

D:\work\tool\OpenOCD-20211118-0.11.0\share\openocd\scripts\interface\cmsis-dap.cfg
D:\work\tool\OpenOCD-20211118-0.11.0\share\openocd\scripts\target\stm32h7x.cfg

4、VScode配置编译和下载任务(终端->运行任务->添加配置任务)

在这里插入图片描述

tasks.json
{
    // 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": "make",
            "args": [
            ],
            "group": "build"
        },
        {
            "label": "download",
            "type": "shell",
            "command": "openocd",
            "args": [
                "-f",
                "cmsis-dap.cfg",
                "-f",
                "stm32h7x.cfg",
                "-c",
                "program build/stm32h7_demo.elf verify reset exit"
            ],
            "group": "build"
        }
    ]
}
5、运行"build"任务
> Executing task: make <

mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/main.d" -Wa,-a,-ad,-alms=build/main.lst Core/Src/main.c -o build/main.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/gpio.d" -Wa,-a,-ad,-alms=build/gpio.lst Core/Src/gpio.c -o build/gpio.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/usart.d" -Wa,-a,-ad,-alms=build/usart.lst Core/Src/usart.c -o build/usart.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_rcc.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_rcc.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c -o build/stm32h7xx_hal_rcc.oarm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_rcc_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_rcc_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c -o build/stm32h7xx_hal_rcc_ex.oarm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_flash.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_flash.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c -o build/stm32h7xx_hal_flash.oarm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_flash_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_flash_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c -o build/stm32h7xx_hal_flash_ex.oarm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_gpio.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_gpio.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c -o build/stm32h7xx_hal_gpio.oarm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_hsem.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_hsem.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c -o build/stm32h7xx_hal_hsem.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_dma.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_dma.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c -o build/stm32h7xx_hal_dma.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_dma_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_dma_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c -o build/stm32h7xx_hal_dma_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_mdma.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_mdma.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c -o build/stm32h7xx_hal_mdma.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_pwr.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_pwr.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c -o build/stm32h7xx_hal_pwr.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_pwr_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_pwr_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c -o build/stm32h7xx_hal_pwr_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c -o build/stm32h7xx_hal.o 
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_i2c.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_i2c.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c -o build/stm32h7xx_hal_i2c.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_i2c_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_i2c_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c -o build/stm32h7xx_hal_i2c_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_exti.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_exti.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c -o build/stm32h7xx_hal_exti.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_tim.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_tim.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c -o build/stm32h7xx_hal_tim.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_tim_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_tim_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c -o build/stm32h7xx_hal_tim_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_uart.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_uart.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c -o build/stm32h7xx_hal_uart.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32h7xx_hal_uart_ex.d" -Wa,-a,-ad,-alms=build/stm32h7xx_hal_uart_ex.lst Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c -o build/stm32h7xx_hal_uart_ex.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/system_stm32h7xx.d" -Wa,-a,-ad,-alms=build/system_stm32h7xx.lst Core/Src/system_stm32h7xx.c -o build/system_stm32h7xx.o
arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H743xx -ICore/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/startup_stm32h743xx.d" startup_stm32h743xx.s -o build/startup_stm32h743xx.o
arm-none-eabi-gcc build/main.o build/gpio.o build/usart.o build/stm32h7xx_it.o build/stm32h7xx_hal_msp.o build/stm32h7xx_hal_cortex.o build/stm32h7xx_hal_rcc.o build/stm32h7xx_hal_rcc_ex.o build/stm32h7xx_hal_flash.o build/stm32h7xx_hal_flash_ex.o build/stm32h7xx_hal_gpio.o build/stm32h7xx_hal_hsem.o build/stm32h7xx_hal_dma.o build/stm32h7xx_hal_dma_ex.o build/stm32h7xx_hal_mdma.o build/stm32h7xx_hal_pwr.o build/stm32h7xx_hal_pwr_ex.o build/stm32h7xx_hal.o build/stm32h7xx_hal_i2c.o build/stm32h7xx_hal_i2c_ex.o build/stm32h7xx_hal_exti.o build/stm32h7xx_hal_tim.o build/stm32h7xx_hal_tim_ex.o build/stm32h7xx_hal_uart.o build/stm32h7xx_hal_uart_ex.o build/system_stm32h7xx.o build/startup_stm32h743xx.o -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32H743IITx_FLASH.ld  -lc -lm -lnosys  -Wl,-Map=build/stm32h7_demo.map,--cref -Wl,--gc-sections -o build/stm32h7_demo.elf
arm-none-eabi-size build/stm32h7_demo.elf
   text    data     bss     dec     hex filename
  13236      24    1712   14972    3a7c build/stm32h7_demo.elf
arm-none-eabi-objcopy -O ihex build/stm32h7_demo.elf build/stm32h7_demo.hex
arm-none-eabi-objcopy -O binary -S build/stm32h7_demo.elf build/stm32h7_demo.bin        

终端将被任务重用,按任意键关闭。

显示编译成功

6、运行"download"任务
> Executing task: openocd -f cmsis-dap.cfg -f stm32h7x.cfg -c 'program build/stm32h7_demo.elf verify reset exit' <

Open On-Chip Debugger 0.11.0 (2021-11-18) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD  supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 1800 kHz
Info : SWD DPIDR 0x6ba02477
Info : stm32h7x.cpu0: Cortex-M7 r1p1 processor detected
Info : stm32h7x.cpu0: target has 8 breakpoints, 4 watchpoints
Info : gdb port disabled
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800328c msp: 0x20020000
** Programming Started **
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (0) size is 1024 kb, base address is 0x08000000
Info : Padding image section 1 at 0x080033cc with 20 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x080033e0 .. 0x0801ffff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked

终端将被任务重用,按任意键关闭。

显示下载成功

7、配置单步调试功能

左侧debug标签中,新增配置文件,会自动生成launch.json,修改launch.json内容如下:
在这里插入图片描述

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "cwd": "${workspaceRoot}",
            "executable": "./build/stm32h7_demo.elf",
            "name": "Debug Microcontroller",
            "request": "launch",
            "type": "cortex-debug",
            "showDevDebugOutput": false,
            "servertype": "openocd",
            "configFiles": [
                "cmsis-dap.cfg",
                "stm32h7x.cfg"
            ]
        }
    ]
}

8、运行调试

在这里插入图片描述


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/pyt1234567890/article/details/122522700

智能推荐

ES2007的tomcat报错的原因_tomcat报错esservicecontraller-程序员宅基地

文章浏览阅读392次。方正ES2007,在能成功连接数据库的前提下,如果tomcat报错,那么你就可以看看你的ip地址是否仍然是自动获取ip,如果是请更改过来,使用具体的ip地址(类似192.168.1.11....),再跑一遍就Ok了。_tomcat报错esservicecontraller

es修改排序_java 如何实现ElasticSearch自定义排序-程序员宅基地

文章浏览阅读1k次。1、es版本用的是5.1由于需要使用es的script的inline功能,需要修改es yml的配置文件,增加如下配置使其支持inlinescript.inline: onscript.stored: onscript.file: onscript.engine.groovy.inline.aggs: on增加完成上述配置需要重启es 注:不同的es版本配置不同2、java代码# 定义传入scri..._es addsort

计算机主机故障有哪些,电脑硬件常见故障有哪些-程序员宅基地

文章浏览阅读1.7k次。电脑硬件常见故障有哪些计算机硬件是指计算机系统中由电子,机械和光电元件等组成的各种物理装置的总称。下面小编来给大家介绍电脑硬件常见故障,希望对大家有帮助!1、CPU温度是CPU常见的'一个问题,CPU温度过高的时候会出现电脑频繁重启的现象,而且是每次开机还未进入系统就重启了,每次重启的时间也越来越短,这个时候就很有可能是CPU温度过高。2、主板电脑有时候开机屏幕上什么也不显示,并且没有出现报错声时..._电脑主机故障的八种表现和对应的现象是什么

java 之 静态泛型方法_java static 泛型 方法-程序员宅基地

文章浏览阅读585次。java 之 静态泛型方法_java static 泛型 方法

Django计算机毕业设计菜鸟驿站快递分发系统(程序+LW)Python_菜鸟驿站diango-程序员宅基地

文章浏览阅读169次。该项目含有源码、文档、程序、数据库、配套开发软件、软件安装教程项目运行环境配置:Pychram社区版+ python3.7.7 + Mysql5.7 + HBuilderX+list pip+Navicat11+Django+nodejs。项目技术:django + python+ Vue 等等组成,B/S模式 +pychram管理等等。环境需要1.运行环境:最好是python3.7.7,我们在这个版本上开发的。其他版本理论上也可以。2.pycharm环境:pycharm都可以。推荐pycharm社区版;3_菜鸟驿站diango

一站式在线协作开源办公软件ONLYOFFICE,协作更安全更便捷_在线office 开源-程序员宅基地

文章浏览阅读3.6w次,点赞151次,收藏134次。一站式在线协作办公软件ONLYOFFICE,协作更便捷_在线office 开源

随便推点

IJPay支付开源 让你的代码飞起来_ijpay 如何运行-程序员宅基地

文章浏览阅读631次。今天我要给大家推荐一个非常棒的支付开源项目,最近大家在不忙的时候可以学习一下,项目在GitHub有3.3k ,GITEE已有6.5k之多~特别说明:不依赖任何第三方 MVC 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。微信支付支持多商户多应用,普通商户模式与服务商商模式当然也支持境外商户、同时支持 Api-v3 与 Api-v2 版本的接口。支付宝支付支持多商户多应用,签名同时支持普通公钥方式与公钥证书方式目前封装好的SDK仅支持安卓 ,IOS还在开发中~~~~IJP_ijpay 如何运行

Vue 使用 Apache Echarts 绘制地图(省市、地区、自定义)_vue 地图-程序员宅基地

文章浏览阅读2.3w次,点赞77次,收藏260次。使用Apache Echarts绘制中国、省市级、自定义地图的方法_vue 地图

软件开发工具【十四】 之 常用建模工具_建模工具开发学习-程序员宅基地

文章浏览阅读5.4k次,点赞4次,收藏11次。感谢内容提供者:金牛区吴迪软件开发工作室接上一篇:软件开发工具【十三】 之 Eclipse插件的使用与开发文章目录一、UML建模介绍1.面向对象方法的出现和发展2.面向对象的一些概念3.面向对象方法的基本过程4.组件思想二、RATIONAL ROSE建模工具介绍1.RATIONAL 公司简介2.面向对象的分析设计和Rational Rose3.Rational Rose可视化建模的特点三、使用RATIONAL ROSE 建模1.UML建模的三大部分2.需求分析之用例图与活动图3.系统分析与设计四、E._建模工具开发学习

如何通过gdb查看反汇编代码_pwngdb 显示汇编代码-程序员宅基地

文章浏览阅读2.4w次,点赞15次,收藏77次。0x00 程序源码C代码如下:#include &amp;lt;stdio.h&amp;gt;int addme(int a, int b){ int c ; c = a+ b; return c;}int main(int argc, char const *argv[]){ int ret= 0; ret = addme(10,20); pri..._pwngdb 显示汇编代码

View的简介_view在编程中什么意思-程序员宅基地

文章浏览阅读1.6w次,点赞17次,收藏34次。认识一个新的事物,首先我们从概念上讲,我们需要知道,这个事物 是什么,这个事物有什么用途?对应到View 上,我们要搞明白 View 的定义以及工作原理。 1.View是什么? View是屏幕上的一块矩形区域,它负责用来显示一个区域,并且响应这个区域内的事件。可以说,手机屏幕上的任意一部分看的见得地方都是View,它很常见,比如 TextView 、ImageView 、Button_view在编程中什么意思

ES 内存使用和GC指标_es gc count多少算异常-程序员宅基地

文章浏览阅读3k次。摘录自:http://blog.csdn.net/yangwenbo214/article/details/74000458ES 内存使用和GC指标——主节点每30秒会去检查其他节点的状态,如果任何节点的垃圾回收时间超过30秒(Garbage collection duration),则会导致主节点任务该节点脱离集群。内存使用和GC指标在运行Elasticsearch时,内存是您..._es gc count多少算异常

推荐文章

热门文章

相关标签