Skip to content

Commit

Permalink
feat(platform): Add OpenOCD programming support for STeaMi and Nucleo…
Browse files Browse the repository at this point in the history
… 64 boards

- Modified `platform.txt` to enable programming via OpenOCD, which was already used for debugging.
- Added an example demonstrating how to program all Nucleo-64 boards, whether they use STLink or DAPLink.

To avoid conflict, the support for STeaMi will be added after the merge of the PR stm32duino#2526

*Benefits:*

- Enables programming of STeaMi boards.
- Supports P_NUCLEO boards that use DAPLink instead of STLink to leverage WebUSB functionality.
  • Loading branch information
nedseb committed Sep 27, 2024
1 parent 8da4af2 commit 8a20dde
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,18 @@ Nucleo_64.menu.upload_method.dfuMethod.upload.protocol=dfu
Nucleo_64.menu.upload_method.dfuMethod.upload.options=-v {upload.vid} -p {upload.pid}
Nucleo_64.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg

Nucleo_64.menu.upload_method.OpenOCD=OpenOCD STLink (SWD)
Nucleo_64.menu.upload_method.OpenOCD.upload.protocol=stlink
Nucleo_64.menu.upload_method.OpenOCD.upload.target=stm32wbx
Nucleo_64.menu.upload_method.OpenOCD.upload.setup_command=transport select hla_swd;
Nucleo_64.menu.upload_method.OpenOCD.upload.tool=openocd_upload

Nucleo_64.menu.upload_method.OpenOCD=OpenOCD DapLink (SWD)
Nucleo_64.menu.upload_method.OpenOCD.upload.protocol=cmsis-dap
Nucleo_64.menu.upload_method.OpenOCD.upload.target=stm32wbx
Nucleo_64.menu.upload_method.OpenOCD.upload.setup_command=transport select swd;
Nucleo_64.menu.upload_method.OpenOCD.upload.tool=openocd_upload

################################################################################
# Nucleo 32 boards

Expand Down
8 changes: 8 additions & 0 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ tools.remoteproc_gen.upload.params.verbose=
tools.remoteproc_gen.upload.params.quiet=
tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{build.path}/{build.project_name}.elf" "{build.path}/run_arduino_{build.project_name}.sh"

# OpenOCD sketch upload
tools.openocd_upload.path={openocd_dir}
tools.openocd_upload.cmd=bin/openocd
tools.openocd_upload.cmd.windows=bin/openocd.exe
tools.openocd_upload.upload.params.verbose=-d2
tools.openocd_upload.upload.params.quiet=-d0
tools.openocd_upload.upload.pattern="{path}/{cmd}" {upload.verbose} -f interface/{upload.protocol}.cfg -c "{upload.setup_command}" -f target/{upload.target}.cfg -c "program {{build.path}/{build.project_name}.bin} verify reset; shutdown;"

#
# Debugger
#
Expand Down

0 comments on commit 8a20dde

Please sign in to comment.