-
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
makefiles/vars.inc.mk: introduce and use PROG_DEV
#12460
Conversation
@fjmolinas Cool. From the description I can see that this what I need. |
For some reason I can't get it to work with This is my command
|
I don't have the particular board to test but if I do:
I can see the right ports are being used. |
Could you post your exact output? |
This is because when the script tries to flash the running firmware is not the Arduino bootloader. You need a way to automatically switch to bootloader mode before calling the flasher. This is what is done in #12304. There's another manual solution: double tap the reset button while the script is building each application. |
Otherwise I'm +1 for the name |
I also really like this PR and it is on the list but it would take a while for me to test (both a while to find the time and the amount of time it would take for me to understand everything that needs to be tested). |
OK, good that you showed me how to run one particular test. I was running all tests until I hit the error. You have to be patient for that :-) I now see what I was doing wrong. I have several RIOT checkouts and I was executing the tests from my "main" checkout, not from the clone of your repo. Yes, it's working! Well, sort of. I'll try a few more tests and see why it didn't see all of the test output.
|
Running it a second time and it succeed. Hmm.
|
@aabadie can you comment briefly on the fact that tests are "not supported" anymore when combining #12304 with this PR?
|
This one needs a rebase. |
a9c4534
to
f8cceb4
Compare
Rebased. |
PROG_PORT
DEV_PROG
@fjmolinas What happened to the agreed |
Damn, I'm so sorry... I changed to the wrong name (somehow got confused when making the change). Sorry for the confusion, I'll fix tomorrow morning. |
DEV_PROG
PROG_DEV
@keestux I went ahead and fixed it right away, sorry for the inconvenience. |
PORT_LINUX ?= /dev/ttyUSB0 | ||
AVRDUDE_PORT ?= /dev/ttyACM0 | ||
PROG_DEV ?= /dev/ttyACM0 |
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.
Fix alignment here when squashing.
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.
Testing done on sodaq-autonomo. Doing manually board resets.
I ran a few tests, not all.
It looks good to me.
All failures are due to flashing or connection issues.
|
1f95e5b
to
4b46c27
Compare
I re-ran my test procedure after squash, no diff excpet in some
```
git checkout pr_port_migration
for board in arduino-leonardo mega-xplained waspmote-pro; do BOARD=${board} make --no-print-directory -C examples/hello-world/ info-debug-variable-BOARD info-debug-variable-PORT info-debug-variable-PROG_DEV; done > PORT_AVRDUDE-pr.txt
git checkout upstream/master
for board in arduino-leonardo mega-xplained waspmote-pro; do BOARD=${board} make --no-print-directory -C examples/hello-world/ info-debug-variable-BOARD info-debug-variable-PORT info-debug-variable-AVRDUDE_PORT; done > PORT_AVRDUDE-master.txt
git checkout pr_port_migration
diff PORT_AVRDUDE-pr.txt PORT_AVRDUDE-master.txt
for board in openmote-b firefly remote-pa remote-revb remote-reva; do BOARD=${board} make --no-print-directory -C examples/hello-world/ info-debug-variable-BOARD info-debug-variable-PORT info-debug-variable-PROG_DEV; done > PORT_BSL-pr.txt
git checkout upstream/master
for board in openmote-b firefly remote-pa remote-revb remote-reva; do BOARD=${board} make --no-print-directory -C examples/hello-world/ info-debug-variable-BOARD info-debug-variable-PORT info-debug-variable-PORT_BSL; done > PORT_BSL-master.txt
git checkout pr_port_migration
diff PORT_BSL-pr.txt PORT_BSL-master.txt
for board in
@aabadie can you re-check the commits messages? I changed them after squash. |
- Introduce new PROG_DEV variable to specify device PORT used by the PROGRAMMER or DEBUGGER.
- Move serial.inc.mk in mega-xplained/Makefile.include after PROG_DEV so PROG_DEV can still default to PORT - Add deprecation warning for arduino-leonardo and mega-xplained
- Move serial.inc.mk in remote and openmote-b Makefile.include before PROG_DEV to avoid repeating OS logic check - Add deprecation warning for PORT_BSL
4b46c27
to
1ae0873
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.
ACK
@aabadie @keestux Thanks for the review! @MrKevinWeiss thanks for testing! |
Nice job everyone! 🎉 |
Contribution description
In some cases the
PORT
used to program aBOARD
is not the same used to open a serialterminal
. This is already the case for boards usingPORT_BSL
andAVRDUDE_PORT
.There are also use cases when boards that use a
BSL
botloader might want to use anotherPORT
(threw a ftdi converter for examples). An examples of this are boards usingBOSA
(#12304) since the serial connection is lost if the the code halts or hardfaults, as well as during a reset command.#12419 also needs this definition since it was shown that the
PORT
(device) used for programming is rarely the same device used for serial output, so both need to be passed to the container.This PR introduces a new
PROG_PORT
PROG_DEV
and merges the definitions ofPORT_BSL
andAVRDUDE_PORT
to also usePROG_PORT
PROG_DEV
.By default it is it set so that
PROG_PORT
PROG_DEV ?= PORT
. A warning is added for boards using oldPROGRAMMER PORT
definitionsTesting procedure
BOARDS
usingAVRDUDE_PORT
:BOARDS
usingPORT_BSL
:PROG_PORT
PROG_DEV
as a name?Issues/PRs references
#12419