2025-06-04 4:05 AM
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
After the HAL_DMAEx_List_Start_IT call in HAL_ADC_Start_DMA
CubeMX Config part 1
CubeMX Config part 2
Solved! Go to Solution.
2025-06-04 4:15 AM
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;
2025-06-04 4:15 AM
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;