boards: set samd21-arduino-bootloader as DEFAULT_MODULE#13664
boards: set samd21-arduino-bootloader as DEFAULT_MODULE#13664aabadie merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
Note the usage matches the current definition of |
aabadie
left a comment
There was a problem hiding this comment.
Nice cleanup which makes sense. I'll test on feather-m0 later today.
30fc716 to
0b6907f
Compare
|
Unfortunately, this doesn't build: DetailsThe common samd21 arduino bootloader is not built. |
|
@aabadie added a fixup that should solve the issue. |
|
@fjmolinas, your last commit fixes the issue and looks good. Please squash! |
3a3571c to
2c00298
Compare
2c00298 to
8fa2017
Compare
8fa2017 to
4567395
Compare
|
I pushed a change disabling the arduino bootloader for riotboot and minimal. |
4567395 to
b9acff4
Compare
aabadie
left a comment
There was a problem hiding this comment.
All good, ACK!
Let's now wait for Murdock.
|
Ok, this needs a rebase now... |
b9acff4 to
fc232c3
Compare
|
Rebased! |
|
Murdock is still complaining. Any idea how to solve this @fjmolinas ? |
fc232c3 to
4761470
Compare
|
I pushed a fix that I think should fix the issue. |
Thanks but it still doesn't seems to work with Murdock. |
But a different failure! |
I have the impression this is an issue with |
4761470 to
32467db
Compare
|
@aabadie I changed the approach and removed the use of |
samd21-arduino-bootloader and its dependencies will only be included if no other stdio_% (other than stdio_cdc_acm) is included.
32467db to
1387b73
Compare
|
@aabadie murdock is failing on unrelated issues. But otherwise its now OK. Let me know if you Ok with the new approach. |
I'm OK with the new approach, it looks cleaner. |
aabadie
left a comment
There was a problem hiding this comment.
Changes make sense. I tested this PR on feather-m0 and it works as expected:
with the arduino bootloader
$ make BOARD=feather-m0 -C examples/hello-world/ flash term
make: Entering directory '/work/riot/RIOT-review/examples/hello-world'
Building application "hello-world" for "feather-m0" with MCU "samd21".
"make" -C /work/riot/RIOT-review/boards/feather-m0
"make" -C /work/riot/RIOT-review/boards/common/samd21-arduino-bootloader
"make" -C /work/riot/RIOT-review/core
"make" -C /work/riot/RIOT-review/cpu/samd21
"make" -C /work/riot/RIOT-review/cpu/cortexm_common
"make" -C /work/riot/RIOT-review/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT-review/cpu/sam0_common
"make" -C /work/riot/RIOT-review/cpu/sam0_common/periph
"make" -C /work/riot/RIOT-review/cpu/samd21/periph
"make" -C /work/riot/RIOT-review/drivers
"make" -C /work/riot/RIOT-review/drivers/periph_common
"make" -C /work/riot/RIOT-review/sys
"make" -C /work/riot/RIOT-review/sys/auto_init
"make" -C /work/riot/RIOT-review/sys/auto_init/usb
"make" -C /work/riot/RIOT-review/sys/event
"make" -C /work/riot/RIOT-review/sys/isrpipe
"make" -C /work/riot/RIOT-review/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT-review/sys/pm_layered
"make" -C /work/riot/RIOT-review/sys/tsrb
"make" -C /work/riot/RIOT-review/sys/usb/usbus
"make" -C /work/riot/RIOT-review/sys/usb/usbus/cdc/acm
"make" -C /work/riot/RIOT-review/sys/usb_board_reset
text data bss dec hex filename
15316 132 5868 21316 5344 /work/riot/RIOT-review/examples/hello-world/bin/feather-m0/hello-world.elf
stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
sleep 1
/work/riot/RIOT-review/dist/tools/bossa-1.9/bossac -p /dev/ttyACM0 -o 0x2000 -e -i -w -v -b -R /work/riot/RIOT-review/examples/hello-world/bin/feather-m0/hello-world.bin
Device : ATSAMD21x18
Version : v2.0 [Arduino:XYZ] Mar 5 2016 17:46:52
Address : 0x0
Pages : 4096
Page Size : 64 bytes
Total Size : 256KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
BOD : true
BOR : true
Erase flash
Done in 0.809 seconds
Write 15448 bytes to flash (242 pages)
[==============================] 100% (242/242 pages)
Done in 0.089 seconds
Verify 15448 bytes of flash
[==============================] 100% (242/242 pages)
Verify successful
Done in 0.149 seconds
Set boot flash true
sleep 2
/work/riot/RIOT-review/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"
2020-04-01 21:38:34,445 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2020-04-01 21:38:35,449 # 387b-review_samd21_bootloader)
2020-04-01 21:38:35,450 # Hello World!
2020-04-01 21:38:35,452 # You are running RIOT on a(n) feather-m0 board.
2020-04-01 21:38:35,453 # This board features a(n) samd21 MCU.
2020-04-01 21:38:36,353 # Exiting Pyterm
without the arduino bootloader
$ USEMODULE=stdio_null make BOARD=feather-m0 -C examples/hello-world/ flash term
make: Entering directory '/work/riot/RIOT-review/examples/hello-world'
Building application "hello-world" for "feather-m0" with MCU "samd21".
"make" -C /work/riot/RIOT-review/boards/feather-m0
"make" -C /work/riot/RIOT-review/core
"make" -C /work/riot/RIOT-review/cpu/samd21
"make" -C /work/riot/RIOT-review/cpu/cortexm_common
"make" -C /work/riot/RIOT-review/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT-review/cpu/sam0_common
"make" -C /work/riot/RIOT-review/cpu/sam0_common/periph
"make" -C /work/riot/RIOT-review/cpu/samd21/periph
"make" -C /work/riot/RIOT-review/drivers
"make" -C /work/riot/RIOT-review/drivers/periph_common
"make" -C /work/riot/RIOT-review/sys
"make" -C /work/riot/RIOT-review/sys/auto_init
"make" -C /work/riot/RIOT-review/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT-review/sys/pm_layered
"make" -C /work/riot/RIOT-review/sys/stdio_null
text data bss dec hex filename
7756 112 2544 10412 28ac /work/riot/RIOT-review/examples/hello-world/bin/feather-m0/hello-world.elf
stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
sleep 1
/work/riot/RIOT-review/dist/tools/bossa-1.9/bossac -p /dev/ttyACM0 -o 0x2000 -e -i -w -v -b -R /work/riot/RIOT-review/examples/hello-world/bin/feather-m0/hello-world.bin
Device : ATSAMD21x18
Version : v2.0 [Arduino:XYZ] Mar 5 2016 17:46:52
Address : 0x0
Pages : 4096
Page Size : 64 bytes
Total Size : 256KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
BOD : true
BOR : true
Erase flash
Done in 0.809 seconds
Write 7868 bytes to flash (123 pages)
[==============================] 100% (123/123 pages)
Done in 0.045 seconds
Verify 7868 bytes of flash
[==============================] 100% (123/123 pages)
Verify successful
Done in 0.092 seconds
Set boot flash true
sleep 2
/work/riot/RIOT-review/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"
2020-04-01 21:39:02,399 # Connect to serial port /dev/ttyACM0
2020-04-01 21:39:02,399 # could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
In this case, the board cannot be reflashed automatically anymore. So one has to trigger the bootloader mode manually by double tapping the reset button.
ACK and go!
Contribution description
This PR proposes using
DEFAULT_MODULEfor thesamd-arduino-bootloader. Since in #12304 it was stated that thisMODULEwas desired as theDEFAULTit will not be disabled automatically if anotherstdio_%is requested.This could be done by moving the inclusion of dependencies to
stdio.in.mkBut this would change the current behavior.
It selects
stdio_cdc_acmas aUSEMODULEand not aDEFAULT_MODULEto make more explicit that id usingarduino-bootloaderdisablingstdio_cdc_acmis simply not possible. So is forcing usage of twostdio_%module you would simply get an error.Testing procedure
BOARD=arduino-mkrfox1200 make -C tests/xtimer_usleep flash
stdio_%, arduino bootloader needs to be disabledUSEMODULE+=stdio_rtt BOARD=arduino-mkrfox1200 make -C tests/xtimer_usleep FAILS
DISABLE_MODULE=boards_common_samd21-arduino-bootloader USEMODULE+=stdio_rtt BOARD=arduino-mkrfox1200 make -C tests/xtimer_usleepOK
DISABLE_MODULE=boards_common_samd21-arduino-bootloader BOARD=arduino-mkrfox1200 make -C tests/xtimer_usleep info-modules --no-print-directory
Issues/PRs references
Documentation on
DEFAULT_MODULEuse #13651Extends on #12304
See #13650 (review) and #13650 (comment).