2019-12-13 11:02 PM
I am initialising the ADC2 w/DMA via STM32CubeMX.
Scan conv. = enabled
continuous conv. = enabled
DMA cont. requests = enabled
overrun behaviour = data preserved
number of conversions = 2 (channel 1 and channel 2)
sequence of program (specific to DMA):
1 - uint32_t adc_val[2] (variable created for DMA)
2 - MX_DMA_init
3 - HAL_ADC_Start_DMA_ (passed adc_val)
4 - while(1) (using UART to send the adc data)
I tried the same program using adc polling (HAL_ADC_getvalue) and it did give me some data. But the DMA doesnt seem to work.
Solved! Go to Solution.
2019-12-17 12:46 AM
thanks @Community member for mentioning all the possible reasons for the issue.
I found the link pasted above to be the exact solution for the problem that i am facing. I had to change the order of DMA_init() and place it before ADC_init().
2019-12-14 01:15 AM
2019-12-15 09:47 PM
i tried shifting the DMA_init function above the ADC_init function. But that didnt help. I am still trying to look further into the different questions mentioned in your link.
2019-12-16 12:10 AM
I don't use Cube/CubeMX.
I'd read out and check content of respective ADC, DMAMUX and DMA registers.
JW
2019-12-17 12:46 AM
thanks @Community member for mentioning all the possible reasons for the issue.
I found the link pasted above to be the exact solution for the problem that i am facing. I had to change the order of DMA_init() and place it before ADC_init().