Skip to content

boards/lora-e5-dev: set OpenOCD _TARGETNAME variable to fix flashing#21615

Merged
crasbe merged 1 commit intoRIOT-OS:masterfrom
baptleduc:fix-openocd-flash-lora-e5-dev
Jul 22, 2025
Merged

boards/lora-e5-dev: set OpenOCD _TARGETNAME variable to fix flashing#21615
crasbe merged 1 commit intoRIOT-OS:masterfrom
baptleduc:fix-openocd-flash-lora-e5-dev

Conversation

@baptleduc
Copy link
Copy Markdown
Contributor

Contribution description

This patch fixes an issue in the OpenOCD STM32WLX target config (target/stm32wlx.cfg) where the _TARGETNAME variable is not defined after creating the CPU target.

Board configs relying on _TARGETNAME fail with can't read "_TARGETNAME": no such variable during flashing or debugging.

Per the OpenOCD Config File Guidelines, _TARGETNAME should be set in the target config, but it was removed in a previous commit (diff).

This patch sets _TARGETNAME explicitly in the openocd.cfg for lora-e5-dev to point to the main CPU target ($_CHIPNAME.cpu0), restoring expected behavior.

Testing procedure

With this fix, flashing the examples/basic/hello-world example now works correctly.

Issues/PRs references

#21614

@github-actions github-actions bot added the Area: boards Area: Board ports label Jul 18, 2025
@crasbe crasbe added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Jul 18, 2025
@riot-ci
Copy link
Copy Markdown

riot-ci commented Jul 18, 2025

Murdock results

✔️ PASSED

d666ed8 boards/lora-e5-dev: use .cpu0 directly rather than _TARGETNAME

Success Failures Total Runtime
1 0 1 01m:39s

Artifacts

@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Jul 18, 2025

Please also adapt the title of the PR and the commit message to our commit convention, which you can find here: https://github.com/RIOT-OS/RIOT/blob/master/CONTRIBUTING.md#commit-conventions

A suitable title (for the current state) would be e.g. boards/lora-e5-dev: set OpenOCD _TARGETNAME variable to fix flashing.

@baptleduc baptleduc changed the title fix: set _TARGETNAME variable to allow correct flashing boards/lora-e5-dev: set OpenOCD _TARGETNAME variable to fix flashing Jul 21, 2025
@baptleduc baptleduc requested a review from crasbe July 21, 2025 19:36
@crasbe crasbe added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label Jul 21, 2025
@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Jul 22, 2025

You re-requested a review, but you didn't push any changes yet?

@baptleduc
Copy link
Copy Markdown
Contributor Author

You re-requested a review, but you didn't push any changes yet?

Sorry I forgot, it would be ok now

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.

Looks good, please squash your commits into one :)

@baptleduc baptleduc force-pushed the fix-openocd-flash-lora-e5-dev branch from 553fdbe to d666ed8 Compare July 22, 2025 10:23
@baptleduc
Copy link
Copy Markdown
Contributor Author

Looks good, please squash your commits into one :)

done ;)

@crasbe crasbe enabled auto-merge July 22, 2025 10:44
@crasbe crasbe added this pull request to the merge queue Jul 22, 2025
Merged via the queue into RIOT-OS:master with commit 416db07 Jul 22, 2025
25 checks passed
@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Jul 22, 2025

Thank you for fixing this and congratulations for your first merged PR 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing _TARGETNAME variable in stm32wlx target config causes flash failure

4 participants