Skip to content

odin: enable nusb smol feature on native targets - #54

Open
arter97 wants to merge 1 commit into
topjohnwu:mainfrom
arter97:nusb
Open

arter97 wants to merge 1 commit into
topjohnwu:mainfrom
arter97:nusb

Conversation

@arter97

@arter97 arter97 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Commit f0d40a0 ("odin: make USB transport and flashing async") replaced nusb's blocking .wait() calls with .await. On native targets, nusb implements open(), detach_and_claim_interface(), clear_halt() and friends as blocking syscalls, and awaiting them without the smol or tokio feature panics:

Awaiting blocking syscall without an async runtime: enable the
smol or tokio feature of nusb.

Enable the smol feature for non-wasm targets so these calls run on the blocking thread pool, which works with any executor including the futures block_on used by the CLI. WebUSB on wasm is unaffected.

Assisted-by: Claude:claude-opus-5-5

Commit f0d40a0 ("odin: make USB transport and flashing async")
replaced nusb's blocking .wait() calls with .await. On native targets,
nusb implements open(), detach_and_claim_interface(), clear_halt() and
friends as blocking syscalls, and awaiting them without the smol or
tokio feature panics:

  Awaiting blocking syscall without an async runtime: enable the
  `smol` or `tokio` feature of nusb.

Enable the smol feature for non-wasm targets so these calls run on the
blocking thread pool, which works with any executor including the
futures block_on used by the CLI. WebUSB on wasm is unaffected.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
@arter97

arter97 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Had this happen to me:

$ samloader flash --skip-md5 -b BL_F946NKSU6HZIJ_F946NKSU6HZIJ_MQB115382722_REV00_user_low_ship_MULTI_CERT.tar -a AP_F946NKSU6HZIJ_F946NKSU6HZIJ_MQB115382722_REV00_user_low_ship_MULTI_CERT_meta_OS17.tar -c CP_F946NKSU6HZIJ_CP36624285_MQB115382722_REV00_user_low_ship_MULTI_CERT.tar -s HOME_CSC_OKR_F946NOKR6HZIJ_MQB115382722_REV00_user_low_ship_MULTI_CERT.tar 
Skipping persist.img.lz4 (not in download-list.txt)
Skipping userdata.img.lz4 (not in download-list.txt)
Skipping misc.bin.lz4 (not in download-list.txt)
Skipping meta-data/ (not in download-list.txt)
Skipping meta-data/fota.zip (not in download-list.txt)
Skipping meta-data/ (not in download-list.txt)

thread 'main' (3043333) panicked at /home/arter97/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nusb-0.2.7/src/maybe_future.rs:139:13:
Awaiting blocking syscall without an async runtime: enable the `smol` or `tokio` feature of nusb.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant