cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with STM32U5 GPDMA triggered by TIM2 to xfr towards GPIO

BANIDA
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

View solution in original post

1 REPLY 1
SofLit
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.