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 uart/spi/adc: support DMA when CONFIG_MEM_ATTR=n #87757

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

etienne-lms
Copy link
Collaborator

@etienne-lms etienne-lms commented Mar 27, 2025

Explicit that some configurations of the STM32 ADC, SPI and UART drivers require CONFIG_MEM_ATTR=y.

(edited)
Allow STM32 SPI/ADC/UART/I2C drivers to operate with DMA support even when CONFIG_MEM_ATTR is disabled which happen when CONFIG_ARM_MPU is intentionally disabled despite the CPU supports MPU.
By the way, remove some #ifdef directive on header files inclusion that add noise in the header file inclusion section without any benefit.

These changes do not fix existing issues but are proposed to prevent later issues, as mentioned in #87681 (comment).

@github-actions github-actions bot added platform: STM32 ST Micro STM32 area: UART Universal Asynchronous Receiver-Transmitter area: ADC Analog-to-Digital Converter (ADC) area: SPI SPI bus labels Mar 27, 2025
@JarmouniA JarmouniA requested a review from nordicjm March 27, 2025 14:07
Copy link
Collaborator

@JarmouniA JarmouniA left a comment

Choose a reason for hiding this comment

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

@etienne-lms @erwango Another idea, let's just guard the cache management code that uses mem attributes with CONFIG_MEM_ATTR, and make it possible to use DMA with DCache but without mem attributes. Nocache region can still be used via CONFIG_NOCACHE_MEMORY for example.

@etienne-lms
Copy link
Collaborator Author

Right, good idea. I'll update accordingly.

erwango
erwango previously approved these changes Mar 27, 2025
Allow STM32 UART driver to operate with DMA support even when
CONFIG_MEM_ATTR is disabled which happen when CONFIG_ARM_MPU is
intentionally disabled despite the CPU supports MPU.

By the way, remove some #ifdef directive on header files inclusion
that add noise in the header file inclusion section without any
benefit.

Signed-off-by: Etienne Carriere <[email protected]>
Allow STM32 SPI driver to operate with DMA support even when
CONFIG_MEM_ATTR is disabled which happen when CONFIG_ARM_MPU is
intentionally disabled despite the CPU supports MPU.

By the way, remove some #ifdef directive on header files inclusion
that add noise in the header file inclusion section without any
benefit.

Signed-off-by: Etienne Carriere <[email protected]>
Allow STM32 ADC driver to operate with DMA support even when
CONFIG_MEM_ATTR is disabled which happen when CONFIG_ARM_MPU is
intentionally disabled despite the CPU supports MPU.

By the way, remove some #ifdef directive on header files inclusion
that add noise in the header file inclusion section without any
benefit. Also remove inclusion of zephyr/arch/cache.h that is not
needed at all.

Signed-off-by: Etienne Carriere <[email protected]>
Allow STM32 I2C driver v2 to operate with DMA support even when
CONFIG_MEM_ATTR is disabled which happen when CONFIG_ARM_MPU is
intentionally disabled despite the CPU supports MPU.

By the way, remove a #ifdef directive on header files inclusion
that adds noise in the header file inclusion section without any
benefit.

Signed-off-by: Etienne Carriere <[email protected]>
@etienne-lms
Copy link
Collaborator Author

Rebased (to fix merge conflict).

@etienne-lms etienne-lms changed the title stm32 uart/spi/adc: explicit CONFIG_MEM_ATTR is required where needed stm32 uart/spi/adc: support DMA when CONFIG_MEM_ATTR=n Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: I2C area: SPI SPI bus area: UART Universal Asynchronous Receiver-Transmitter platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants