diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 446ca233..c3c72659 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,11 +19,12 @@ jobs: board: - board-lpcxpresso55 - board-solov2 + - board-okdoe1 rust: - stable defaults: run: - working-directory: platforms/lpc55/runner + working-directory: runners/lpc55 steps: - uses: actions/checkout@v1 - name: Install littlefs2-sys/micro-ecc-sys build dependencies @@ -64,7 +65,7 @@ jobs: - stable defaults: run: - working-directory: platforms/pc + working-directory: runners/pc steps: - uses: actions/checkout@v1 - name: Install Linux build dependencies diff --git a/runners/lpc55/Cargo.toml b/runners/lpc55/Cargo.toml index 723b0222..8925b97a 100644 --- a/runners/lpc55/Cargo.toml +++ b/runners/lpc55/Cargo.toml @@ -21,12 +21,11 @@ delog = "0.1.0-alpha.3" heapless = "0.5.5" interchange = "0.1.0" nb = "1" +trussed = { git = "https://github.com/trussed-dev/trussed", branch = "main", features = ["clients-3"] } usb-device = "0.2.3" # usbd-hid = { version = "0.4.5", optional = true } usbd-serial = "0.1.0" -trussed = { git = "https://github.com/trussed-dev/trussed", branch = "main", features = ["clients-3"] } - # board board = { path = "board" } @@ -47,7 +46,7 @@ usbd-ctaphid = { path = "../../components/usbd-ctaphid" } # panic panic-halt = "0.2.0" -panic-semihosting = { version = "0.5.3", features = ["jlink-quirks"] } +panic-semihosting = "0.5.6" # storage littlefs2 = "0.1.1" @@ -75,7 +74,8 @@ log-serial = [] highspeed = [] usbfs-peripheral = [] serial = [] -reconfig = [] +# Reconfigure the NFC chip in any case +reconfigure-nfc = [] no-clock-controller = ["board/no-clock-controller"] enable-clock-controller-signal-pin = ["board/enable-clock-controller-signal-pin"] # very-twitchy-mouse = ["usbd-hid"] diff --git a/runners/lpc55/src/lib.rs b/runners/lpc55/src/lib.rs index 3db15786..13655fc0 100644 --- a/runners/lpc55/src/lib.rs +++ b/runners/lpc55/src/lib.rs @@ -221,7 +221,7 @@ pub fn init_board(device_peripherals: hal::raw::Peripherals, core_peripherals: r pint.enable_interrupt(&mut mux, &nfc_irq, hal::peripherals::pint::Slot::Slot0, hal::peripherals::pint::Mode::ActiveLow); mux.disabled(&mut syscon); - let force_nfc_reconfig = cfg!(feature = "reconfig"); + let force_nfc_reconfig = cfg!(feature = "reconfigure-nfc"); let maybe_fm = board::nfc::try_setup( spi, @@ -380,7 +380,7 @@ pub fn init_board(device_peripherals: hal::raw::Peripherals, core_peripherals: r clocks.support_usbhs_token().unwrap(), ); #[cfg(feature = "usbfs-peripheral")] - let mut usbd = hal.usbfs.enabled_as_device( + let usbd = hal.usbfs.enabled_as_device( &mut anactrl, &mut pmc, &mut syscon, diff --git a/runners/pc/Cargo.toml b/runners/pc/Cargo.toml index beb6fb57..ca4f6ad1 100644 --- a/runners/pc/Cargo.toml +++ b/runners/pc/Cargo.toml @@ -1,29 +1,23 @@ [package] -name = "app" +name = "solo-pc" version = "0.1.0" authors = ["Nicolas Stalder ", "Conor Patrick "] edition = "2018" -[lib] -name = "app" - -[[bin]] -name = "pc" -path = "src/app_pc.rs" - [dependencies] chacha20 = { version = "0.6.0", features = ["rng"] } +delog = "0.1.0-alpha.3" heapless = "0.5.5" nb = "1" embedded-hal = { version = "0.2", features = ["unproven"] } generic-array = "0.14.3" +interchange = "0.1.0" +trussed = { git = "https://github.com/trussed-dev/trussed", branch = "main", features = ["clients-3"] } # components c-stubs = { path = "../../components/c-stubs" } -trussed = { path = "../../components/trussed", features = ["clients-3"] } ctap-types = { path = "../../components/ctap-types" } fido-authenticator = { path = "../../components/fido-authenticator" } -interchange = { path = "../../components/interchange" } piv-authenticator = { path = "../../components/piv-authenticator" } usbd-ccid = { path = "../../components/usbd-ccid" } usbd-ctaphid = { path = "../../components/usbd-ctaphid" } @@ -33,11 +27,9 @@ hid-dispatch = {path = "./../../components/hid-dispatch"} applet-ndef = {path = "./../../components/applet-ndef"} applet-root = {path = "./../../components/applet-root"} applet-fido = {path = "./../../components/applet-fido"} -delog = "0.1.0-alpha.3" # storage -# littlefs2 = { git = "https://github.com/nickray/littlefs2", branch = "main" } -littlefs2 = { git = "https://github.com/nickray/littlefs2", branch = "closures-instead-of-ub" } +littlefs2 = "0.1.1" [features] default = [] @@ -45,8 +37,8 @@ default = [] # Use to auto-succeed every user presence check no-buttons= [] - -reconfig = [] +# Reconfigure the NFC chip in any case +reconfigure-nfc = [] log-all = [] log-none = [] @@ -57,10 +49,6 @@ log-error = [] # patch dependencies like so to test local changes -[patch.crates-io] -heapless = { git = "https://github.com/nickray/heapless", branch = "bytebuf-0.5.6" } -nisty = {git = "https://github.com/ycrypto/nisty", branch="main"} - [profile.release] codegen-units = 1 opt-level = "z" diff --git a/runners/pc/src/app_pc.rs b/runners/pc/src/bin/main.rs similarity index 99% rename from runners/pc/src/app_pc.rs rename to runners/pc/src/bin/main.rs index 944efe6d..80f91494 100644 --- a/runners/pc/src/app_pc.rs +++ b/runners/pc/src/bin/main.rs @@ -11,7 +11,7 @@ use trussed::platform::{ reboot, consent, }; -use trussed::{board, store}; +use trussed::{platform, store}; use ctap_types::consts; pub use generic_array::{ @@ -187,7 +187,7 @@ impl trussed::platform::UserInterface for UserInterface } -board!(Board, +platform!(Board, R: chacha20::ChaCha8Rng, S: Store, UI: UserInterface,