Skip to content

Conversation

crasbe
Copy link
Contributor

@crasbe crasbe commented Sep 23, 2025

Contribution description

With #20965 I added the "Pinreset Enable" functionality to RIOT for nRF52 boards by setting the right values in the UICR register after flashing.
However this had two flaws:

  1. The command for the Waveshare Board was in the wrong file (Makefile instead of Makefile.include).
  2. You can only add one additional command because the JLink commander only likes to have one command.
  3. Any command line additions or additions in application Makefiles are ignored.

The second part also involves modifying the jlink.sh script to evaluate multiple commands that are each put into "..." brackets.

Testing procedure

You can use an nRF52DK, nRF52840DK, DWM1001 or Waveshare-nRF52840 board for testing.

With current master, the two ShowConf commands are ignored and you only see the command to set the Pin Reset.

JLINK_POST_FLASH='"ShowConf" "ShowConf"' BOARD=nrf52840dk make -C examples/basic/hello-world flash
...
J-Link: Flash download: Program & Verify speed: 72 KB/s
O.K.
J-Link>Write4 0x10001200 00000012 00000012
Writing 00000012 -> 10001200
Writing 00000012 -> 10001204
J-Link>r
...

With this PR, all commands are executed.

JLINK_POST_FLASH='"ShowConf" "ShowConf"' BOARD=nrf52840dk make -C examples/basic/hello-world flash -j
...
J-Link: Flash download: Program & Verify speed: 72 KB/s
O.K.
J-Link>ShowConf
USB-Address: 0
Enum. type:  Real-SN is used
Real-SN:     1050208458
KS-Power:    Off (Default)
J-Link>ShowConf
USB-Address: 0
Enum. type:  Real-SN is used
Real-SN:     1050208458
KS-Power:    Off (Default)
J-Link>Write4 0x10001200 00000012 00000012
Writing 00000012 -> 10001200
Writing 00000012 -> 10001204
J-Link>r
...

Issues/PRs references

Fixup for #20965.

@crasbe crasbe requested a review from aabadie as a code owner September 23, 2025 13:28
@crasbe crasbe added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: enhancement The issue suggests enhanceable parts / The PR enhances 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 CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Sep 23, 2025
@github-actions github-actions bot added Area: tools Area: Supplementary tools Area: boards Area: Board ports labels Sep 23, 2025
@riot-ci
Copy link

riot-ci commented Sep 23, 2025

Murdock results

✔️ PASSED

f108336 dist/tools: allow multiple JLINK_POST_FLASH commands in jlink.sh

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

Artifacts

@crasbe crasbe requested a review from mguetschow September 23, 2025 13:36
@crasbe
Copy link
Contributor Author

crasbe commented Sep 23, 2025

Request for Comments: Should I add the same change to the jlink.sh for JLINK_PRE_FLASH?

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Thanks for caring and fixing!

@mguetschow
Copy link
Contributor

Request for Comments: Should I add the same change to the jlink.sh for JLINK_PRE_FLASH?

Sounds reasonable to me, or is there any disadvantage to it?

@crasbe
Copy link
Contributor Author

crasbe commented Sep 26, 2025

Request for Comments: Should I add the same change to the jlink.sh for JLINK_PRE_FLASH?

Sounds reasonable to me, or is there any disadvantage to it?

Not really, the JLINK_PRE_FLASH variable is referenced more often in the script, so it would add some lines of code, but nothing crazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports 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 CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants