all: add a flag to the command line to select the serial implementation

This can be very useful for some purposes:

  * It makes it possible to disable the UART in cases where it is not
    needed or needs to be disabled to conserve power.
  * It makes it possible to disable the serial output to reduce code
    size, which may be important for some chips. Sometimes, a few kB can
    be saved this way.
  * It makes it possible to override the default, for example you might
    want to use an actual UART to debug the USB-CDC implementation.

It also lowers the dependency on having machine.Serial defined, which is
often not defined when targeting a chip. Eventually, we might want to
make it possible to write `-target=nrf52` or `-target=atmega328p` for
example to target the chip itself with no board specific assumptions.

The defaults don't change. I checked this by running `make smoketest`
before and after and comparing the results.
This commit is contained in:
Ayke van Laethem
2021-06-01 13:27:58 +02:00
committed by Ron Evans
parent 75298bb84b
commit 96e863f0f3
114 changed files with 185 additions and 104 deletions
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd21g18a"],
"build-tags": ["arduino_mkr1000"],
"serial": "usb",
"flash-command": "bossac -i -e -w -v -R -U --port={port} --offset=0x2000 {bin}",
"flash-1200-bps-reset": "true"
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd21g18a"],
"build-tags": ["arduino_zero"],
"serial": "usb",
"flash-command": "bossac -i -e -w -v -R -U --port={port} --offset=0x2000 {bin}",
"flash-1200-bps-reset": "true"
}
+1
View File
@@ -2,6 +2,7 @@
"inherits": ["avr"],
"cpu": "atmega1280",
"build-tags": ["atmega1280", "atmega"],
"serial": "uart",
"cflags": [
"-mmcu=atmega1280"
],
+1
View File
@@ -2,6 +2,7 @@
"inherits": ["avr"],
"cpu": "atmega1284p",
"build-tags": ["atmega1284p", "atmega"],
"serial": "uart",
"cflags": [
"-mmcu=atmega1284p"
],
+1
View File
@@ -2,6 +2,7 @@
"inherits": ["avr"],
"cpu": "atmega2560",
"build-tags": ["atmega2560", "atmega"],
"serial": "uart",
"cflags": [
"-mmcu=atmega2560"
],
+1
View File
@@ -2,6 +2,7 @@
"inherits": ["avr"],
"cpu": "atmega328p",
"build-tags": ["atmega328p", "atmega", "avr5"],
"serial": "uart",
"cflags": [
"-mmcu=atmega328p"
],
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m0plus"],
"build-tags": ["atsamd21e18a", "atsamd21e18", "atsamd21", "sam"],
"serial": "usb",
"linkerscript": "targets/atsamd21.ld",
"extra-files": [
"src/device/sam/atsamd21e18a.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m0plus"],
"build-tags": ["atsamd21g18a", "atsamd21g18", "atsamd21", "sam"],
"serial": "usb",
"linkerscript": "targets/atsamd21.ld",
"extra-files": [
"src/device/sam/atsamd21g18a.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsame54p20a"],
"build-tags": ["atsame54_xpro"],
"serial": "usb",
"flash-method": "openocd",
"openocd-interface": "cmsis-dap",
"default-stack-size": 4096
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m3"],
"build-tags": ["bluepill", "stm32f103", "stm32f1", "stm32"],
"serial": "uart",
"linkerscript": "targets/stm32.ld",
"extra-files": [
"src/device/stm32/stm32f103.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["circuitplay_bluefruit","nrf52840_reset_uf2", "softdevice", "s140v6"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"serial-port": ["acm:239a:8045", "acm:239a:45"],
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["clue_alpha","nrf52840_reset_uf2", "softdevice", "s140v6"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "CLUEBOOT",
+1
View File
@@ -3,6 +3,7 @@
"cpu": "esp32",
"build-tags": ["esp32", "esp"],
"scheduler": "tasks",
"serial": "uart",
"linker": "xtensa-esp32-elf-ld",
"default-stack-size": 2048,
"cflags": [
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsame51j19a"],
"build-tags": ["feather_m4_can"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "FTHRCANBOOT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51j19a"],
"build-tags": ["feather_m4"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "FEATHERBOOT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["feather_nrf52840","nrf52840_reset_uf2", "softdevice", "s140v6"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "FTHR840BOOT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m4"],
"build-tags": ["feather_stm32f405", "stm32f405", "stm32f4", "stm32"],
"serial": "uart",
"automatic-stack-size": false,
"linkerscript": "targets/stm32f405.ld",
"extra-files": [
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51p20a"],
"build-tags": ["grandcentral_m4"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "GCM4BOOT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["fe310"],
"build-tags": ["hifive1b", "qemu"],
"serial": "uart",
"linkerscript": "targets/hifive1-qemu.ld",
"emulator": ["qemu-system-riscv32", "-machine", "sifive_e", "-nographic", "-kernel"]
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["fe310"],
"build-tags": ["hifive1b"],
"serial": "uart",
"linkerscript": "targets/hifive1b.ld",
"flash-method": "msd",
"msd-volume-name": "HiFive",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51g19a"],
"build-tags": ["itsybitsy_m4"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"serial-port": ["acm:239a:802b", "acm:239a:002b"],
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["itsybitsy_nrf52840","nrf52840_reset_uf2", "softdevice", "s140v6"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "ITSY840BOOT",
+1
View File
@@ -5,6 +5,7 @@
"build-tags": [
"lgt92"
],
"serial": "uart",
"linkerscript": "targets/stm32l072czt6.ld",
"flash-method": "openocd",
"openocd-interface": "stlink-v2",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["k210"],
"build-tags": ["maixbit"],
"serial": "uart",
"linkerscript": "targets/maixbit.ld",
"flash-command": "kflash -p {port} --noansi --verbose {bin}"
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51j19a"],
"build-tags": ["metro_m4_airlift"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "METROM4BOOT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52833"],
"build-tags": ["microbit_v2"],
"serial": "uart",
"flash-method": "msd",
"openocd-interface": "cmsis-dap",
"msd-volume-name": "MICROBIT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf51"],
"build-tags": ["microbit"],
"serial": "uart",
"flash-method": "msd",
"openocd-interface": "cmsis-dap",
"msd-volume-name": "MICROBIT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["nicenano","nrf52840_reset_uf2", "softdevice", "s140v6"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "NICENANO",
+2 -1
View File
@@ -1,4 +1,5 @@
{
"inherits": ["esp8266"],
"build-tags": ["nodemcu"]
"build-tags": ["nodemcu"],
"serial": "uart"
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["nrf52840_mdk_usb_dongle", "nrf52840_reset_uf2", "softdevice", "s140v6"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "MDK-DONGLE",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["nrf52840_mdk"],
"serial": "usb",
"flash-method": "openocd",
"openocd-interface": "cmsis-dap"
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m3"],
"build-tags": ["nucleof103rb", "stm32f103", "stm32f1","stm32"],
"serial": "uart",
"linkerscript": "targets/stm32f103rb.ld",
"extra-files": [
"src/device/stm32/stm32f103.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m7"],
"build-tags": ["nucleof722ze", "stm32f7x2", "stm32f7", "stm32"],
"serial": "uart",
"linkerscript": "targets/stm32f7x2zetx.ld",
"extra-files": [
"src/device/stm32/stm32f7x2.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m0"],
"build-tags": ["nucleol031k6", "stm32l031", "stm32l0x1", "stm32l0", "stm32"],
"serial": "uart",
"linkerscript": "targets/stm32l031k6.ld",
"extra-files": [
"src/device/stm32/stm32l0x1.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m4"],
"build-tags": ["nucleol432kc", "stm32l432", "stm32l4x2", "stm32l4", "stm32"],
"serial": "uart",
"linkerscript": "targets/stm32l4x2.ld",
"extra-files": [
"src/device/stm32/stm32l4x2.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m33"],
"build-tags": ["nucleol552ze", "stm32l552", "stm32l5x2", "stm32l5", "stm32"],
"serial": "uart",
"linkerscript": "targets/stm32l5x2xe.ld",
"extra-files": [
"src/device/stm32/stm32l552.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["particle_3rd_gen"],
"serial": "uart",
"flash-method": "openocd",
"openocd-interface": "cmsis-dap"
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf51"],
"build-tags": ["pca10031"],
"serial": "uart",
"flash-command": "nrfjprog -f nrf51 --sectorerase --program {hex} --reset",
"openocd-interface": "cmsis-dap"
}
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52"],
"build-tags": ["pca10040"],
"serial": "uart",
"flash-method": "openocd",
"flash-command": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
"openocd-interface": "jlink",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["pca10056"],
"serial": "uart",
"flash-method": "command",
"flash-command": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
"msd-volume-name": "JLINK",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["pca10059"],
"serial": "usb",
"linkerscript": "targets/pca10059.ld",
"binary-format": "nrf-dfu",
"flash-command": "nrfutil dfu usb-serial -pkg {zip} -p {port} -b 115200"
+1
View File
@@ -3,6 +3,7 @@
"rp2040"
],
"build-tags": ["pico"],
"serial": "uart",
"linkerscript": "targets/pico.ld",
"extra-files": [
"targets/pico-boot-stage2.S"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52"],
"build-tags": ["pinetime_devkit0"],
"serial": "uart",
"flash-method": "openocd",
"flash-command": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
"openocd-interface": "jlink",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51j19a"],
"build-tags": ["pybadge"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"serial-port": ["acm:239a:8033", "acm:239a:33"],
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51j19a"],
"build-tags": ["pygamer"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "PYGAMERBOOT",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51j20a"],
"build-tags": ["pyportal"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"serial-port": ["acm:239a:8035", "acm:239a:35", "acm:239a:8036"],
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52840"],
"build-tags": ["reelboard"],
"serial": "uart",
"flash-method": "msd",
"msd-volume-name": "reel-board",
"msd-firmware-name": "firmware.hex",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m4"],
"build-tags": ["stm32f4disco", "stm32f407", "stm32f4", "stm32"],
"serial": "uart",
"linkerscript": "targets/stm32f407.ld",
"extra-files": [
"src/device/stm32/stm32f407.s"
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m4"],
"build-tags": ["teensy36", "teensy", "mk66f18", "nxp"],
"serial": "uart",
"linkerscript": "targets/nxpmk66f18.ld",
"extra-files": [
"src/device/nxp/mk66f18.s",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["cortex-m7"],
"build-tags": ["teensy40", "teensy", "mimxrt1062", "nxp"],
"serial": "uart",
"automatic-stack-size": false,
"default-stack-size": 4096,
"linkerscript": "targets/mimxrt1062-teensy40.ld",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["atsamd51p19a"],
"build-tags": ["wioterminal"],
"serial": "usb",
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "Arduino",
+1
View File
@@ -1,6 +1,7 @@
{
"inherits": ["nrf52"],
"build-tags": ["x9pro"],
"serial": "uart",
"flash-method": "openocd",
"flash-command": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
"openocd-interface": "jlink",