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: update EDBG version #9502

Merged
merged 2 commits into from
Jul 12, 2018
Merged

dist/tools: update EDBG version #9502

merged 2 commits into from
Jul 12, 2018

Conversation

dylad
Copy link
Member

@dylad dylad commented Jul 5, 2018

Contribution description

This PR updates EDBG version of RIOT to the lastest.
I had a lot of troubles when playing with low power modes or DPLL/DFLL on SAM0 based board. Most of the time, the board was stuck in a unrecoverable state for EDBG and I had to erase the flash using Atmel Studio (switch back to windows to unbrick the board...)
The lastest version of EDBG get rid of this problem as I can now erase/reflash the board in all situations. No need to use Atmel Studio anymore to unbrick a board !

Issues/PRs references

None

@dylad dylad added 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 labels Jul 5, 2018
@cladmi cladmi added CI: run tests If set, CI server will run tests on hardware for the labeled PR CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 5, 2018
@cladmi
Copy link
Contributor

cladmi commented Jul 5, 2018

Let's see if murdock can handle it already.

@dylad
Copy link
Member Author

dylad commented Jul 5, 2018

@cladmi Looks like Murdock is happy :)

@cladmi
Copy link
Contributor

cladmi commented Jul 10, 2018

It looks like murdock does not use the compiled edbg and uses a local installation:

make: Entering directory '/tmp/dwq.0.3981599149433197/4ceadfbccb6700af35ecc065b126a1aa/tests/gnrc_ndp'

/usr/local/bin/edbg --serial ATML2127031800002130 --serial ATML2127031800002130 -t atmel_cm0p -b -e -v -p -f /tmp/dwq.0.3981599149433197/4ceadfbccb6700af35ecc065b126a1aa/tests/gnrc_ndp/bin/samr21-xpro/tests_gnrc_ndp.bin
Debugger: ATMEL EDBG CMSIS-DAP ATML2127031800002130 01.1A.00FB (S)
...

For testing the new version I needed to make edbg rebuild by removing it from dist/tools/edbg.

The correct solution to correctly rebuild edbg is to add the Makefile dependency:
(it should even be there for all tools).

diff --git a/makefiles/tools/targets.inc.mk b/makefiles/tools/targets.inc.mk
index 352f146..74f1de6 100644
--- a/makefiles/tools/targets.inc.mk
+++ b/makefiles/tools/targets.inc.mk
@@ -12,7 +12,7 @@ $(RIOTTOOLS)/bossa/bossac:
        @make -C $(RIOTTOOLS)/bossa
        @echo "[INFO] bossac binary successfully build!"
 
-$(RIOTTOOLS)/edbg/edbg:
+$(RIOTTOOLS)/edbg/edbg: $(RIOTTOOLS)/edbg/Makefile
        @echo "[INFO] edbg binary not found - building it from source now"
        CC= CFLAGS= make -C $(RIOTTOOLS)/edbg
        @echo "[INFO] edbg binary successfully build!"

With this change, when flashing from your PR edbg is correctly rebuild and flashes.
You could add it in a separate commit.

Propagating to other tools should be done in another PR.

@dylad
Copy link
Member Author

dylad commented Jul 10, 2018

Thanks @cladmi, I'll update it soon.

@cladmi
Copy link
Contributor

cladmi commented Jul 10, 2018

@dylad I would prefer if you could add the explanation of why you need the update in the commit message body.

I was thinking about adding the new version number/changelog too but it looks like there is nothing like this in the edbg repository :D

@cladmi cladmi added this to the Release 2018.07 milestone Jul 10, 2018
@dylad
Copy link
Member Author

dylad commented Jul 10, 2018

@cladmi I'll edit the first commit msg too then.

dylad added 2 commits July 10, 2018 15:10
update to the current lastest version of EDBG to allow user to reflash a bricked board due to sleep mode or wrong clock assignment. this avoid the use of Atmel Studio to erase flash.
@dylad
Copy link
Member Author

dylad commented Jul 10, 2018

@cladmi do you like the changes ?

@cladmi
Copy link
Contributor

cladmi commented Jul 10, 2018

It's good for me on ubuntu 16.04. I tested with:

git checkout master; rm -f dist/tools/edbg/edbg; make -C examples/hello-world/ BOARD=samr21-xpro flash

Then go the PR and try flashing again, edbg is correctly rebuild before flashing.

git checkout pr/9502/update_EDBG_version ; make -C examples/hello-world/ BOARD=samr21-xpro flash
# edbg is rebuild

After testing you may need to redo rm -f dist/tools/edbg/edbg before switching back to master to remove the "new" version until this is merged.

I would just like to get it tested on other setups too:

@bergzand
Copy link
Member

Confirmed that EDBG is rebuild on my setup after switching from master to this branch.

@kaspar030
Copy link
Contributor

you could add a temporary commit that disables EDBG override from local version (I think thats in makefiles/tools/edbg.inc.mk), set the run-tests-on-ci label, then trigger murdock. that should make the samr21-xpro raspis re-build edbg from the updated source and use it to flash the tests.

@cladmi
Copy link
Contributor

cladmi commented Jul 11, 2018

I pushed a commit that should do it.

@kaspar030
Copy link
Contributor

It seems to fail because there's no libudev on the worker. I'll install that manually...

@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 11, 2018
@kaspar030
Copy link
Contributor

Did so, an I'm watching the worker, the flashing works from the in-tree compiled version.

@cladmi
Copy link
Contributor

cladmi commented Jul 11, 2018

@kaspar030 Thanks for testing this

@cladmi
Copy link
Contributor

cladmi commented Jul 11, 2018

@kYc0o does it work on mac ?

@cladmi
Copy link
Contributor

cladmi commented Jul 12, 2018

Maybe @smling you can test: #9502 (comment)

Copy link
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

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

Tested (OS X and Linux) ACK.

However, it might need the removal of the last commit + squash.

@cladmi
Copy link
Contributor

cladmi commented Jul 12, 2018

Please remove my two last commits (I don't want to push force to your branch).

@dylad
Copy link
Member Author

dylad commented Jul 12, 2018

@cladmi Sorry for the delay, this is done.

@cladmi cladmi removed the CI: run tests If set, CI server will run tests on hardware for the labeled PR label Jul 12, 2018
@cladmi
Copy link
Contributor

cladmi commented Jul 12, 2018

20 minutes after my message is not "delay" :p

Murdock is failing on the same shell tests as it often does. I removed CI: run tests and you can merge when it's done if I forget to.

@dylad dylad added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 12, 2018
@cladmi cladmi merged commit 3cb57b6 into RIOT-OS:master Jul 12, 2018
@dylad dylad deleted the pr/update_edbg branch July 15, 2018 09:17
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.

5 participants