2019-07-11 10:12 PM
Hi everyone,
I am working on ADC of STM32H743Zi, but i am unable to get it running.
Can anyone guide me .
The DMA command is
HAL_ADC_Start_DMA(&hadc2,(uint32_t*)ADC_1,1);
2019-07-11 11:43 PM
1-Is there any DMA problem?
2-Or the ADC is not starting at all?
3- What should be setting of DMA and DMA memory sections?
2019-07-12 11:35 PM
Hi,
I have added D2 Ram in my linker and ADC variables are stored in D2 Ram. ADC is working fine in end of conversion mode but DMA is not working .
hadc2.Instance = ADC2;
hadc2.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV2;
hadc2.Init.Resolution = ADC_RESOLUTION_16B;
hadc2.Init.ScanConvMode = ADC_SCAN_ENABLE;
hadc2.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
hadc2.Init.LowPowerAutoWait = DISABLE;
hadc2.Init.ContinuousConvMode = ENABLE;
hadc2.Init.NbrOfConversion = 1;
hadc2.Init.DiscontinuousConvMode = DISABLE;
hadc2.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc2.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc2.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DMA_CIRCULAR;
hadc2.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN;
hadc2.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
hadc2.Init.OversamplingMode = DISABLE;
And I have added this in my code
#define __SECTION_RAM_D2 __attribute__((section(".RAM_D2"))) /* AHB SRAM (D2 domain): */
ADC is working fine with
HAL_ADC_GetValue(&hadc1);
but the DMA is not working.
HAL_ADC_Start_DMA(&hadc2,(uint32_t *) &Adc,2);
What will be the problem?
2019-07-14 09:37 AM
Hi all,
ADC was sampling fine without DMA.
I placed ADC array in D2 Ram and DMA was functioning.
MPU_Confg(); must be called.
Now Its working.
Thanks to all,
If any one needs help on ADC DMA
email me at awais_hafeez@hotmail.com