Skip to content

Add CH32 EXTI wait smoke and split Embassy runtime metadata - #70

Merged
Alan-Jowett merged 6 commits into
mainfrom
alanjo/exti-wait-smoke-park
Jul 16, 2026
Merged

Add CH32 EXTI wait smoke and split Embassy runtime metadata#70
Alan-Jowett merged 6 commits into
mainfrom
alanjo/exti-wait-smoke-park

Conversation

@Alan-Jowett

Copy link
Copy Markdown
Owner

Summary

  • add the CH32V203 Embassy EXTI wait hardware smoke harness
  • gate generated Embassy GPIO wait metadata behind gpio-async-wait
  • split generated Embassy APIs into lean *RuntimeResources constructor inputs and separate *MetadataResources inspection surfaces to keep metadata out of production firmware paths

Validation

  • cargo test generate_embassy -- --nocapture
  • cargo clippy --all-targets -- -D warnings
  • powershell -ExecutionPolicy Bypass -File evidence\wch\ch32v203g6u6\generated\embassy-exti-wait-smoke\build-smoke-bin.ps1 -Release
  • powershell -ExecutionPolicy Bypass -File evidence\wch\ch32v203g6u6\generated\embassy-watchdog-smoke\build-smoke-bin.ps1 -Release
  • powershell -ExecutionPolicy Bypass -File evidence\wch\ch32v203g6u6\generated\embassy-adc-dma-smoke\build-smoke-bin.ps1 -Release

Fixes #59

Copilot AI review requested due to automatic review settings July 16, 2026 15:54
Alan Jowett and others added 3 commits July 16, 2026 08:59
Add the PA7/USB CDC EXTI wait smoke project, regenerate the CH32 Embassy output for async wait support, and document the new validation artifact. The smoke build is currently parked because CH32 USB-based smoke images overflow the 32 KB flash budget after the HAL growth.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

# Conflicts:
#	README.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
@Alan-Jowett
Alan-Jowett force-pushed the alanjo/exti-wait-smoke-park branch from 63f8e87 to 94d0649 Compare July 16, 2026 15:59
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the HAIR Embassy generator/contracts to support CH32 EXTI-backed async GPIO waits (via embedded_hal_async::digital::Wait), adds a CH32 hardware smoke harness for EXTI waits, and reworks generated Embassy HAL crates to (1) gate peripheral families behind opt-in Cargo features and (2) split “runtime constructor inputs” from richer metadata inspection surfaces to keep metadata out of firmware hot paths.

Changes:

  • Add an explicit gpioExtiWaitBindings profile/schema contract (plus embedded-hal-async-wait capability tag) to authorize EXTI-backed edge waits only when fully bound.
  • Update generated Embassy HAL crates to use opt-in features per family/capability and split *RuntimeResources vs *MetadataResources.
  • Add embassy-exti-wait-smoke packaging + validation documentation for CH32V203G6U6 EXTI wait hardware smoke.

Reviewed changes

Copilot reviewed 7 out of 101 changed files in this pull request and generated no comments.

