Upgrade ODP mainline to latest embassy-sync (non-reentrant blocking `Mutex`, `ThreadModeRawMutex` removed)

オープン
#60 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
embedded-iot

調査の方向性

Start by reviewing the pinned embassy git revisions in odp-embedded-controller’s dev-mcxa and dev-mec fork dependencies, then check the firmware lockfiles for embassy-sync versions. Update the pins when compatible releases are available and build the firmware; done means CI passes with one embassy-sync version per firmware lockfile and no removed APIs or feature references.

索引モデルが issue の本文から書いたものです。

説明

Background

embassy-rs/embassy#7634 (merged, not yet released) changes embassy-sync's blocking mutex:

  • ThreadModeMutex / ThreadModeRawMutex are removed.
  • The blocking Mutex is no longer reentrant: lock now gives &mut T, and locking the same mutex again from inside lock panics.
  • lock_mut and Mutex::borrow(cs) are removed (use lock, or critical_section::Mutex).
  • RawMutex is now implemented for any mutex_traits::ScopedRawMutex + ConstInit.
  • The std feature is removed.
  • A new portable PanicRawMutex is added. It panics on contention rather than being thread-mode-only.

Related embassy-sync changes in the same release: GenericAtomicWaker removed; AtomicWaker is now lock-free and requires re-registering the waker on every poll.

See the CHANGELOG.

Impact assessment (ODP default branches)

A reentrancy audit found no code that locks the same blocking mutex twice. Host unit tests pass unchanged against embassy main once the std feature is dropped (embedded-services 504, tps6699x 168, pcal6416a 59).

Repo Required change
embedded-services Drop embassy-sync "std" feature (6 Cargo.toml); Cortex-M GlobalRawMutex → PanicRawMutex; power_button example off ThreadModeRawMutex
embassy-imxrt time_driver/{ostimer,rtc}.rs: blocking_mutex::Mutex + borrow(cs) → critical_section::Mutex
embassy-npcx time_driver.rs: same as above; i2c_slave example off ThreadModeRawMutex
pcal6416a Drop "std" from embassy-sync dev-dependency
pico-de-gallo Bump from embassy-sync 0.7.2; replace ThreadModeRawMutex; needs matching embassy-rp / embassy-usb / postcard-rpc releases
odp-embedded-controller Bump pinned embassy git revs (dev-mcxa, dev-mec fork)
embedded-perfmon Bump pinned embassy git rev in examples/rtt
tps6699x, ec-slimloader, is31fl3743b No source change expected; version bump only

Also review: HAL futures that use AtomicWaker must call register() on every poll.

Plan

  1. Open draft PRs in each repo against embassy main (via [patch.crates-io]) to validate on CI.
  2. When embassy-sync is released, replace the patch with the released version and bump the rest of the embassy crates together.
  3. Merge in dependency order: HALs (embassy-imxrt, embassy-npcx) → drivers (tps6699x, pcal6416a) → embedded-services → platforms (odp-embedded-controller, pico-de-gallo, ec-slimloader).

Done when

  • All ODP repos build and pass CI on the released embassy-sync
  • No ThreadModeRawMutex / borrow(cs) / embassy-sync/std left
  • Only one embassy-sync version in each firmware lockfile

Draft PRs: (links added once created)

主要言語
Rust
スター
3
フォーク
8
平均マージ
7時間 51分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenDevicePartnership/odp-embedded-controller のほかの issue

OpenDevicePartnership/odp-embedded-controller の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。