cancel
Showing results for 
Search instead for 
Did you mean: 

Differences between GPDMA request and trigger in STM32U5

diverger
Senior

Hi,

In STM32U5, the GPDMA has both request sources and trigger sources, what's the difference between them?

Thanks.

7 REPLIES 7
STOne-32
ST Employee

Dear @diverger ,

Here is a specific Application note on our GPDMA :https://www.st.com/resource/en/application_note/an5593-how-to-use-the-gpdma-for-stm32-mcus-stmicroelectronics.pdf

You can go to Page 7 for the GPDMA Request that can by software or triggered by hardware for peripherals.

let us know what is your specific need or software example to better support.

Hope it helps ,

STOne-32

Hi,

I want to read from an external ADC with SPI interface. As I need a stable sample interval, so I need to use a timer to kick the readings continuously. So, my plan is to use a timer to trigger a SPI RX DMA. But there is not enough information about how to implement this on STM32U5. Any suggestions, is it possible?

Thanks.

ThierryV
Associate II

Hi, I'm also confused between trigger and request events, especially as they don't share the same sources.

 

The page 7 of the Application Note doesn't really help me.

But the figure 67 of the Reference Manual (RM0456, #17.4.13, rev5) is very interresting.

What I understand is that Request Events trigger the transfer of a single piece of data (single or burst), while Trigger Events request the initiation of the whole sequence. Right?

But what's happen if there are request events without any trigger? No transfer?

 

My use case is to sequentially copy a table to a GPIO port (and the section 3.7 of the application note is very short).

  1. For parallel communication with external devices
  2. For software PWMs (there isn't enough timer channels available in STOP 2, I need them for other purposes)

For (1), I need to start the frame transfer by software, while for (2), I need a continuously repeated sequence.

For both, I need a clock (typically a timer) to copy each cells of the table at the expected speed.

Unfortunately, software "event" is only available as a Request (through SWREQ), while there is very few timer sources available under Request events, for the LPDMA1 (lptim1_ue_dma and lptim3_ue_dma, but I use these timers for other purpose. I'm looking for LPTIM4, which is only available as a Trigger).

Alternatively, I can try to start the sequence via software by enabling the DMA channel, and trigger the transfer of a block of a single cell with lptim4_out. But I need the source address is automatically incremented and never reseted, untile the end of my table.

 

Otherwise, the transmission speed for (1) could be very fast (up to 200ns per cell, but above all no less) and without any constant rate contraints, since my table contains its own external clock. So, maybe I can try to tune the AHB clock bus to match that speed?

 

Thanks.

 

 

Hi,

IMO, the 'trigger source' is just an event to fire the DMA xfr, but has no data path to the DMA. But the 'request' is what will also source/sink data to the DMA.

Regards.

ThierryV
Associate II

OK. This is what I need. A fire to trigger the copy of the next cell to the port. The data isn't related the timer.

In opposit to an UART for exemple, where the peripheral has the event and the data (maybe an handshake/acknowledge mecanism under a "Request"?).

Hello @diverger  and all,

 

I'm interested in this topic since I am working on a very similar thing. 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

Hi,

In your case, the DMA channel is between ODR and memory space, and the timer is only a 'trigger' source. So I think you shouldn't set the timer update event as the request source. And I don't find a request source from ODR, so the most relevant one should be 'SoftWare'. If I'm right, there should be an API function to accept your data address in memory and the address of the ODR, and link them to the DMA. Then the timer event will trigger the xfr for you. Sorry for that I have no time to confirm my idea, but you can try it and see what will happen.

Regards.