Show a summary per file
File Description
specs/validation.md Documents new validation expectations (feature gating, runtime/metadata split, EXTI wait contract) and adds EXTI wait smoke packaging step.
specs/requirements.md Adds normative requirements for explicit EXTI wait bindings and feature/metadata size boundaries.
specs/design.md Expands design rationale for EXTI wait lowering and size-oriented feature/API partitioning.
schema/profiles/embassy-hal.json Adds gpioExtiWaitBindings / gpioExtiWaitLineBinding schema definitions and hooks them into the Embassy HAL profile.
README.md Updates CH32 device row to reflect presence of multiple hardware smoke harnesses including EXTI wait packaging.
docs/embassy-hal-profile.md Updates the Embassy profile contract to include EXTI wait and runtime/metadata API-shape partitioning expectations.
docs/cli.md Updates CLI contract to include opt-in features and explicit EXTI wait lowering requirements.
evidence/wch/ch32v203g6u6/generated/embassy/Cargo.toml Adds opt-in [features] surface and makes deps optional so families/capabilities can be compiled out.
evidence/wch/ch32v203g6u6/generated/embassy/src/lib.rs Gates peripheral modules behind corresponding Cargo features.
evidence/wch/ch32v203g6u6/generated/embassy/src/metadata.rs Adds embedded_hal::digital::Error impl for metadata Error when relevant features are enabled.
evidence/wch/ch32v203g6u6/generated/embassy/src/adc.rs Splits *Resources into *RuntimeResources + *MetadataResources and updates constructors/metadata access.
evidence/wch/ch32v203g6u6/generated/embassy/src/dma.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/flash.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/gpio.rs Adds/gates async-wait lowering and updates resources API shape (also contains the new wait poll logic).
evidence/wch/ch32v203g6u6/generated/embassy/src/i2c.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/interrupt.rs Same runtime/metadata resource split as above; exposes interrupt routes via metadata accessor.
evidence/wch/ch32v203g6u6/generated/embassy/src/pwm.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/rcc.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/rtc.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/spi.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/time.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/timer.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/uart.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/usb.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy/src/watchdog.rs Same runtime/metadata resource split as above.
evidence/wch/ch32v203g6u6/generated/embassy-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-usb-cdc-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-usb-cdc-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-usb-cdc-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-watchdog-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-watchdog-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-watchdog-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-rtc-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-rtc-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-rtc-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-pwm-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-pwm-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-pwm-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-neopixel-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-neopixel-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-neopixel-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-flash-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES.
evidence/wch/ch32v203g6u6/generated/embassy-flash-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-flash-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-adc-dma-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES (removes local fake resource consts).
evidence/wch/ch32v203g6u6/generated/embassy-adc-dma-smoke/Cargo.toml Enables only required HAL features for this smoke.
evidence/wch/ch32v203g6u6/generated/embassy-adc-dma-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/wch/ch32v203g6u6/generated/embassy-exti-wait-smoke/src/main.rs New CH32 EXTI wait hardware smoke harness using GPIO waits over USB CDC + timeouts.
evidence/wch/ch32v203g6u6/generated/embassy-exti-wait-smoke/Cargo.toml New smoke crate manifest enabling required HAL features (gpio + gpio-async-wait + usb + etc).
evidence/wch/ch32v203g6u6/generated/embassy-exti-wait-smoke/memory.x Memory layout for the new flashable EXTI wait smoke.
evidence/wch/ch32v203g6u6/generated/embassy-exti-wait-smoke/build.rs Links link.x and wires memory.x via link search path.
evidence/wch/ch32v203g6u6/generated/embassy-exti-wait-smoke/.cargo/config.toml Targets riscv32imc-unknown-none-elf and supplies linker arg for memory.x.
evidence/wch/ch32v203g6u6/generated/embassy-exti-wait-smoke/build-smoke-bin.ps1 New packaging script to build and emit a .bin for flashing.
evidence/texas-instruments/lm3s6965/generated/embassy/Cargo.toml Adds opt-in features and optional deps for size-oriented gating.
evidence/texas-instruments/lm3s6965/generated/embassy/src/lib.rs Gates peripheral modules behind features.
evidence/texas-instruments/lm3s6965/generated/embassy/src/rcc.rs Splits runtime vs metadata resources.
evidence/texas-instruments/lm3s6965/generated/embassy/src/interrupt.rs Splits runtime vs metadata resources; route list moved to metadata accessor.
evidence/texas-instruments/lm3s6965/generated/embassy/src/i2c.rs Splits runtime vs metadata resources.
evidence/texas-instruments/lm3s6965/generated/embassy/src/spi.rs Splits runtime vs metadata resources.
evidence/texas-instruments/lm3s6965/generated/embassy/src/time.rs Splits runtime vs metadata resources; route list moved to metadata accessor.
evidence/texas-instruments/lm3s6965/generated/embassy/src/timer.rs Splits runtime vs metadata resources.
evidence/texas-instruments/lm3s6965/generated/embassy/src/uart.rs Splits runtime vs metadata resources.
evidence/texas-instruments/lm3s6965/generated/embassy-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES and static interrupt route accessors.
evidence/texas-instruments/lm3s6965/generated/embassy-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/st/stm32f405rgt6/generated/embassy/Cargo.toml Adds opt-in features and optional deps for size-oriented gating.
evidence/st/stm32f405rgt6/generated/embassy/src/lib.rs Gates peripheral modules behind features.
evidence/st/stm32f405rgt6/generated/embassy/src/interrupt.rs Splits runtime vs metadata resources; route list moved to metadata accessor.
evidence/st/stm32f405rgt6/generated/embassy/src/i2c.rs Splits runtime vs metadata resources.
evidence/st/stm32f405rgt6/generated/embassy/src/spi.rs Splits runtime vs metadata resources.
evidence/st/stm32f405rgt6/generated/embassy/src/time.rs Splits runtime vs metadata resources; route list moved to metadata accessor.
evidence/st/stm32f405rgt6/generated/embassy/src/uart.rs Splits runtime vs metadata resources.
evidence/st/stm32f405rgt6/generated/embassy/src/usart.rs Splits runtime vs metadata resources.
evidence/st/stm32f405rgt6/generated/embassy-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES and static interrupt route accessors.
evidence/st/stm32f405rgt6/generated/embassy-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.
evidence/espressif/esp32-c3fn4/generated/embassy/Cargo.toml Adds opt-in features and optional deps for size-oriented gating.
evidence/espressif/esp32-c3fn4/generated/embassy/src/lib.rs Gates peripheral modules behind features.
evidence/espressif/esp32-c3fn4/generated/embassy/src/adc.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy/src/gpio.rs Splits runtime vs metadata resources and removes per-pin metadata retention from runtime pin types.
evidence/espressif/esp32-c3fn4/generated/embassy/src/i2c.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy/src/interrupt.rs Splits runtime vs metadata resources; route list moved to metadata accessor.
evidence/espressif/esp32-c3fn4/generated/embassy/src/rcc.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy/src/spi.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy/src/time.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy/src/uart.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy/src/usb.rs Splits runtime vs metadata resources.
evidence/espressif/esp32-c3fn4/generated/embassy-smoke/src/main.rs Updates smoke to use *_RUNTIME_RESOURCES and static interrupt route accessors.
evidence/espressif/esp32-c3fn4/generated/embassy-usb-smoke/src/main.rs Updates USB smoke to use *_RUNTIME_RESOURCES.
evidence/espressif/esp32-c3fn4/generated/embassy-smoke/Cargo.lock Lockfile updates reflecting optional-dep feature selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 16, 2026 16:03
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 102 changed files in this pull request and generated 1 comment.

Comment thread README.md Outdated
Copilot AI review requested due to automatic review settings July 16, 2026 16:10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 102 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 16, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 102 changed files in this pull request and generated no new comments.

@Alan-Jowett
Alan-Jowett merged commit fdf6484 into main Jul 16, 2026
6 checks passed
@Alan-Jowett
Alan-Jowett deleted the alanjo/exti-wait-smoke-park branch July 16, 2026 16:25
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.

Add CH32V203 Embassy HAL lowering for EXTI

2 participants