Hi! I setup my first PlatformIO project recently, but I have been running into the following issue after attempting to upload. I am using this board, the PlatformIO extension for VSCode and I’m on MacOS 10.15.7.
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f302r8.html
PLATFORM: ST STM32 (10.0.1) > ST Nucleo F302R8
HARDWARE: STM32F302R8T6 72MHz, 16KB RAM, 64KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
- framework-arduinoststm32 4.10900.200819 (1.9.0)
- framework-cmsis 2.50501.200527 (5.5.1)
- tool-dfuutil 1.9.200310
- tool-openocd 2.1000.200630 (10.0)
- tool-stm32duino 1.0.1
- toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/nucleo_f302r8/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 5.7% (used 928 bytes from 16384 bytes)
Flash: [== ] 16.0% (used 10516 bytes from 65536 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pio/build/nucleo_f302r8/firmware.elf
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-12:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800074c msp: 0x20004000
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
==================================================================================================================== [SUCCESS] Took 4.69 seconds ====================================================================================================================
Terminal will be reused by tasks, press any key to close it.
I am using the default platformio.ini
file:
[env:nucleo_f302r8]
platform = ststm32
board = nucleo_f302r8
framework = arduino
My main.cpp
compiles successfully and I can run openocd -f stlink-v2.cfg -f stm32f3x.cfg
via my homebrew installation. (Full file paths removed for brevity) The resulting output is:
Open On-Chip Debugger 0.11.0-rc1+dev-01530-g0dd3b7fa6-dirty (2020-12-19-18:22)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J37M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.261782
Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f3x.cpu on 3333
Info : Listening on port 3333 for gdb connections
Running brew info openocd
:
open-ocd: stable 0.10.0 (bottled), HEAD
On-chip debugging, in-system programming and boundary-scan testing
http://openocd.org/
/usr/local/Cellar/open-ocd/HEAD-0dd3b7f (800 files, 4.7MB) *
Built from source on 2020-12-19 at 18:23:23
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/open-ocd.rb
License: GPL-2.0
==> Dependencies
Build: pkg-config ✔
Required: hidapi ✔, libftdi ✔, libusb ✔, libusb-compat ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 580 (30 days), 1,825 (90 days), 7,173 (365 days)
install-on-request: 577 (30 days), 1,801 (90 days), 7,104 (365 days)
build-error: 0 (30 days)
I do notice that Platformio: Upload
is using a different version of openocd (0.10.0+dev-00378-ge5be992df (2020-06-26-12:31)
than the working brew version (0.11.0-rc1+dev-01530-g0dd3b7fa6-dirty (2020-12-19-18:22)
. I was unable to customize it to use the working version of openocd. I attempted to tell platformio to use my brew openocd (full file paths removed for brevity) however the output after uploading still did not change. My updated platformio.ini file is shown below but that had no affect and the .platformio/packages/tool-openocd
version still gets used.
[env:nucleo_f302r8]
platform = ststm32
board = nucleo_f302r8
framework = arduino
debug_tool = custom
debug_server =
openocd
-f
stlink-v2.cfg
-f
stm32f3x.cfg
Any feedback would be greatly appreciated!