-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards/nrf52*dk: Enable Pinreset after Flashing #20965
Conversation
1a2dcae
to
dbad618
Compare
I am currently working on another PR that updates the nRF documentation (and checks off some points from the list in #20775). |
Nice, thank you! Just tested this locally with an
For feature parity, we would need to support Also, this approach only works with |
That is interesting, I did not have the dwm1001 on my radar. The documentation of the dwm1001 does not mention the reset tool.
Yes, currently this only works with JLink. I tried to look into how to implement the UICR programming in OpenOCD, but currently OpenOCD does not work with the embedded JLink on the nRF52840. Maybe you can try it to see if it works for you? Apparently, the new(er?) versions of the J-Link use a different product ID, which is not recognized by "libjaylink" which OpenOCD uses.
To get some more debug information, you can add change line 340 of - sh -c "${OPENOCD} \
+ sh -c "${OPENOCD} -d3 \ This yields the following:
libjaylink v0.2.0 recognizes the following Product IDs (https://github.com/syntacore/libjaylink/blob/master/libjaylink/discovery_usb.c#L46-L65), and Segger J-Link firmware from "2024 Oct 9 11:01" uses 1060:
Maybe this is an issue I could raise with OpenOCD Edit: This is actually not true, the Github repo is just outdated. This seems to be the active repository for libjaylink: https://gitlab.zapb.de/libjaylink/libjaylink This still wouldn't fix our issue because the ID 1060 is not part of that lib either... BUT it seems to be under active development, so maybe I can open an issue or PR there. This is a good opportunity to remove the remarks about the OpenOCD version in
|
Okay.. this is becoming a pretty deep rabbit hole, I'll open a separate issue about it. |
A proposal to move this forward for now without too much side-tracking:
|
Alright, that sounds like a good plan.
|
I think so too, since it is pretty disjoint. Maybe the OpenOCD fixes could go first and then this PR could build on top of it and include the OpenOCD resetbutton configuration trick. |
be34fcf
to
644a947
Compare
I went through the RIOT Board list and this board appears to have a hardware reset button as well: https://doc.riot-os.org/group__boards__reel.html I'll add the JLink and OpenOCD commands to that as well, after that I think this is ready to be merged. |
Sounds good! Would you mind also addressing number 1 from above? |
Sure, I didn't notice the second part of that 😅 |
9671e4a
to
0c89794
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM then, thanks a lot!
360 min is the timeout for the merge queue, I'll drop this from the queue and add it again to not waste a 3 hrs Murdock CI pass. |
Thanks everyone ❤️ |
Contribution description
As outlined in #20775, there was a silicon change in the nRF52 chips at some revision making the UICR register non-persistent. This means that the applied configuration is deleted when the flash is erased and programmed.
The reset pin is configured in this UICR register as well, so after flashing RIOT to (any) nRF52 chip without a bootloader, the reset pin won't work anymore.
This PR adds a JLINK_POST_FLASH command which configures the UICR->PSELRESET registers while the nRF52 chip is still unlocked from Flashing.
The JLINK_POST_FLASH variable is added to the builsystem sanity check as well, so it is evaluated alongside JLINK_PRE_FLASH. I'm not sure if that was required, but now it is consistent.
Request for comments: The documentation should be updated accordingly and the old tool in
dist/tools/nrf52_resetpin_cfg
is obsolete and could be deleted. This PR works with all silicon revisions of the nRF52 and the tool does not.Should I do that in this PR or do a separate PR?
Testing procedure
You can use any application you want and flash it to either a nRF52DK board (with the nRF52832DK) or an nRF52840DK from Nordic and press the Reset button.
The board should reset.
Issues/PRs references
This fixes #20775.