Skip to main content
Visitor II
December 5, 2024
Solved

Issue with STM32U5 GPDMA triggered by TIM2 to xfr towards GPIO

  • December 5, 2024
  • 1 reply
  • 1108 views

Hi all,

 I am using STM32U575ZIT nucleo board. 

My goal is to write ODR register of GPIOD by using GPDMA transfer, using TIM2 to trigger the memory-to-peripheral transfer.

In this "test" script, I use a 2-elements source array to force ODR all high and then all low. I want this operation to be continuous, hence the GPDMA is configured in circular mode.

The configurations of TIM and GPDMA are attached as PNG, while the code lines in the main.c are the following:

TIM2->DIER = TIM2->DIER|TIM_DIER_UDE;
TIM2->DIER = TIM2->DIER|TIM_DIER_TDE;
uint16_t prova[2] = {0xFFFF, 0x0000};
HAL_DMA_Start(&handle_GPDMA1_Channel0, (uint32_t)prova, (uint32_t)&(GPIOD->ODR), 4);

HAL_TIM_OC_Start(&htim2,TIM_CHANNEL_1);

What I see is that the timer signal is correct (1Hz freq), but the GPDMA seems not working (ODR never written)

I think one of the main problem is that it's not clear to me yet the difference between trigger and request.

Could you please help me? Thanks

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello and sorry for the late answer.

    Unfortunately you didn't provide your complete config but I created a project were DMA is performing a transfer of 256 patterns (bytes) to GPIOD on NUCLEO-U575 (just PD0 to PD7). The patterns are the numbers from 0 to 255.

    Attached a project were TIM32_TRGO is triggering the DMA for the data transfer.

    These are the signals on PD0 to PD7:

    scope_0.png

    Hope that answers your question.

    1 reply

    mƎALLEmAnswer
    Technical Moderator
    January 21, 2025

    Hello and sorry for the late answer.

    Unfortunately you didn't provide your complete config but I created a project were DMA is performing a transfer of 256 patterns (bytes) to GPIOD on NUCLEO-U575 (just PD0 to PD7). The patterns are the numbers from 0 to 255.

    Attached a project were TIM32_TRGO is triggering the DMA for the data transfer.

    These are the signals on PD0 to PD7:

    scope_0.png

    Hope that answers your question.