Bump Tock kernel version (#374)
* Bump Tock kernel version * Update boards to new kernel * Update patches to new kernel * Update PR template * Bump libtock-rs * Use new layout from libtock-rs * Fix clippy warnings due to updated toolchain * Fix new toolchain file format * Bump elf2tab to v0.7.0 * Fix worklow and setup.sh script to use the TOML rust-toolchain file * New libtock-rs style of declaring the stack. * Fix padding in layout file. The layout from libtock-rs generates invalid flash padding. The value is 32-bit and therefore setting padding to 0xff yields 0xff000000 instead of 0xffffffff that we want. * adds tock patch for app break hard fault * sets in deploy, removed patch 04-mpu-fix * fixed the if deploy * fixes indentation * updates board names in install.md * fix docs and deploy style Co-authored-by: Fabian Kaczmarczyck <kaczmarczyck@google.com> Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c2b3aeca88
commit
c1f2551d0d
@@ -1,11 +1,11 @@
|
||||
diff --git a/boards/components/src/lib.rs b/boards/components/src/lib.rs
|
||||
index dc56c94d2..917497af4 100644
|
||||
index 64fe46b7b..a3bbe724b 100644
|
||||
--- a/boards/components/src/lib.rs
|
||||
+++ b/boards/components/src/lib.rs
|
||||
@@ -36,3 +36,4 @@ pub mod spi;
|
||||
pub mod st7735;
|
||||
pub mod temperature;
|
||||
@@ -52,3 +52,4 @@ pub mod tickv;
|
||||
pub mod touch;
|
||||
pub mod udp_driver;
|
||||
pub mod udp_mux;
|
||||
+pub mod usb_ctap;
|
||||
diff --git a/boards/components/src/usb_ctap.rs b/boards/components/src/usb_ctap.rs
|
||||
new file mode 100644
|
||||
@@ -101,152 +101,8 @@ index 000000000..69e95c3c7
|
||||
+ usb_driver
|
||||
+ }
|
||||
+}
|
||||
diff --git a/boards/nordic/nrf52840_dongle_opensk/src/main.rs b/boards/nordic/nrf52840_dongle_opensk/src/main.rs
|
||||
index f9c104251..115e17280 100644
|
||||
--- a/boards/nordic/nrf52840_dongle_opensk/src/main.rs
|
||||
+++ b/boards/nordic/nrf52840_dongle_opensk/src/main.rs
|
||||
@@ -40,6 +40,17 @@ const _SPI_CLK: Pin = Pin::P1_04;
|
||||
/// UART Writer
|
||||
pub mod io;
|
||||
|
||||
+const VENDOR_ID: u16 = 0x1915; // Nordic Semiconductor
|
||||
+const PRODUCT_ID: u16 = 0x521f; // nRF52840 Dongle (PCA10059)
|
||||
+static STRINGS: &'static [&'static str] = &[
|
||||
+ // Manufacturer
|
||||
+ "Nordic Semiconductor ASA",
|
||||
+ // Product
|
||||
+ "OpenSK",
|
||||
+ // Serial number
|
||||
+ "v1.0",
|
||||
+];
|
||||
+
|
||||
// State for loading and holding applications.
|
||||
// How should the kernel respond when a process faults.
|
||||
const FAULT_RESPONSE: kernel::procs::FaultResponse = kernel::procs::FaultResponse::Panic;
|
||||
@@ -84,6 +95,11 @@ pub struct Platform {
|
||||
capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
|
||||
>,
|
||||
nvmc: &'static nrf52840::nvmc::SyscallDriver,
|
||||
+ usb: &'static capsules::usb::usb_ctap::CtapUsbSyscallDriver<
|
||||
+ 'static,
|
||||
+ 'static,
|
||||
+ nrf52840::usbd::Usbd<'static>,
|
||||
+ >,
|
||||
}
|
||||
|
||||
impl kernel::Platform for Platform {
|
||||
@@ -100,6 +116,7 @@ impl kernel::Platform for Platform {
|
||||
capsules::rng::DRIVER_NUM => f(Some(self.rng)),
|
||||
capsules::analog_comparator::DRIVER_NUM => f(Some(self.analog_comparator)),
|
||||
nrf52840::nvmc::DRIVER_NUM => f(Some(self.nvmc)),
|
||||
+ capsules::usb::usb_ctap::DRIVER_NUM => f(Some(self.usb)),
|
||||
kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
|
||||
_ => f(None),
|
||||
}
|
||||
@@ -292,6 +309,21 @@ pub unsafe fn reset_handler() {
|
||||
.expect("no deferred call slot available for nvmc"),
|
||||
);
|
||||
|
||||
+ // Enable power events to be sent to USB controller
|
||||
+ nrf52840::power::POWER.set_usb_client(&nrf52840::usbd::USBD);
|
||||
+ nrf52840::power::POWER.enable_interrupts();
|
||||
+
|
||||
+ // Configure USB controller
|
||||
+ let usb = components::usb_ctap::UsbCtapComponent::new(
|
||||
+ board_kernel,
|
||||
+ &nrf52840::usbd::USBD,
|
||||
+ capsules::usb::usbc_client::MAX_CTRL_PACKET_SIZE_NRF52840,
|
||||
+ VENDOR_ID,
|
||||
+ PRODUCT_ID,
|
||||
+ STRINGS,
|
||||
+ )
|
||||
+ .finalize(components::usb_ctap_component_buf!(nrf52840::usbd::Usbd));
|
||||
+
|
||||
nrf52_components::NrfClockComponent::new().finalize(());
|
||||
|
||||
let platform = Platform {
|
||||
@@ -304,6 +336,7 @@ pub unsafe fn reset_handler() {
|
||||
alarm,
|
||||
analog_comparator,
|
||||
nvmc,
|
||||
+ usb,
|
||||
ipc: kernel::ipc::IPC::new(board_kernel, &memory_allocation_capability),
|
||||
};
|
||||
|
||||
diff --git a/boards/nordic/nrf52840dk_opensk/src/main.rs b/boards/nordic/nrf52840dk_opensk/src/main.rs
|
||||
index c80732f8d..41047a390 100644
|
||||
--- a/boards/nordic/nrf52840dk_opensk/src/main.rs
|
||||
+++ b/boards/nordic/nrf52840dk_opensk/src/main.rs
|
||||
@@ -104,6 +104,17 @@ pub mod io;
|
||||
// - Set to true to use Segger RTT over USB.
|
||||
const USB_DEBUGGING: bool = true;
|
||||
|
||||
+const VENDOR_ID: u16 = 0x1915; // Nordic Semiconductor
|
||||
+const PRODUCT_ID: u16 = 0x521f; // nRF52840 Dongle (PCA10059)
|
||||
+static STRINGS: &'static [&'static str] = &[
|
||||
+ // Manufacturer
|
||||
+ "Nordic Semiconductor ASA",
|
||||
+ // Product
|
||||
+ "OpenSK",
|
||||
+ // Serial number
|
||||
+ "v1.0",
|
||||
+];
|
||||
+
|
||||
// State for loading and holding applications.
|
||||
// How should the kernel respond when a process faults.
|
||||
const FAULT_RESPONSE: kernel::procs::FaultResponse = kernel::procs::FaultResponse::Panic;
|
||||
@@ -147,6 +158,11 @@ pub struct Platform {
|
||||
capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
|
||||
>,
|
||||
nvmc: &'static nrf52840::nvmc::SyscallDriver,
|
||||
+ usb: &'static capsules::usb::usb_ctap::CtapUsbSyscallDriver<
|
||||
+ 'static,
|
||||
+ 'static,
|
||||
+ nrf52840::usbd::Usbd<'static>,
|
||||
+ >,
|
||||
}
|
||||
|
||||
impl kernel::Platform for Platform {
|
||||
@@ -163,6 +179,7 @@ impl kernel::Platform for Platform {
|
||||
capsules::rng::DRIVER_NUM => f(Some(self.rng)),
|
||||
capsules::analog_comparator::DRIVER_NUM => f(Some(self.analog_comparator)),
|
||||
nrf52840::nvmc::DRIVER_NUM => f(Some(self.nvmc)),
|
||||
+ capsules::usb::usb_ctap::DRIVER_NUM => f(Some(self.usb)),
|
||||
kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
|
||||
_ => f(None),
|
||||
}
|
||||
@@ -377,6 +394,21 @@ pub unsafe fn reset_handler() {
|
||||
.expect("no deferred call slot available for nvmc"),
|
||||
);
|
||||
|
||||
+ // Enable power events to be sent to USB controller
|
||||
+ nrf52840::power::POWER.set_usb_client(&nrf52840::usbd::USBD);
|
||||
+ nrf52840::power::POWER.enable_interrupts();
|
||||
+
|
||||
+ // Configure USB controller
|
||||
+ let usb = components::usb_ctap::UsbCtapComponent::new(
|
||||
+ board_kernel,
|
||||
+ &nrf52840::usbd::USBD,
|
||||
+ capsules::usb::usbc_client::MAX_CTRL_PACKET_SIZE_NRF52840,
|
||||
+ VENDOR_ID,
|
||||
+ PRODUCT_ID,
|
||||
+ STRINGS,
|
||||
+ )
|
||||
+ .finalize(components::usb_ctap_component_buf!(nrf52840::usbd::Usbd));
|
||||
+
|
||||
nrf52_components::NrfClockComponent::new().finalize(());
|
||||
|
||||
let platform = Platform {
|
||||
@@ -389,6 +421,7 @@ pub unsafe fn reset_handler() {
|
||||
alarm,
|
||||
analog_comparator,
|
||||
nvmc,
|
||||
+ usb,
|
||||
ipc: kernel::ipc::IPC::new(board_kernel, &memory_allocation_capability),
|
||||
};
|
||||
|
||||
diff --git a/capsules/src/driver.rs b/capsules/src/driver.rs
|
||||
index 256fc0e9d..ae458b309 100644
|
||||
index 3dad0f50b..b6124c4c0 100644
|
||||
--- a/capsules/src/driver.rs
|
||||
+++ b/capsules/src/driver.rs
|
||||
@@ -26,6 +26,7 @@ pub enum NUM {
|
||||
@@ -258,11 +114,12 @@ index 256fc0e9d..ae458b309 100644
|
||||
// Radio
|
||||
BleAdvertising = 0x30000,
|
||||
diff --git a/capsules/src/usb/mod.rs b/capsules/src/usb/mod.rs
|
||||
index 767f5de83..3f3a4f646 100644
|
||||
index 6d5daa444..17cab4c23 100644
|
||||
--- a/capsules/src/usb/mod.rs
|
||||
+++ b/capsules/src/usb/mod.rs
|
||||
@@ -1,5 +1,7 @@
|
||||
@@ -1,6 +1,8 @@
|
||||
pub mod cdc;
|
||||
pub mod ctap;
|
||||
pub mod descriptors;
|
||||
+pub mod usb_ctap;
|
||||
pub mod usb_user;
|
||||
@@ -1005,16 +862,3 @@ index 000000000..642039120
|
||||
+ self.client.map(|client| client.packet_transmitted());
|
||||
+ }
|
||||
+}
|
||||
diff --git a/chips/nrf52840/src/lib.rs b/chips/nrf52840/src/lib.rs
|
||||
index 942d0288f..ce73e1f82 100644
|
||||
--- a/chips/nrf52840/src/lib.rs
|
||||
+++ b/chips/nrf52840/src/lib.rs
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
pub use nrf52::{
|
||||
acomp, adc, aes, ble_radio, clock, constants, crt1, ficr, i2c, ieee802154_radio, init, nvmc,
|
||||
- pinmux, ppi, pwm, rtc, spi, temperature, timer, trng, uart, uicr, usbd,
|
||||
+ pinmux, power, ppi, pwm, rtc, spi, temperature, timer, trng, uart, uicr, usbd,
|
||||
};
|
||||
pub mod chip;
|
||||
pub mod gpio;
|
||||
|
||||
Reference in New Issue
Block a user