Skip to content

Conversation

kyp44
Copy link
Contributor

@kyp44 kyp44 commented Jul 14, 2025

Summary

As part of the clock::v2 effort tracked in Issue #912, this PR updates the dsu to use the clock::v2 API by requiring ownership of its AhbClk and ApbClk. Note that this peripheral is only on thumbv7 targets.

The following Tier 1 BSP examples are now broken and cannot be fixed until the noted peripherals are also migrated and merged (see the notes about this in Issue #912):

  • feather_m4/nvm_dsu (usb::UsbBus)

Checklist

  • All new or modified code is well documented, especially public items
  • No new warnings or clippy suggestions have been introduced - CI will deny clippy warnings by default! You may #[allow] certain lints where reasonable, but ideally justify those with a short comment.

@rnd-ash
Copy link
Contributor

rnd-ash commented Jul 19, 2025

@kyp44 regarding the broken example, I believe this can be worked around as clock::V2 clocks have a .into() method to convert them into their V1 counterparts

@kyp44
Copy link
Contributor Author

kyp44 commented Jul 19, 2025

@rnd-ash The conversion to the v1 types does not help here because usb::UsbBus::new requires a &mut Mclk, which is not possible to pass when using v2 because the Mclk is consumed by clock::v2::clock_system_at_reset to use the v2 API.

@rnd-ash
Copy link
Contributor

rnd-ash commented Jul 19, 2025

Ah right, in this case I personally was calling unsafe to steal mclk .... But you are right, it's probably best to avoid an unsafe block in our examples

Dan Whitman and others added 2 commits September 30, 2025 07:57
* `Dsu::new` now requires ownership of its `AhbClk` and `ApbClk`.
* Adds the `Dsu::free` method to free the `pac::Dsu` and bus clocks.
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.

2 participants