通常会用MDK调试stm32等arm cotex平台,但KEIL MDK很多商业公司是不能直接使用的,需要购买授权!VScode
搭配gcc-arm-none-eabi编译工具链和openocd(Open On-Chip Debugger)实现编译、下载、调试!
并添加环境变量: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
同时添加环境变量:C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin
并添加环境变量:D:\work\tool\OpenOCD-20211118-0.11.0\bin
以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
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"
}
]
}
> 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
终端将被任务重用,按任意键关闭。
显示编译成功
> 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 '.
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
终端将被任务重用,按任意键关闭。
显示下载成功
左侧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、运行调试