Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stm32] H7 DMA + DMA data fixes + fix DAC DMA #772

Merged
merged 11 commits into from
Dec 31, 2021

Conversation

chris-durand
Copy link
Member

@chris-durand chris-durand commented Oct 30, 2021

This adds support for H7 DMA. The device data has to be fixed first. H7 devices use the same DMA IP as F4/F7 devices but use the DMAMUX peripheral for request multiplexing.

The updates in modm-devices fix broken DMA request data for many G0, L4, H7 and WL devices.

  • Adapt DMA driver for H7
  • Fix requests mappings in modm-devices data
  • Handling for L4+ DMAMUX data with shared request for two peripherals (DCMI/PSSI)
  • Fix DAC DMA driver for F2, F4, F7, H7
  • Add DAC DMA example if missing and test
    • G4
    • H7
    • L4
    • F4
    • F7
  • Test H7 DMA

@chris-durand chris-durand changed the title [stm32] Support for H7 DMA [stm32] ´H7 DMA Oct 31, 2021
@chris-durand chris-durand changed the title [stm32] ´H7 DMA [stm32] H7 DMA + DMA data fixes Oct 31, 2021
@chris-durand chris-durand added the ci:hal Triggers the exhaustive HAL compile CI jobs label Nov 1, 2021
@chris-durand
Copy link
Member Author

chris-durand commented Dec 8, 2021

DMA is working on H7 but I there is an issue with the DAC DMA driver on H7 and, most likely, also on F2, F4 and H7.

On STMG4 the DAC DMA driver only works if the 16 bit samples are written as a 32 bit transfer. When both memory and peripheral sizes are set to "Half-Word" (16 bit) nothing happens.
The stream-channel DMA IP will however force FIFO mode when peripheral and data sizes don't match. Thus, it writes one sample to each half of the data register instead of zero-extending the 16 bit sample to 32 bit as it happens on STM32G4. That results in only every second sample being output by the DAC and the second half of the output is garbled data.

I will add DAC DMA examples for every STM32 series I have a devboard at home of, test what works and fix the driver.

@chris-durand chris-durand changed the title [stm32] H7 DMA + DMA data fixes [stm32] H7 DMA + DMA data fixes + fix DAC DMA Dec 8, 2021
@chris-durand chris-durand added this to the 2021q4 milestone Dec 8, 2021
@chris-durand
Copy link
Member Author

DAC DMA is now also working on F4. F3 is not working yet, L4 and F7 are untested.

@chris-durand chris-durand force-pushed the feature/stm32h7_dma branch 2 times, most recently from 9558701 to 51d58b3 Compare December 30, 2021 15:08
@chris-durand
Copy link
Member Author

@salkinium If the CI succeeds, this is ready to be merged for the release. H7 DMA is working fine and I tested the DAC DMA driver on all platforms listed above. As I don't have the F3 board with me I could not test that one. The device data fix should go first.

@chris-durand chris-durand marked this pull request as ready for review December 30, 2021 15:17
@chris-durand chris-durand mentioned this pull request Dec 30, 2021
15 tasks
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

Very nice as always! I'll merge it tomorrow afternoon.

@chris-durand chris-durand added ci:hal Triggers the exhaustive HAL compile CI jobs and removed ci:hal Triggers the exhaustive HAL compile CI jobs labels Dec 30, 2021
@salkinium salkinium merged commit e3c0321 into modm-io:develop Dec 31, 2021
@chris-durand chris-durand deleted the feature/stm32h7_dma branch December 31, 2021 16:16
@rleh rleh mentioned this pull request Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced 🤯 ci:hal Triggers the exhaustive HAL compile CI jobs example 🔑 feature 🚧
Development

Successfully merging this pull request may close these issues.

2 participants