XMC4700 GPDMA DSD Update Destination Address

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello everyone,

I'm trying to setup a GPDMA transfer from the result register RESM of the DSD Module into a predefined array.
I configured the DMA_CH as follows

2708.attach

The transfer is triggered by the DS_ADC Channel_A main filter result event.

I would like to update the destination address after 20 results have been written in the array, so that I always have the last 20 results of the DSD available.
I'm doing this in a interrupt with a frequency 20 times slower than the frequency of the DSD results.

// Globals
uint16_t rx_buffer[20];
uint32_t *rx_ptr;
uint32_t *tx_ptr;
uint8_t block_count=0;

int main(void)
{
...
tx_ptr = (uint32_t*)&(DS_ADC_DEMOD_0_CHANNEL_A->RESM);
rx_ptr = (uint32_t*)&rx_buffer[0];
...
DS_ADC_DEMOD_Start(&DS_ADC_DEMOD_0);
DMA_CH_Enable(&DMA_CH_0);
...
}

// interrupt handler
void user_IRQHandler_dma(void)
{
DMA_CH_SetDestinationAddress(&DMA_CH_0, (uint32_t)&rx_buffer[0]);
DMA_CH_Reload(&DMA_CH_0);
DMA_CH_Enable(&DMA_CH_0);
}


Unfortunately, every time I update the destination Address, the DMA channel stops working.
Does anyone has any idea why is this happening and how can I get it to work?
I would appreciate your thoughts.

Regards,
Sebastian
0 Likes
0 Replies