From cb7e16ea727707c3145ff74db77c3fe941782231 Mon Sep 17 00:00:00 2001 From: Hecatron Date: Fri, 2 Aug 2024 13:06:54 +0100 Subject: [PATCH] Updates to dependencies / serial port updates (#214) * rename config to config.toml * Updates for usb serial port handling * allow manual triggering of workflow * Revert "allow manual triggering of workflow" This reverts commit 34751f3dfbe83636a7eea21e920408b346032d17. * Addition of additional dependency updates * minor update to embedded-graphics in dev depends * updates to cortex-m-semihosting * updates to Changelog --- .cargo/{config => config.toml} | 0 CHANGELOG.md | 17 +++++++++++++++- Cargo.toml | 26 ++++++++++++------------ examples/flash.rs | 2 +- examples/fmc.rs | 2 +- examples/hello.rs | 2 +- examples/i2c_scanner.rs | 16 +++++++-------- examples/rng.rs | 2 +- examples/rtc.rs | 2 +- examples/stm32f7disco-qspi-flash/main.rs | 4 ++-- examples/timer-periph.rs | 12 +++++------ examples/timer-syst.rs | 12 +++++------ examples/usb_serial.rs | 9 +++++--- 13 files changed, 62 insertions(+), 44 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index a81a682..29d4aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,13 +11,28 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Updated `stm32f7` dependency 0.14.0 -> 0.15 - Use PascalCase for generated values of enums ([stm32-rs#727](https://github.com/stm32-rs/stm32-rs/pull/727)) -- Updated `synopsys-usb-otg` dependency 0.2.3 -> 0.3 +- Updated `synopsys-usb-otg` dependency 0.2.3 -> 0.4.0 - Updated `stm32-fmc` dependency 0.2.0 -> 0.3 - Added Interruptable trait to Alternate mode pins - Added a "low pin count" variant of the f730 chip to the crate features: packages <144 pins don't include a high speed USB PHY - Added SPI2_SCK pin for stm32f769i-discovery - Fix mass-erase triggering in `flash` on smaller chips - Remove the need for software u64 division in the clock setup code, shrinking code (#211) +- Updated `cortex-m` dependency 0.7.4 -> 0.7.7 +- Updated `nb` dependency 1.0 -> 1.1.0 +- Updated `micromath` dependency 2.0 -> 2.1.0 +- Updated `fugit` dependency 0.3.5 -> 0.3.7 +- Updated `bitflags` dependency 1.3.2 -> 2.6.0 +- Updated `embedded-hal` dependency 0.2.3 -> 0.2.7 +- Updated `display-interface` dependency 0.4.1 -> 0.5.0 +- Updated `cortex-m-semihosting` development dependency 0.3.3 -> 0.5.0 + - Removed unwrap from the end of hprintln / hprint for new version of semihosting +- Updated `panic-semihosting` development dependency 0.5.2 -> 0.6.0 +- Updated `embedded-graphics` development dependency 0.6.1 -> 0.6.2 +- Updated `usb-device` development dependency 0.2.5 -> 0.3.2 +- Updated `usbd-serial` development dependency 0.1.0 -> 0.2.2 + - Updated usb serial example to use new api +- Renamed .cargo/config -> .cargo/config.toml ## [v0.7.0] - 2022-06-05 diff --git a/Cargo.toml b/Cargo.toml index 8197583..f2d9b72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,19 +18,19 @@ features = ["stm32f746", "rt"] [dependencies] as-slice = "0.2" -cortex-m = "0.7.4" +cortex-m = "0.7.7" cortex-m-rt = ">=0.6.15, <0.8" -nb = "1.0" +nb = "1.1.0" stm32f7 = "0.15" -micromath = "2.0" -synopsys-usb-otg = { version = "0.3", features = ["cortex-m"], optional = true } +micromath = "2.1.0" +synopsys-usb-otg = { version = "0.4.0", features = ["cortex-m"], optional = true } stm32-fmc = { version = "0.3", features = ["sdram"], optional = true } rand_core = "0.6" bxcan = "0.7" bare-metal = "1.0" -fugit = "0.3.5" +fugit = "0.3.7" fugit-timer = "0.1.3" -bitflags = "1.3.2" +bitflags = "2.6.0" rtic-monotonic = { version = "1.0", optional = true } [dependencies.time] @@ -43,7 +43,7 @@ version = "0.3.0" [dependencies.embedded-hal] features = ["unproven"] -version = "0.2.3" +version = "0.2.7" [dependencies.void] default-features = false @@ -51,15 +51,15 @@ version = "1.0.2" [dependencies.display-interface] optional = true -version = "0.4.1" +version = "0.5.0" [dev-dependencies] -cortex-m-semihosting = "0.3.3" +cortex-m-semihosting = "0.5.0" panic-halt = "0.2.0" -panic-semihosting = "0.5.2" -embedded-graphics = "0.6.1" -usb-device = "0.2.5" -usbd-serial = "0.1.0" +panic-semihosting = "0.6.0" +embedded-graphics = "0.6.2" +usb-device = "0.3.2" +usbd-serial = "0.2.2" [dev-dependencies.time] version = "0.3" diff --git a/examples/flash.rs b/examples/flash.rs index 3a3f85b..5f818ca 100644 --- a/examples/flash.rs +++ b/examples/flash.rs @@ -39,7 +39,7 @@ fn main() -> ! { // Compare the written data with the expected value. if flash_data == DATA { - hprintln!("Flash programming successful").unwrap(); + hprintln!("Flash programming successful"); } loop {} diff --git a/examples/fmc.rs b/examples/fmc.rs index 139bf87..8860072 100644 --- a/examples/fmc.rs +++ b/examples/fmc.rs @@ -124,7 +124,7 @@ fn main() -> ! { } } - hprintln!("Success!").unwrap(); + hprintln!("Success!"); loop {} } diff --git a/examples/hello.rs b/examples/hello.rs index b44841d..3fe9250 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -13,6 +13,6 @@ use cortex_m_semihosting::hprintln; #[entry] fn main() -> ! { - hprintln!("Hello, world!").unwrap(); + hprintln!("Hello, world!"); loop {} } diff --git a/examples/i2c_scanner.rs b/examples/i2c_scanner.rs index 084ceac..fa65029 100644 --- a/examples/i2c_scanner.rs +++ b/examples/i2c_scanner.rs @@ -36,26 +36,26 @@ fn main() -> ! { 50_000, ); - hprintln!("Start i2c scanning...").expect("Error using hprintln."); - hprintln!().unwrap(); + hprintln!("Start i2c scanning..."); + hprintln!(); for addr in 0x00_u8..0x80 { // Write the empty array and check the slave response. let byte: [u8; 1] = [0; 1]; if VALID_ADDR_RANGE.contains(&addr) && i2c.write(addr, &byte).is_ok() { - hprint!("{:02x}", addr).unwrap(); + hprint!("{:02x}", addr); } else { - hprint!("..").unwrap(); + hprint!(".."); } if addr % 0x10 == 0x0F { - hprintln!().unwrap(); + hprintln!(); } else { - hprint!(" ").unwrap(); + hprint!(" "); } } - hprintln!().unwrap(); - hprintln!("Done!").unwrap(); + hprintln!(); + hprintln!("Done!"); loop {} } diff --git a/examples/rng.rs b/examples/rng.rs index 5bc8f24..96e1d4c 100644 --- a/examples/rng.rs +++ b/examples/rng.rs @@ -15,7 +15,7 @@ fn main() -> ! { let p = pac::Peripherals::take().unwrap(); let mut rng = p.RNG.init(); let val = rng.get_rand().unwrap(); - hprintln!("random value {}", val).unwrap(); + hprintln!("random value {}", val); loop { core::hint::spin_loop(); } diff --git a/examples/rtc.rs b/examples/rtc.rs index 4b4ec60..c7c5761 100644 --- a/examples/rtc.rs +++ b/examples/rtc.rs @@ -50,6 +50,6 @@ fn main() -> ! { // rtc.set_minutes(59).unwrap(); // rtc.set_seconds(59).unwrap(); loop { - hprintln!("{}", rtc.get_datetime()).unwrap(); + hprintln!("{}", rtc.get_datetime()); } } diff --git a/examples/stm32f7disco-qspi-flash/main.rs b/examples/stm32f7disco-qspi-flash/main.rs index 586b17c..ee5cecb 100644 --- a/examples/stm32f7disco-qspi-flash/main.rs +++ b/examples/stm32f7disco-qspi-flash/main.rs @@ -97,7 +97,7 @@ fn memory_example_polling(mt25q: &mut mt25q::Mt25q) { } } - hprintln!("Flash device memory test successful!").unwrap(); + hprintln!("Flash device memory test successful!"); } fn memory_example_dma( @@ -174,5 +174,5 @@ fn memory_example_dma( } } - hprintln!("Flash device memory DMA test successful!").unwrap(); + hprintln!("Flash device memory DMA test successful!"); } diff --git a/examples/timer-periph.rs b/examples/timer-periph.rs index cd7e8aa..ca331dd 100644 --- a/examples/timer-periph.rs +++ b/examples/timer-periph.rs @@ -30,15 +30,15 @@ fn main() -> ! { let mut timer = dp.TIM1.counter_ms(&clocks); timer.start(1.secs()).unwrap(); - hprintln!("hello!").unwrap(); + hprintln!("hello!"); // wait until timer expires nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 1").unwrap(); + hprintln!("timer expired 1"); // the function counter_ms() creates a periodic timer, so it is automatically // restarted nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 2").unwrap(); + hprintln!("timer expired 2"); // cancel current timer timer.cancel().unwrap(); @@ -46,16 +46,16 @@ fn main() -> ! { // start it again timer.start(1.secs()).unwrap(); nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 3").unwrap(); + hprintln!("timer expired 3"); timer.cancel().unwrap(); let cancel_outcome = timer.cancel(); assert_eq!(cancel_outcome, Err(Error::Disabled)); - hprintln!("ehy, you cannot cancel a timer two times!").unwrap(); + hprintln!("ehy, you cannot cancel a timer two times!"); // this time the timer was not restarted, therefore this function should // wait forever nb::block!(timer.wait()).unwrap(); // you should never see this print - hprintln!("if you see this there is something wrong").unwrap(); + hprintln!("if you see this there is something wrong"); panic!(); } diff --git a/examples/timer-syst.rs b/examples/timer-syst.rs index 06d18eb..ed076a8 100644 --- a/examples/timer-syst.rs +++ b/examples/timer-syst.rs @@ -31,15 +31,15 @@ fn main() -> ! { let mut timer = cp.SYST.counter_us(&clocks); timer.start(42.millis()).unwrap(); - hprintln!("hello!").unwrap(); + hprintln!("hello!"); // wait until timer expires nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 1").unwrap(); + hprintln!("timer expired 1"); // the function syst() creates a periodic timer, so it is automatically // restarted nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 2").unwrap(); + hprintln!("timer expired 2"); // cancel current timer timer.cancel().unwrap(); @@ -47,16 +47,16 @@ fn main() -> ! { // start it again timer.start(42.millis()).unwrap(); nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 3").unwrap(); + hprintln!("timer expired 3"); timer.cancel().unwrap(); let cancel_outcome = timer.cancel(); assert_eq!(cancel_outcome, Err(Error::Disabled)); - hprintln!("ehy, you cannot cancel a timer two times!").unwrap(); + hprintln!("ehy, you cannot cancel a timer two times!"); // this time the timer was not restarted, therefore this function should // wait forever nb::block!(timer.wait()).unwrap(); // you should never see this print - hprintln!("if you see this there is something wrong").unwrap(); + hprintln!("if you see this there is something wrong"); panic!(); } diff --git a/examples/usb_serial.rs b/examples/usb_serial.rs index fb22738..6da2998 100644 --- a/examples/usb_serial.rs +++ b/examples/usb_serial.rs @@ -77,11 +77,14 @@ fn main() -> ! { let mut serial = usbd_serial::SerialPort::new(&usb_bus); let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd)) - .manufacturer("Fake company") - .product("Serial port") - .serial_number("TEST") + .strings(&[StringDescriptors::default() + .manufacturer("Fake company") + .product("Serial port") + .serial_number("TEST") + ]).unwrap() .device_class(usbd_serial::USB_CLASS_CDC) .max_packet_size_0(64) // Size required for HS, and ok for FS + .unwrap() .build(); loop {