From 4e8a83da508f9c6d920a987e71f73653d3fc0bef Mon Sep 17 00:00:00 2001 From: Nicolas Stalder Date: Fri, 26 Feb 2021 17:03:41 +0100 Subject: [PATCH] Move around platform/runner/board, lowering nesting complexity --- Makefile | 3 +- README.md | 5 ++-- .../runner => runners/lpc55}/.cargo/config | 0 .../lpc55/runner => runners/lpc55}/.gitignore | 0 .../lpc55/runner => runners/lpc55}/Cargo.toml | 28 +++++++++---------- .../lpc55/runner => runners/lpc55}/Makefile | 0 .../lpc55/runner => runners/lpc55}/bacon.toml | 0 .../lpc55/board/.cargo/config | 0 {platforms => runners}/lpc55/board/Cargo.toml | 0 {platforms => runners}/lpc55/board/README.md | 0 .../lpc55/board/src/clock_controller.rs | 0 {platforms => runners}/lpc55/board/src/lib.rs | 0 .../lpc55/board/src/lpcxpresso55.rs | 0 .../lpc55/board/src/lpcxpresso55/.gitignore | 0 .../lpc55/board/src/lpcxpresso55/button.rs | 0 .../lpc55/board/src/lpcxpresso55/led.rs | 0 {platforms => runners}/lpc55/board/src/nfc.rs | 0 .../lpc55/board/src/solov2.rs | 0 .../lpc55/board/src/solov2/.gitignore | 0 .../lpc55/board/src/solov2/button.rs | 0 .../lpc55/board/src/solov2/led.rs | 0 .../lpc55/board/src/traits.rs | 0 .../lpc55/board/src/traits/buttons.rs | 0 .../lpc55/board/src/traits/rgb_led.rs | 0 .../lpc55/board/src/traits/timer.rs | 0 .../lpc55/board/src/trussed.rs | 0 .../lpc55/runner => runners/lpc55}/build.rs | 0 .../lpc55/runner => runners/lpc55}/jlink.gdb | 0 .../lpc55/runner => runners/lpc55}/pyocd.gdb | 0 .../lpc55/runner => runners/lpc55}/pyocd.yaml | 0 .../lpc55/runner => runners/lpc55}/src/lib.rs | 0 .../runner => runners/lpc55}/src/main.rs | 0 .../runner => runners/lpc55}/src/types.rs | 0 .../runner => runners/lpc55}/src/types/usb.rs | 0 .../runner => runners/lpc55}/tail-serial.py | 0 {platforms => runners}/pc/.cargo/config | 0 {platforms => runners}/pc/Cargo.toml | 0 {platforms => runners}/pc/src/app_pc.rs | 0 {platforms => runners}/pc/src/lib.rs | 0 39 files changed, 19 insertions(+), 17 deletions(-) rename {platforms/lpc55/runner => runners/lpc55}/.cargo/config (100%) rename {platforms/lpc55/runner => runners/lpc55}/.gitignore (100%) rename {platforms/lpc55/runner => runners/lpc55}/Cargo.toml (69%) rename {platforms/lpc55/runner => runners/lpc55}/Makefile (100%) rename {platforms/lpc55/runner => runners/lpc55}/bacon.toml (100%) rename {platforms => runners}/lpc55/board/.cargo/config (100%) rename {platforms => runners}/lpc55/board/Cargo.toml (100%) rename {platforms => runners}/lpc55/board/README.md (100%) rename {platforms => runners}/lpc55/board/src/clock_controller.rs (100%) rename {platforms => runners}/lpc55/board/src/lib.rs (100%) rename {platforms => runners}/lpc55/board/src/lpcxpresso55.rs (100%) rename {platforms => runners}/lpc55/board/src/lpcxpresso55/.gitignore (100%) rename {platforms => runners}/lpc55/board/src/lpcxpresso55/button.rs (100%) rename {platforms => runners}/lpc55/board/src/lpcxpresso55/led.rs (100%) rename {platforms => runners}/lpc55/board/src/nfc.rs (100%) rename {platforms => runners}/lpc55/board/src/solov2.rs (100%) rename {platforms => runners}/lpc55/board/src/solov2/.gitignore (100%) rename {platforms => runners}/lpc55/board/src/solov2/button.rs (100%) rename {platforms => runners}/lpc55/board/src/solov2/led.rs (100%) rename {platforms => runners}/lpc55/board/src/traits.rs (100%) rename {platforms => runners}/lpc55/board/src/traits/buttons.rs (100%) rename {platforms => runners}/lpc55/board/src/traits/rgb_led.rs (100%) rename {platforms => runners}/lpc55/board/src/traits/timer.rs (100%) rename {platforms => runners}/lpc55/board/src/trussed.rs (100%) rename {platforms/lpc55/runner => runners/lpc55}/build.rs (100%) rename {platforms/lpc55/runner => runners/lpc55}/jlink.gdb (100%) rename {platforms/lpc55/runner => runners/lpc55}/pyocd.gdb (100%) rename {platforms/lpc55/runner => runners/lpc55}/pyocd.yaml (100%) rename {platforms/lpc55/runner => runners/lpc55}/src/lib.rs (100%) rename {platforms/lpc55/runner => runners/lpc55}/src/main.rs (100%) rename {platforms/lpc55/runner => runners/lpc55}/src/types.rs (100%) rename {platforms/lpc55/runner => runners/lpc55}/src/types/usb.rs (100%) rename {platforms/lpc55/runner => runners/lpc55}/tail-serial.py (100%) rename {platforms => runners}/pc/.cargo/config (100%) rename {platforms => runners}/pc/Cargo.toml (100%) rename {platforms => runners}/pc/src/app_pc.rs (100%) rename {platforms => runners}/pc/src/lib.rs (100%) diff --git a/Makefile b/Makefile index 29498acb..7f8ac111 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -RUNNER := platforms/lpc55/runner +RUNNER := runners/lpc55 + build-dev: make -C $(RUNNER) build-dev diff --git a/README.md b/README.md index 45f36a1c..44cd8843 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,16 @@ Install [Rust and Cargo](https://www.rust-lang.org/tools/install) for your syste ### Boards -Head to [platforms/lpc55/board](platforms/lpc55/board) for an overview on the possible embedded platforms the firmware +Head to [runnners/lpc55/board](runners/lpc55/board) for an overview on the possible embedded platforms the firmware currently supports. ### Compiling -Head to [platforms/lpc55/runner](platforms/lpc55/runner) to get started, and try `make build-dev`, which compiles +Head to [runners/lpc55](runners/lpc55) to get started, and try `make build-dev`, which compiles the entire firmware bundle using features convenient for getting started. With `make run-dev`, it will try to connect to a GDB server to flash and run the firmware. +One way to run a GDB server is `JLinkGDBServer -strict -device LPC55S69 -if SWD -vd` To enable logs, you can change the feature flags on each crate. Then logs will be output via semihosting to your SWD debugger. ``` diff --git a/platforms/lpc55/runner/.cargo/config b/runners/lpc55/.cargo/config similarity index 100% rename from platforms/lpc55/runner/.cargo/config rename to runners/lpc55/.cargo/config diff --git a/platforms/lpc55/runner/.gitignore b/runners/lpc55/.gitignore similarity index 100% rename from platforms/lpc55/runner/.gitignore rename to runners/lpc55/.gitignore diff --git a/platforms/lpc55/runner/Cargo.toml b/runners/lpc55/Cargo.toml similarity index 69% rename from platforms/lpc55/runner/Cargo.toml rename to runners/lpc55/Cargo.toml index 59ee92d4..723b0222 100644 --- a/platforms/lpc55/runner/Cargo.toml +++ b/runners/lpc55/Cargo.toml @@ -28,22 +28,22 @@ usbd-serial = "0.1.0" trussed = { git = "https://github.com/trussed-dev/trussed", branch = "main", features = ["clients-3"] } # board -board = { path = "../board" } +board = { path = "board" } # components -apdu-dispatch = {path = "../../../components/apdu-dispatch"} -applet-fido = {path = "../../../components/applet-fido"} -applet-ndef = {path = "../../../components/applet-ndef"} -applet-root = {path = "../../../components/applet-root"} -c-stubs = { path = "../../../components/c-stubs" } -ctap-types = { path = "../../../components/ctap-types" } -fido-authenticator = { path = "../../../components/fido-authenticator" } -fm11nc08 = {path = "../../../components/fm11nc08"} -hid-dispatch = {path = "../../../components/hid-dispatch"} -iso14443 = {path = "../../../components/iso14443"} -piv-authenticator = { path = "../../../components/piv-authenticator", features = ["applet"] } -usbd-ccid = { path = "../../../components/usbd-ccid" } -usbd-ctaphid = { path = "../../../components/usbd-ctaphid" } +apdu-dispatch = {path = "../../components/apdu-dispatch"} +applet-fido = {path = "../../components/applet-fido"} +applet-ndef = {path = "../../components/applet-ndef"} +applet-root = {path = "../../components/applet-root"} +c-stubs = { path = "../../components/c-stubs" } +ctap-types = { path = "../../components/ctap-types" } +fido-authenticator = { path = "../../components/fido-authenticator" } +fm11nc08 = {path = "../../components/fm11nc08"} +hid-dispatch = {path = "../../components/hid-dispatch"} +iso14443 = {path = "../../components/iso14443"} +piv-authenticator = { path = "../../components/piv-authenticator", features = ["applet"] } +usbd-ccid = { path = "../../components/usbd-ccid" } +usbd-ctaphid = { path = "../../components/usbd-ctaphid" } # panic panic-halt = "0.2.0" diff --git a/platforms/lpc55/runner/Makefile b/runners/lpc55/Makefile similarity index 100% rename from platforms/lpc55/runner/Makefile rename to runners/lpc55/Makefile diff --git a/platforms/lpc55/runner/bacon.toml b/runners/lpc55/bacon.toml similarity index 100% rename from platforms/lpc55/runner/bacon.toml rename to runners/lpc55/bacon.toml diff --git a/platforms/lpc55/board/.cargo/config b/runners/lpc55/board/.cargo/config similarity index 100% rename from platforms/lpc55/board/.cargo/config rename to runners/lpc55/board/.cargo/config diff --git a/platforms/lpc55/board/Cargo.toml b/runners/lpc55/board/Cargo.toml similarity index 100% rename from platforms/lpc55/board/Cargo.toml rename to runners/lpc55/board/Cargo.toml diff --git a/platforms/lpc55/board/README.md b/runners/lpc55/board/README.md similarity index 100% rename from platforms/lpc55/board/README.md rename to runners/lpc55/board/README.md diff --git a/platforms/lpc55/board/src/clock_controller.rs b/runners/lpc55/board/src/clock_controller.rs similarity index 100% rename from platforms/lpc55/board/src/clock_controller.rs rename to runners/lpc55/board/src/clock_controller.rs diff --git a/platforms/lpc55/board/src/lib.rs b/runners/lpc55/board/src/lib.rs similarity index 100% rename from platforms/lpc55/board/src/lib.rs rename to runners/lpc55/board/src/lib.rs diff --git a/platforms/lpc55/board/src/lpcxpresso55.rs b/runners/lpc55/board/src/lpcxpresso55.rs similarity index 100% rename from platforms/lpc55/board/src/lpcxpresso55.rs rename to runners/lpc55/board/src/lpcxpresso55.rs diff --git a/platforms/lpc55/board/src/lpcxpresso55/.gitignore b/runners/lpc55/board/src/lpcxpresso55/.gitignore similarity index 100% rename from platforms/lpc55/board/src/lpcxpresso55/.gitignore rename to runners/lpc55/board/src/lpcxpresso55/.gitignore diff --git a/platforms/lpc55/board/src/lpcxpresso55/button.rs b/runners/lpc55/board/src/lpcxpresso55/button.rs similarity index 100% rename from platforms/lpc55/board/src/lpcxpresso55/button.rs rename to runners/lpc55/board/src/lpcxpresso55/button.rs diff --git a/platforms/lpc55/board/src/lpcxpresso55/led.rs b/runners/lpc55/board/src/lpcxpresso55/led.rs similarity index 100% rename from platforms/lpc55/board/src/lpcxpresso55/led.rs rename to runners/lpc55/board/src/lpcxpresso55/led.rs diff --git a/platforms/lpc55/board/src/nfc.rs b/runners/lpc55/board/src/nfc.rs similarity index 100% rename from platforms/lpc55/board/src/nfc.rs rename to runners/lpc55/board/src/nfc.rs diff --git a/platforms/lpc55/board/src/solov2.rs b/runners/lpc55/board/src/solov2.rs similarity index 100% rename from platforms/lpc55/board/src/solov2.rs rename to runners/lpc55/board/src/solov2.rs diff --git a/platforms/lpc55/board/src/solov2/.gitignore b/runners/lpc55/board/src/solov2/.gitignore similarity index 100% rename from platforms/lpc55/board/src/solov2/.gitignore rename to runners/lpc55/board/src/solov2/.gitignore diff --git a/platforms/lpc55/board/src/solov2/button.rs b/runners/lpc55/board/src/solov2/button.rs similarity index 100% rename from platforms/lpc55/board/src/solov2/button.rs rename to runners/lpc55/board/src/solov2/button.rs diff --git a/platforms/lpc55/board/src/solov2/led.rs b/runners/lpc55/board/src/solov2/led.rs similarity index 100% rename from platforms/lpc55/board/src/solov2/led.rs rename to runners/lpc55/board/src/solov2/led.rs diff --git a/platforms/lpc55/board/src/traits.rs b/runners/lpc55/board/src/traits.rs similarity index 100% rename from platforms/lpc55/board/src/traits.rs rename to runners/lpc55/board/src/traits.rs diff --git a/platforms/lpc55/board/src/traits/buttons.rs b/runners/lpc55/board/src/traits/buttons.rs similarity index 100% rename from platforms/lpc55/board/src/traits/buttons.rs rename to runners/lpc55/board/src/traits/buttons.rs diff --git a/platforms/lpc55/board/src/traits/rgb_led.rs b/runners/lpc55/board/src/traits/rgb_led.rs similarity index 100% rename from platforms/lpc55/board/src/traits/rgb_led.rs rename to runners/lpc55/board/src/traits/rgb_led.rs diff --git a/platforms/lpc55/board/src/traits/timer.rs b/runners/lpc55/board/src/traits/timer.rs similarity index 100% rename from platforms/lpc55/board/src/traits/timer.rs rename to runners/lpc55/board/src/traits/timer.rs diff --git a/platforms/lpc55/board/src/trussed.rs b/runners/lpc55/board/src/trussed.rs similarity index 100% rename from platforms/lpc55/board/src/trussed.rs rename to runners/lpc55/board/src/trussed.rs diff --git a/platforms/lpc55/runner/build.rs b/runners/lpc55/build.rs similarity index 100% rename from platforms/lpc55/runner/build.rs rename to runners/lpc55/build.rs diff --git a/platforms/lpc55/runner/jlink.gdb b/runners/lpc55/jlink.gdb similarity index 100% rename from platforms/lpc55/runner/jlink.gdb rename to runners/lpc55/jlink.gdb diff --git a/platforms/lpc55/runner/pyocd.gdb b/runners/lpc55/pyocd.gdb similarity index 100% rename from platforms/lpc55/runner/pyocd.gdb rename to runners/lpc55/pyocd.gdb diff --git a/platforms/lpc55/runner/pyocd.yaml b/runners/lpc55/pyocd.yaml similarity index 100% rename from platforms/lpc55/runner/pyocd.yaml rename to runners/lpc55/pyocd.yaml diff --git a/platforms/lpc55/runner/src/lib.rs b/runners/lpc55/src/lib.rs similarity index 100% rename from platforms/lpc55/runner/src/lib.rs rename to runners/lpc55/src/lib.rs diff --git a/platforms/lpc55/runner/src/main.rs b/runners/lpc55/src/main.rs similarity index 100% rename from platforms/lpc55/runner/src/main.rs rename to runners/lpc55/src/main.rs diff --git a/platforms/lpc55/runner/src/types.rs b/runners/lpc55/src/types.rs similarity index 100% rename from platforms/lpc55/runner/src/types.rs rename to runners/lpc55/src/types.rs diff --git a/platforms/lpc55/runner/src/types/usb.rs b/runners/lpc55/src/types/usb.rs similarity index 100% rename from platforms/lpc55/runner/src/types/usb.rs rename to runners/lpc55/src/types/usb.rs diff --git a/platforms/lpc55/runner/tail-serial.py b/runners/lpc55/tail-serial.py similarity index 100% rename from platforms/lpc55/runner/tail-serial.py rename to runners/lpc55/tail-serial.py diff --git a/platforms/pc/.cargo/config b/runners/pc/.cargo/config similarity index 100% rename from platforms/pc/.cargo/config rename to runners/pc/.cargo/config diff --git a/platforms/pc/Cargo.toml b/runners/pc/Cargo.toml similarity index 100% rename from platforms/pc/Cargo.toml rename to runners/pc/Cargo.toml diff --git a/platforms/pc/src/app_pc.rs b/runners/pc/src/app_pc.rs similarity index 100% rename from platforms/pc/src/app_pc.rs rename to runners/pc/src/app_pc.rs diff --git a/platforms/pc/src/lib.rs b/runners/pc/src/lib.rs similarity index 100% rename from platforms/pc/src/lib.rs rename to runners/pc/src/lib.rs