Skip to main content
Visitor II
November 11, 2024
Solved

How to change DMA srcAddress

  • November 11, 2024
  • 1 reply
  • 807 views

I’ve created a SPI peripheral as a slave in transmit-only mode. It operates in circular mode DMA and generates a complete callback every 20 milliseconds. Upon receiving the complete callback, I want to modify the source address of the DMA request.Currently, I achieve this by aborting the SPI and then initiating a new DMA transfer with the updated address configuration.

 

Why do I need to change the DMA Source Address?I’m implementing a ring buffer pointer.

 

 

Note: I’ve utilized the HAL framework for this implementation.

 

 

 

 

 

    This topic has been closed for replies.
    Best answer by KnarfB

    For that, use double-buffer mode. Not available in all series/MCUs but at least in (most?) H7, see RM0455 Reference manual.

    Covered in stm32h7xx_hal_dma_ex.h HAL_DMAEx_MultiBufferStart_IT, HAL_DMAEx_ChangeMemory.

    hth

    KnarfB

    1 reply

    KnarfBAnswer
    Super User
    November 11, 2024

    For that, use double-buffer mode. Not available in all series/MCUs but at least in (most?) H7, see RM0455 Reference manual.

    Covered in stm32h7xx_hal_dma_ex.h HAL_DMAEx_MultiBufferStart_IT, HAL_DMAEx_ChangeMemory.

    hth

    KnarfB