2020-07-18 01:02 PM
Hello,
I'm using an stm32f429zit6's ADC in triple interleaved DMA mode. They're giving me 7.2 Msps currently.
The ADC is continuously running in circular mode and filling a buffer with a size of 3000.
So I wanted to find out the DMA buffer pointer when a trigger happens to later order the data before and after the trigger event properly.
I realize that the NDTR register in the DMA2Stream0 stores the required data for me, So to verify that I used the following lines in the ADC conversion complete callback function,
and expected to see 0 (or 2999 which is the buffer maximum length) for the Buffer_Addr_At_Trigger variable in the debug mode.
But it didn't give me a consistent value for the variable and instead I get some random value between 0 to 2999 from the register each time the debugger gets to the breakpoint.
What can be the issue?
void HAL_ADC_ConvCpltCallback (ADC_HandleTypeDef* hadc1) {
Buffer_Addr_At_Trigger = hdma_adc1.Instance->NDTR;
}
2020-07-18 01:13 PM
> But it didn't give me a consistent value for the variable and instead I get some random value between 0 to 2999 from the register
> each time the debugger gets to the breakpoint.
> What can be the issue?
> The ADC is continuously running in circular mode
JW
2022-04-22 08:05 AM
Did you manage to solve this?
2022-04-22 08:10 AM
I do not quite remember the issue at this moment,
But at the time I was working on this project:
https://github.com/mmahdim/stm32f4scope
It is now working and only needs a bit of code cleanup.