diff --git a/Cargo.lock b/Cargo.lock index f7f4f74..8404735 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,9 +172,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.28" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "58e804ac3194a48bb129643eb1d62fcc20d18c6b8c181704489353d13120bcd1" dependencies = [ "jobserver", "libc", @@ -334,6 +334,38 @@ dependencies = [ "doc-comment", ] +[[package]] +name = "defmt" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" +dependencies = [ + "defmt-parser", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "defmt-parser" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" +dependencies = [ + "thiserror", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1507,22 +1539,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "stm32f4" -version = "0.15.1" +name = "stm32f4-staging" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb94729242cd1aebe6dab42a2ca0131985ae93bc3ab2751b680df724bb35528d" +checksum = "97a6d5e873d8f15406aadd4349b491e28617173a90f152c0635863b1919070af" dependencies = [ - "bare-metal 1.0.0", "cortex-m", "cortex-m-rt", + "critical-section", + "defmt", + "portable-atomic", "vcell", ] [[package]] name = "stm32f4xx-hal" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed60591531f4da636d828701c74861a3d100e5c4e36677cadbd2eb6f46eb67" +checksum = "243ab58411b5b063098402d18a5d44916336ec86a288b613796e376bd83eaf80" dependencies = [ "bare-metal 1.0.0", "cortex-m", @@ -1532,16 +1566,16 @@ dependencies = [ "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-nb", + "embedded-io", "embedded-storage", "enumflags2", "fugit", "fugit-timer", "nb 1.1.0", "rand_core", - "stm32f4", + "stm32f4-staging", "synopsys-usb-otg", "time", - "vcell", "void", ] @@ -1626,6 +1660,26 @@ dependencies = [ "embedded-hal 1.0.0", ] +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "time" version = "0.3.36" diff --git a/Cargo.toml b/Cargo.toml index e63c040..95c6c82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ enc424j600 = "0.4" embedded-hal = "1" smoltcp-nal = { version = "0.5", features=["shared-stack"] } serial-settings = "0.1" -stm32f4xx-hal = {version = "0.21.0", features = ["stm32f407", "usb_fs"] } +stm32f4xx-hal = {version = "0.22.0", features = ["stm32f407", "usb_fs"] } postcard = "1" diff --git a/src/hardware/platform.rs b/src/hardware/platform.rs index 62a3762..972a74a 100644 --- a/src/hardware/platform.rs +++ b/src/hardware/platform.rs @@ -52,11 +52,11 @@ pub fn shutdown_channels() { unsafe { // Disable all SIG_ON outputs. Note that the upper 16 bits of this register are the ODR // reset bits. - gpiog.bsrr.write(|w| w.bits(0xFF00_0000)); + gpiog.bsrr().write(|w| w.bits(0xFF00_0000)); // Disable all EN_PWR outputs. Note that the upper 16 bits of this register are the ODR // reset bits. - gpiod.bsrr.write(|w| w.bits(0x00FF_0000)); + gpiod.bsrr().write(|w| w.bits(0x00FF_0000)); } } @@ -105,14 +105,14 @@ pub fn i2c_bus_reset(sda: &mut impl OutputPin, scl: &mut impl OutputPin, delay: pub fn watchdog_detected() -> bool { let rcc = unsafe { &*hal::pac::RCC::ptr() }; - rcc.csr.read().wdgrstf().bit_is_set() + rcc.csr().read().wdgrstf().bit_is_set() } /// Clear all of the reset flags in the device. pub fn clear_reset_flags() { let rcc = unsafe { &*hal::pac::RCC::ptr() }; - rcc.csr.modify(|_, w| w.rmvf().set_bit()); + rcc.csr().modify(|_, w| w.rmvf().set_bit()); } pub fn start_dfu_reboot() { diff --git a/src/hardware/rf_channel.rs b/src/hardware/rf_channel.rs index cc768c9..e8b2ffc 100644 --- a/src/hardware/rf_channel.rs +++ b/src/hardware/rf_channel.rs @@ -198,18 +198,18 @@ impl Devices { /// Represents the control and status pins for an RF channel. pub struct ChannelPins { - enable_power: hal::gpio::EPin, + enable_power: hal::gpio::ErasedPin, // The alert and input overdrive pins have external pull resistors, so we don't need to pull // them internally. - alert: hal::gpio::EPin, + alert: hal::gpio::ErasedPin, - reflected_overdrive: hal::gpio::EPin, + reflected_overdrive: hal::gpio::ErasedPin, // There are no pullup/pulldown resistors on this input, so we will pull it down internally. - output_overdrive: hal::gpio::EPin, + output_overdrive: hal::gpio::ErasedPin, - signal_on: hal::gpio::EPin, + signal_on: hal::gpio::ErasedPin, output_power: AdcPin, reflected_power: AdcPin, @@ -228,11 +228,11 @@ impl ChannelPins { /// * `output_power` - The pin to use for measuring transmitted power. /// * `reflected_power` - The pin to use for measuring reflected power. pub fn new( - enable_power: hal::gpio::EPin, - alert: hal::gpio::EPin, - reflected_overdrive: hal::gpio::EPin, - output_overdrive: hal::gpio::EPin, - signal_on: hal::gpio::EPin, + enable_power: hal::gpio::ErasedPin, + alert: hal::gpio::ErasedPin, + reflected_overdrive: hal::gpio::ErasedPin, + output_overdrive: hal::gpio::ErasedPin, + signal_on: hal::gpio::ErasedPin, output_power: AdcPin, reflected_power: AdcPin, ) -> Self { diff --git a/src/hardware/setup.rs b/src/hardware/setup.rs index ac0513c..4c730f1 100644 --- a/src/hardware/setup.rs +++ b/src/hardware/setup.rs @@ -104,7 +104,7 @@ pub fn setup( clock: SystemTimer, ) -> BoosterDevices { // Configure RTT logging. - device.DBGMCU.cr.modify(|_, w| w.dbg_sleep().set_bit()); + device.DBGMCU.cr().modify(|_, w| w.dbg_sleep().set_bit()); rtt_target::rtt_init_print!(); // Install the logger