Update to latest embassy-sync (non-reentrant blocking `Mutex`, `ThreadModeRawMutex` removed)

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
embedded-iot

Research direction

Start with src/time_driver.rs and examples/src/bin/i2c_slave.rs, then review the AtomicWaker users listed in the issue: uart, i2c, spip, miwu, and timer. Update the embassy-sync dependencies in both Cargo manifests and check each affected call site against the upstream changelog. The issue reports that cargo check --features rt,time-driver-mft16-1 passes for thumbv7em-none-eabihf; use that check to verify the changes.

Written by the indexing model from the issue text.

Description

  • src/time_driver.rs uses Mutex::borrow(cs), which is removed. Switch alarm/queue to critical_section::Mutex<_> (no logic change).
  • examples/src/bin/i2c_slave.rs: replace Signal<ThreadModeRawMutex, ()> (removed).
  • Review AtomicWaker users (uart, i2c, spip, miwu, timer): the waker must be re-registered on every poll.
  • Bump embassy-sync in Cargo.toml and examples/Cargo.toml.

Prototype: with the change above, cargo check --features rt,time-driver-mft16-1 passes for thumbv7em-none-eabihf.

Part of OpenDevicePartnership/odp-embedded-controller#60. Upstream: embassy-rs/embassy#7634 (CHANGELOG).

Dominant language
Rust
Stars
1
Forks
4
Avg merge
21h 9m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenDevicePartnership/embassy-npcx

All issues in OpenDevicePartnership/embassy-npcx

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.