After myself and 2 others had the same question in 3 days on matrix: Maybe You want an example?
This is not strictly an embassy thing, but it took me (= new to Rust and fairly new to embedded) quite some time & a lot of kind help on matrix to figure out. So my guess is others might benefit.
(thanks @jamesmunns especially!)
Word of caution: Binary size grew > 10xxkb and flashing that somehow corrupts the device and the code fails. The exact same code copied into my own project works just fine. So I added a secction to cargo.toml to reduce binary size:
[profile.dev]
lto = true
opt-level = "z"
That way the code now runs without issue, with less than half the original binary size.
-> if that is not okay, then the entire thing should not go into the repo without some other solution. As a newbie I would then need help to do it differently.
After myself and 2 others had the same question in 3 days on matrix: Maybe You want an example?
This is not strictly an embassy thing, but it took me (= new to Rust and fairly new to embedded) quite some time & a lot of kind help on matrix to figure out. So my guess is others might benefit. (thanks @jamesmunns especially!)
Word of caution: Binary size grew > 10xxkb and flashing that somehow corrupts the device and the code fails. The exact same code copied into my own project works just fine. So I added a secction to
cargo.toml
to reduce binary size:That way the code now runs without issue, with less than half the original binary size.
-> if that is not okay, then the entire thing should not go into the repo without some other solution. As a newbie I would then need help to do it differently.