ADC not filling all the buffer with DMA
Hi, I'm using a Nucleo-H723 board and I need to sample 4 ADC's with variable sampling rate, maximum 1Mbps.
I configure the TMR2 with the time stamp (10ms, 1ms, 10ms, etc...), and TMR3 with the sampling rate that is the input for the ADC trigger.
Values of TMR2 and TMR3 are updated via DMA when TMR2 have an Event (I tested this isolated and is working fine).
Values from ADC are transfer to the buffer via DMA.
I'm having some problems...
The 4 first values of the buffer are always feeded by 0.
And the buffer is only being feeded up to 30463 position when I have a full dma transfer call back (HAL_ADC_ConvCpltCallback). I even let the DMZ in Circular mode, and not disabling the timers, but is all the same data position being populated.
I tested isolated the TMR2 - TMR3 DMA, and they are working fine the change on the Period value.
Someone has any idea of what's happening?
The code is doing nothing else, I'm just trying to implement this transfer Ok before go a head.
I used on USB Device example to work on it.
ADC and TMR3 DMA are set to 16bits, and TMR2 set to 32bits transfer. But seems that 32bits values need to be set with HAL_ADC_Start_DMA and also HAL_DMA_Start_IT.
I think attached are the relevant files. Please let me know if I can provide more information. The HAL_ADC_ConvCpltCallback is in other .c file, the limit to attached here was 3 files.
If I set the buffer to 64k it fills all the buffer normal.
With exception of the first 4 values and the last 12 that are always 0.
I can not transfer more than 16bits address if I'm moving 16bits data? Even configuring on the adc it still the same:
hdma_adc1.Init.PeriphDataAlignment = DMA_MDATAALIGN_WORD;
hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
Thank you!
