Skip to content

makefiles/tools/openocd: Do not require openocd.cfg for STM32 boards#21717

Merged
maribu merged 1 commit intoRIOT-OS:masterfrom
maribu:openocd/stm32-without-stlink
Sep 15, 2025
Merged

makefiles/tools/openocd: Do not require openocd.cfg for STM32 boards#21717
maribu merged 1 commit intoRIOT-OS:masterfrom
maribu:openocd/stm32-without-stlink

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented Sep 14, 2025

Contribution description

When OPENOCD_DEBUG_ADAPTER was set to stlink, no openocd.cfg was needed for most STM32 boards. (But one could still be provided if special handling was needed.) However, for any other debug adapter this was not the case.

This moves the handling for when no custom openocd.cfg is provided from the stlink.inc.mk to openocd.inc.mk, so that most boards now work out of the box with other debuggers.

Testing procedure

Tested with OPENOCD_DEBUG_ADAPTER=jlink with a yet to be upstreamed STM32 board. B

Issues/PRs references

Fixes one of the issues we ran into on the RIOT summit Hackathon when adding the Olimexino-STM32F3 board definition

@maribu maribu added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 14, 2025
@github-actions github-actions bot added Area: build system Area: Build system Area: tools Area: Supplementary tools labels Sep 14, 2025
@riot-ci
Copy link
Copy Markdown

riot-ci commented Sep 14, 2025

Murdock results

✔️ PASSED

a1e13af makefiles/tools/openocd: Do not require openocd.cfg for STM32 boards

Success Failures Total Runtime
10513 0 10515 09m:40s

Artifacts

@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 14, 2025
@maribu maribu force-pushed the openocd/stm32-without-stlink branch from 1d08960 to 6a176bf Compare September 15, 2025 09:39
@maribu maribu force-pushed the openocd/stm32-without-stlink branch from 7ac0365 to 1c6fb2d Compare September 15, 2025 10:49
When `OPENOCD_DEBUG_ADAPTER` was set to `stlink`, no `openocd.cfg`
was needed for most STM32 boards. (But one could still be provided if
special handling was needed.) However, for any other debug adapter this
was not the case.

This moves the handling for when no custom `openocd.cfg` is provided from
the `stlink.inc.mk` to `openocd.inc.mk`, so that most boards now work
out of the box with other debuggers.

Co-authored-by: crasbe <[email protected]>
@maribu maribu force-pushed the openocd/stm32-without-stlink branch from 1c6fb2d to a1e13af Compare September 15, 2025 10:53
Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not test it myself, so I trust your testing.

@maribu
Copy link
Copy Markdown
Member Author

maribu commented Sep 15, 2025

Flashing still works fine on a Nucleo-F446RE :)

@maribu maribu added this pull request to the merge queue Sep 15, 2025
Merged via the queue into RIOT-OS:master with commit 92b3b69 Sep 15, 2025
27 checks passed
@maribu maribu deleted the openocd/stm32-without-stlink branch September 15, 2025 14:05
@maribu
Copy link
Copy Markdown
Member Author

maribu commented Sep 15, 2025

Thx :)

@benpicco benpicco added this to the Release 2025.10 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants