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

tools/edbg: Use openocd to reset instead of edbg. #11125

Closed
wants to merge 1 commit into from

Conversation

jcarrano
Copy link
Contributor

@jcarrano jcarrano commented Mar 7, 2019

Contribution description

A few commits ago edbg changed its behaviour and now it resets the board twice. This makes some tests fail, as the start on the first reset, but shortly after the board is reset again.

I already reported upstream (ataradov/edbg#77) but in the meanwhile we need a workaround.

This comments out RESET and RESET_FLAGS in the edbg tool setting. Reset will now be done via OpenOCD, which is available and used anyways because it is needed for make debug.

Testing procedure

Before trying this out, verify that edbg is on the latest version:

$ cd <RIOT REPO>
$ rm -rf dist/tools/edbg/edbg dist/tools/edbg/bin
$ make -C examples/hello-world $(pwd)/dist/tools/edbg/edbg

Compile and flash hello-world in any atmel board:

BOARD=saml21-xpro make -C examples/hello-world  all flash term

Open another terminal and reset the board:

BOARD=saml21-xpro make -C examples/hello-world  reset

Without this change: two resets

Welcome to pyterm!
Type '/exit' to exit.
2019-03-07 12:56:34,816 - INFO # main(): This is RIOT! (Version: 2019.04-devel-365-gda2f47-HEAD)
2019-03-07 12:56:34,817 - INFO # Hello World!
2019-03-07 12:56:34,822 - INFO # You are running RIOT on a(n) saml21-xpro board.
2019-03-07 12:56:34,838 - INFO # main(): This is RIOT! (Version: 2019.04-devel-365-gda2f47-HEAD)
2019-03-07 12:56:34,839 - INFO # Hello World!
2019-03-07 12:56:34,843 - INFO # You are running RIOT on a(n) saml21-xpro board.
2019-03-07 12:56:34,847 - INFO # This board features a(n) saml21 MCU.

With this change: only one reset (there's no point on pasting the output.)

Issues/PRs references

Issue in edbg: ataradov/edbg#77

A few commits ago edbg changed its behavior and now it resets the board
twice. This makes some tests fail, as the start on the first reset, but
shortly after the board is reset again.

See: ataradov/edbg#77

This comments out RESET and RESET_FLAGS in the edbg tool setting. Reset
will now be done via OpenOCD, which is available and used anyways because
it is needed for `make debug`.
@jcarrano jcarrano added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: tools Area: Supplementary tools labels Mar 7, 2019
@kaspar030
Copy link
Contributor

A few commits ago edbg changed its behaviour and now it resets the board twice.

This sucks. Does it affect the in-tree edbg version? If not, let's wait whether they fix it.

As is this PR will probably break the CI samr21-xpro workers, as they don't have openocd installer.

@jcarrano
Copy link
Contributor Author

jcarrano commented Mar 7, 2019

Does it affect the in-tree edbg version?

Yes, but you may or may not have that version: because of the way "pkg.mk" works it will not update the repo after it is downloaded, even if PKG_VERSION changes. I have two git worktrees in my machine, and one had an old EDBG version and the other the "correct" one.

I'm trying to fix pkg.mk.

@dylad
Copy link
Member

dylad commented Mar 7, 2019

If not, let's wait whether they fix it.

Usually, edbg's author is quick to react so this PR may not be needed since you reported it upstream.
I also need an edbg version bump for RIOT (need MCU port) this comes at the perfect time :)

@jcarrano
Copy link
Contributor Author

@dylad Yes, he's fast: fixed it on Friday. Are you going to do the bump PR or shall I do it?

@dylad
Copy link
Member

dylad commented Mar 11, 2019

@jcarrano as you want. I'm a bit busy today and tommorow but I can do it on wednesday

jcarrano added a commit to jcarrano/RIOT that referenced this pull request Mar 11, 2019
The lastest version of edbg solves a double-reset issue that was
hindering testing (see RIOT-OS#11125 and ataradov/edbg#77)

It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
jcarrano added a commit to jcarrano/RIOT that referenced this pull request Mar 12, 2019
The lastest version of edbg solves a double-reset issue that was
hindering testing (see RIOT-OS#11125 and ataradov/edbg#77)

It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
jcarrano added a commit to jcarrano/RIOT that referenced this pull request Mar 13, 2019
The lastest version of edbg solves a double-reset issue that was
hindering testing (see RIOT-OS#11125 and ataradov/edbg#77)

It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
@dylad dylad closed this in #11156 Mar 19, 2019
aabadie pushed a commit to aabadie/RIOT that referenced this pull request Mar 26, 2019
The lastest version of edbg solves a double-reset issue that was
hindering testing (see RIOT-OS#11125 and ataradov/edbg#77)

It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
aabadie pushed a commit to aabadie/RIOT that referenced this pull request Mar 28, 2019
The lastest version of edbg solves a double-reset issue that was
hindering testing (see RIOT-OS#11125 and ataradov/edbg#77)

It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
geromueller pushed a commit to geromueller/RIOT that referenced this pull request Jun 19, 2019
The lastest version of edbg solves a double-reset issue that was
hindering testing (see RIOT-OS#11125 and ataradov/edbg#77)

It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools Platform: ARM Platform: This PR/issue effects ARM-based platforms 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.

None yet

3 participants