Skip to content

Conversation

@andelf
Copy link
Collaborator

@andelf andelf commented Nov 30, 2025

Summary

Major refactoring to upgrade embassy ecosystem dependencies and add several new peripheral drivers.

Changes

Dependency Upgrades

  • Upgrade embassy-* crates to latest versions (0.5.x/0.7.x/0.9.x)
  • Upgrade hpm-metapac to latest snapshot
  • Upgrade hpm-riscv-rt to 0.3.0 (fully compatible to new riscv/riscv-rt)
  • Upgrade defmt to 1.0.1
  • Upgrade riscv/riscv-rt to 0.15.0

New Features

  • PWM: Add SimplePwm driver with type-safe channel enable methods
  • Timer (GPTMR): Add comprehensive timer driver with delay, compare, and capture modes
  • Embassy Time Driver: Add alternative time driver using GPTMR (feature: time-driver-gptmr0/1)
  • EWDG: Add watchdog driver for HPM5300/HPM6200/HPM6300/HPM6800/HPM6E00 series
  • UART: Add buffered and ring-buffered UART drivers with DMA support
  • USB: Refactor and add remote wakeup, force full-speed mode, and VBUS detection support

Refactoring

  • Refactor USB driver state management to avoid static mut
  • Rewrite MCHTMR-based embassy time driver
  • Improve DMA ringbuffer implementation

Fixes

  • Fix all examples to work with new APIs
  • Rust 2024 edition compatibility (#[unsafe(link_section)], static_mut_refs)

Platforms Tested

  • HPM5300EVK
  • HPM6200EVK
  • HPM6750EVKMini
  • HPM6E00EVK

Breaking Changes

  • Peripheral names: WDG0 -> EWDG0, wdg -> ewdg

@andelf andelf requested a review from HaoboGu November 30, 2025 05:25
Copy link
Contributor

@HaoboGu HaoboGu left a comment

Choose a reason for hiding this comment

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

lgtm!

@andelf andelf force-pushed the refactor/upgrade-embassy-and-deps branch from 93702f4 to ce89bb8 Compare December 3, 2025 16:54
@andelf andelf force-pushed the refactor/upgrade-embassy-and-deps branch from 38d10f3 to c827b9d Compare December 5, 2025 08:33
@andelf andelf changed the title Refactor: upgrade embassy and other deps Refactor: upgrade embassy ecosystem and add new peripheral drivers Dec 5, 2025
@andelf andelf force-pushed the refactor/upgrade-embassy-and-deps branch from 0c31d5f to 9c33d2f Compare December 5, 2025 09:09
@HaoboGu
Copy link
Contributor

HaoboGu commented Dec 5, 2025

Let's gooooooooooooooooooo

@HaoboGu HaoboGu merged commit 620f58d into master Dec 5, 2025
1 check passed
@andelf andelf deleted the refactor/upgrade-embassy-and-deps branch December 5, 2025 12:08
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.

3 participants