Skip to content

Commit

Permalink
Updates to dependencies / serial port updates (#214)
Browse files Browse the repository at this point in the history
* 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 34751f3.

* Addition of additional dependency updates

* minor update to embedded-graphics in dev depends

* updates to cortex-m-semihosting

* updates to Changelog
  • Loading branch information
Hecatron authored Aug 2, 2024
1 parent f6a5d1f commit cb7e16e
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 44 deletions.
File renamed without changes.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -43,23 +43,23 @@ version = "0.3.0"

[dependencies.embedded-hal]
features = ["unproven"]
version = "0.2.3"
version = "0.2.7"

[dependencies.void]
default-features = false
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"
Expand Down
2 changes: 1 addition & 1 deletion examples/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
2 changes: 1 addition & 1 deletion examples/fmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn main() -> ! {
}
}

hprintln!("Success!").unwrap();
hprintln!("Success!");

loop {}
}
2 changes: 1 addition & 1 deletion examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ use cortex_m_semihosting::hprintln;

#[entry]
fn main() -> ! {
hprintln!("Hello, world!").unwrap();
hprintln!("Hello, world!");
loop {}
}
16 changes: 8 additions & 8 deletions examples/i2c_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
}
2 changes: 1 addition & 1 deletion examples/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/rtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
4 changes: 2 additions & 2 deletions examples/stm32f7disco-qspi-flash/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -174,5 +174,5 @@ fn memory_example_dma(
}
}

hprintln!("Flash device memory DMA test successful!").unwrap();
hprintln!("Flash device memory DMA test successful!");
}
12 changes: 6 additions & 6 deletions examples/timer-periph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,32 @@ 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();

// 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!();
}
12 changes: 6 additions & 6 deletions examples/timer-syst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ 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();

// 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!();
}
9 changes: 6 additions & 3 deletions examples/usb_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cb7e16e

Please sign in to comment.