cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5A9 2D GPDMA Repeat Counter not working

JSGraaf
Associate II

Hello, 

I'm trying to use the repeat counter of the 2D GPDMA peripheral. However, when I configure this with CubeMX and run it, I can see that the BRC register is always at zero, while the BNDT register is set to the correct value. I've stepped through the initialization code and the node does have the correct parameters, they just don't get configured into the ADC on the HAL_DMAEx_List_Start_IT call in HAL_ADC_Start_DMA. I have also tried to configure it using linked list mode with the same parameters, which resulted in the same behaviour. The first "block" gets copied properly, it just never uses the repeat counter, remaining at the first block.

I know the ADC code is working fine since it runs fine when using non-2d addressing.

The Node Config that is retrieved in the HAL_ADC_Start_DMA call

JSGraaf_1-1749034961104.png

After the HAL_DMAEx_List_Start_IT call in HAL_ADC_Start_DMA

JSGraaf_0-1749034882953.png

CubeMX Config part 1

JSGraaf_3-1749035005939.png

CubeMX Config part 2

JSGraaf_2-1749034980931.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
JSGraaf
Associate II

I just realised that the LengthInBytes calculation overwrites the entire register, discarding any repeated block configuration. Leaving this thread here for future reference in case anyone else has this use case.

Line 2520 in stm32u5xx_hal_adc.c:

hadc->DMA_Handle->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = (uint32_t)LengthInBytes;

View solution in original post

1 REPLY 1
JSGraaf
Associate II

I just realised that the LengthInBytes calculation overwrites the entire register, discarding any repeated block configuration. Leaving this thread here for future reference in case anyone else has this use case.

Line 2520 in stm32u5xx_hal_adc.c:

hadc->DMA_Handle->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = (uint32_t)LengthInBytes;