apache / apache/nuttx

[FEATURE] STM32H5 DMA Driver

Open
#16,248 7 comments 1 reaction 0 assignees View on GitHub
Type: Enhancement
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

### Is your feature request related to a problem? Please describe.

I am working on adding support for DMA on the STM32H5 architecture. The H5 uses the GPDMA peripheral, which is unlike any of the STM DMA peripherals with drivers implemented in NuttX (The GPDMA peripheral is shared between STM32H5, STM32H7Rx/7Sx, STM32U5, STM32U3).

The GPDMA peripheral is powerful but quite a bit more complex than other STM DMA implementations. For anything beyond a simple one-shot transfer, it requires programming a linked-list data structure into memory.

I am opening this ticket to get feedback on what solution might fit best in NuttX.

### Describe the solution you'd like

There are two directions I have considered:

**First:** Give full control over channel registers for configuration.

- Pros: Flexibility and simpler DMA driver implementation.
- Cons: Added complexity when using DMA driver. e.g. ADC driver would need to allocate a linked list item in memory to do a circular DMA transfer.

**Second:** Abstract away registers by using a 'behavior' configuration (e.g. Just select 'circular mode' instead of having to go through creating the entire linked list item configuration).

- Pros: Interface similar to current DMA implementations. Simpler usage from other drivers. e.g. ADC driver tells DMA 'use circular' and the DMA driver handles linked list item allocation and configuration.
- Cons: Less flexible and more complex DMA driver implementation. DMA driver may require future work if a peripheral needs more advanced features such as 2D addressing or in-transit data manipulation.

### Describe alternatives you've considered

_No response_

### Verification

- [x] I have verified before submitting the report.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.