Skip to content
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

dist/tools/openocd: fix parsing of flash bank base #19620

Merged
merged 1 commit into from
May 23, 2023

Conversation

maribu
Copy link
Member

@maribu maribu commented May 19, 2023

Contribution description

Since 80fc9fabc66a0bc767467fa14c703e5a9f340cd3 the format of the flash list command changed to a more human readable multi-line variant. Technically, the change is white-space only. Still, the current approach of parsing them with awk, sed and cut doesn't like the new multi-line format. The parsing is now delegated into a python script that is compatible across OpenOCD versions.

Testing procedure

PROGRAMMER=openocd BOARD=nrf52840dk make -C tests/riotboot/ riotboot/flash-slot1

Should now work even with an fresh OpenOCD build from git

Issues/PRs references

Found while looking into #14576

Since 80fc9fabc66a0bc767467fa14c703e5a9f340cd3 the format of the
`flash list` command changed to a more human readable multi-line
variant. Technically, the change is white-space only. Still, the
current approach of parsing them with awk, sed and cut doesn't like
the new multi-line format. The parsing is now delegated into a
python script that is compatible across OpenOCD versions.
@github-actions github-actions bot added the Area: tools Area: Supplementary tools label May 19, 2023
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 23, 2023
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Code change is good and I like the approach of using Python for parsing the output of "flash list". I tested this on nucleo-l476rg for which I have an issue when testing tests/riotboot with the latest openocd version. With this PR it works on old and latest OpenOCD. It is also working on both OpenOCD versions with nrf52840dk.

ACK

@riot-ci
Copy link

riot-ci commented May 23, 2023

Murdock results

✔️ PASSED

47ec58d dist/tools/openocd: fix parsing of flash bank base

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

Artifacts

@aabadie
Copy link
Contributor

aabadie commented May 23, 2023

bors merge

bors bot added a commit that referenced this pull request May 23, 2023
19620: dist/tools/openocd: fix parsing of flash bank base r=aabadie a=maribu

### Contribution description

Since [80fc9fabc66a0bc767467fa14c703e5a9f340cd3] the format of the `flash list` command changed to a more human readable multi-line variant. Technically, the change is white-space only. Still, the current approach of parsing them with awk, sed and cut doesn't like the new multi-line format. The parsing is now delegated into a python script that is compatible across OpenOCD versions.

[80fc9fabc66a0bc767467fa14c703e5a9f340cd3]: openocd-org/openocd@80fc9fa


19636: sys: model ecc, evtimer, pipe and shell_lock in kconfig r=aabadie a=aabadie



19639: tests/net/gnrc_mac_timeout: add automated test r=aabadie a=aabadie



Co-authored-by: Marian Buschsieweke <[email protected]>
Co-authored-by: Alexandre Abadie <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 23, 2023

Build failed (retrying...):

@aabadie
Copy link
Contributor

aabadie commented May 23, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented May 23, 2023

Already running a review

@bors
Copy link
Contributor

bors bot commented May 23, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 7e75fdf into RIOT-OS:master May 23, 2023
@maribu maribu deleted the dist/tools/openocd branch May 24, 2023 19:08
@maribu
Copy link
Member Author

maribu commented May 24, 2023

Thx :)

@benpicco benpicco requested a review from fabian18 June 20, 2023 17:15
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Jun 20, 2023
fabian18 pushed a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Jun 26, 2023
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
fabian18 pushed a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Sep 17, 2023
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Nov 10, 2023
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Nov 29, 2023
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Dec 14, 2023
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Jan 3, 2024
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Jan 23, 2024
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Apr 5, 2024
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Jul 26, 2024
fabian18 pushed a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Sep 17, 2024
benpicco added a commit to ML-PA-Consulting-GmbH/RIOT that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants