-
Couldn't load subscription status.
- Fork 214
HAL Update Guide
Justin Beaurivage edited this page Sep 1, 2024
·
3 revisions
- All peripherals are now lowercase. For example,
let pins = bsp::Pins::new(peripherals.PORT);becomes
let pins = bsp::Pins::new(peripherals.port);- All peripheral types now use PascalCase. For example,
use bsp::pac::DMAC;becomes
use bsp::pac::Dmac;- All register accessors are now methods instead of struct members. For example,
rtc.mode0().intflag.modify(|_, w| w.cmp0().set_bit());becomes
rtc.mode0().intflag().modify(|_, w| w.cmp0().set_bit());The interface for supplying string descriptors has changed from:
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")to
.strings(&[StringDescriptors::new(LangID::EN)
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")])
.expect("Failed to set strings")Linking your firmware may result in errors like rust-lld: error: undefined symbol: _critical_section_1_0_acquire. In your firmware's Cargo.toml, specify the critical-section-single-core feature of cortex-m: cortex-m = {version = "0.7", features = ["critical-section-single-core"]}.
Code that had use hal::sercom::v2:: should be changed to use hal::sercom::, and usage of the v1 SERCOM implementation needs to be ported to v2.