Skip to content

makefiles/sam0: only fail on missing device with explicit targets#14431

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/makefile/sam0_serial_no_flash
Jul 3, 2020
Merged

makefiles/sam0: only fail on missing device with explicit targets#14431
aabadie merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/makefile/sam0_serial_no_flash

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Jul 3, 2020

Contribution description

This PR fixes #10367 by simply using make code to only auto compute SERIAL_TTY when an explicit make target is given (term, flash, etc). For a bare make command, this is skipped so there's no more unrelated failure.

Testing procedure

this PR:
$ make -C examples/hello-world BOARD=samr21-xpro SERIAL=ATML211234567
make: Entering directory '/work/riot/RIOT/examples/hello-world'
Building application "hello-world" for "samr21-xpro" with MCU "samd21".

"make" -C /work/riot/RIOT/boards/samr21-xpro
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/samd21
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/sam0_common
"make" -C /work/riot/RIOT/cpu/sam0_common/periph
"make" -C /work/riot/RIOT/cpu/samd21/periph
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/pm_layered
"make" -C /work/riot/RIOT/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8756	    112	   2560	  11428	   2ca4	/work/riot/RIOT/examples/hello-world/bin/samr21-xpro/hello-world.elf
make: Leaving directory '/work/riot/RIOT/examples/hello-world'
master:
$ make -C examples/hello-world BOARD=samr21-xpro SERIAL=ATML211234567
make: Entering directory '/work/riot/RIOT/examples/hello-world'
/work/riot/RIOT/makefiles/boards/sam0.inc.mk:13: *** Did not find a device with serial ATML211234567.  Stop.
make: Leaving directory '/work/riot/RIOT/examples/hello-world'
  • Automatic detection of serial tty still works when only giving the SERIAL variable (output below is given with another board connected on /dev/ttyACM0):
Details
$ make -C examples/hello-world BOARD=samr21-xpro SERIAL=ATML2127031800009840 flash term
make: Entering directory '/work/riot/RIOT/examples/hello-world'
Building application "hello-world" for "samr21-xpro" with MCU "samd21".

"make" -C /work/riot/RIOT/boards/samr21-xpro
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/samd21
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/sam0_common
"make" -C /work/riot/RIOT/cpu/sam0_common/periph
"make" -C /work/riot/RIOT/cpu/samd21/periph
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/pm_layered
"make" -C /work/riot/RIOT/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8756	    112	   2560	  11428	   2ca4	/work/riot/RIOT/examples/hello-world/bin/samr21-xpro/hello-world.elf
/work/riot/RIOT/dist/tools/edbg/edbg --serial ATML2127031800009840 --serial ATML2127031800009840  --target samr21 --verbose --file /work/riot/RIOT/examples/hello-world/bin/samr21-xpro/hello-world.bin --verify || /work/riot/RIOT/dist/tools/edbg/edbg --serial ATML2127031800009840 --serial ATML2127031800009840  --target samr21 --verbose --file /work/riot/RIOT/examples/hello-world/bin/samr21-xpro/hello-world.bin --verify --program
Debugger: ATMEL EDBG CMSIS-DAP ATML2127031800009840 01.1A.00FB (S)
Clock frequency: 16.0 MHz
Target: SAM R21G18 (Rev C)
Verification.......
at address 0x474 expected 0x34, read 0x30
Error: verification failed
Debugger: ATMEL EDBG CMSIS-DAP ATML2127031800009840 01.1A.00FB (S)
Clock frequency: 16.0 MHz
Target: SAM R21G18 (Rev C)
Programming...................................... done.
Verification...................................... done.
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200" 
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-07-03 09:14:30,232 # Connect to serial port /dev/ttyACM1
Welcome to pyterm!
Type '/exit' to exit.
2020-07-03 09:14:33,200 # main(): This is RIOT! (Version: 2020.07-devel-1737-g5d01e-pr/makefile/sam0_serial_no_flash)
2020-07-03 09:14:33,201 # Hello World!
2020-07-03 09:14:33,205 # You are running RIOT on a(n) samr21-xpro board.
2020-07-03 09:14:33,208 # This board features a(n) samd21 MCU.
2020-07-03 09:14:36,400 # Exiting Pyterm
make: Leaving directory '/work/riot/RIOT/examples/hello-world'

Issues/PRs references

fixes #10367

@aabadie aabadie added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 3, 2020
@aabadie aabadie requested a review from fjmolinas July 3, 2020 07:16
Copy link
Copy Markdown
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

Looks good, please squash:

make -C examples/hello-world BOARD=samr21-xpro SERIAL=ATML211234567 debug --no-print-directory
/home/francisco/workspace/RIOT2/makefiles/boards/sam0.inc.mk:14: *** Did not find a device with serial ATML211234567.  Stop.
make -C examples/hello-world BOARD=samr21-xpro SERIAL=ATML211234567 term --no-print-directory
/home/francisco/workspace/RIOT2/makefiles/boards/sam0.inc.mk:14: *** Did not find a device with serial ATML211234567.  Stop.
make -C examples/hello-world BOARD=samr21-xpro SERIAL=ATML211234567 all --no-print-directory
Building application "hello-world" for "samr21-xpro" with MCU "samd21".

"make" -C /home/francisco/workspace/RIOT2/boards/samr21-xpro
"make" -C /home/francisco/workspace/RIOT2/core

@aabadie aabadie force-pushed the pr/makefile/sam0_serial_no_flash branch from 80f5d18 to c7189cf Compare July 3, 2020 08:24
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jul 3, 2020

Squashed!

@aabadie aabadie merged commit 774e2bb into RIOT-OS:master Jul 3, 2020
@aabadie aabadie deleted the pr/makefile/sam0_serial_no_flash branch July 3, 2020 09:42
@miri64 miri64 added this to the Release 2020.07 milestone Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

sam0.inc.mk: Did not find a device with serial ATML21xxxxxxxx

3 participants