Repository navigation
arch/arm/stm32h5: Add DAC support - #20891
Merged
Merged
Conversation
Copy DAC support from STM32H7 with no DMA or timer control and accounting for the differences between the H7 and H5 Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Darryl Ring <[email protected]>
This adds a new board configuration enabling the DAC channel 2 (connected to PA5). Channel 1 cannot be used on this board because it is used to sense the VBUS voltage through a voltage divider Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Darryl Ring <[email protected]>
darrylring
requested review from
jerpelea,
linguini1,
raiden00pl and
simbit18
as code owners
October 22, 2026 16:39
xiaoxiang781216
approved these changes
Oct 22, 2026
acassis
approved these changes
Oct 22, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Copy DAC support from STM32H7 with no DMA or timer control and accounting for the minor differences between the H7 and H5.
I do have DMA and timer support working, but it requires changes to the GPDMA driver itself, and I think it's worth evaluating those changes separately. Testing is still ongoing there. No other STM32 family with the GPDMA peripheral has DAC support in NuttX yet. I think this will be able to support the U5, U3, and C5 as well, but I'm not able to test those.
This first change is small and low risk.
NOTE: The STM32H5 errata sheet indicates that the DAC output may not work if the DAC kernel clock is not HCLK. I hit this issue in my testing, so an compile-time error has been added to save people from similar frustration.
Impact
No impact to existing users, since this is a new feature.
Testing
A
dacconfig has been added to the NUCLEO-H563ZI board and the output has been checked using thedacNSH builtin on pin PA5 (CN7 pin 10, labeled SCK D13).