STM32L152 ADC- Can not read from address 0x1FF800F8U
Hi,
With helping of CubeMX I measure voltage on battery (ADC channel 0) using ADC in DMA mode. I also measure internal refference because my VDDA is not know in advance.
Once these 2 values are measured I need to convert the RAW data to mVolts.
I use datasheet formula using macro:
For getting VrefAnalogVoltage I use:
ADCVrefInternal=__LL_ADC_CALC_VREFANALOG_VOLTAGE(ADCVrefInternal,LL_ADC_RESOLUTION_12B);The problem is that if I call the macro above I always end up in HardFault function. Missed I anything? Maybe there is problem with reading the calibration value stored there: (((uint32_t)(*VREFINT_CAL_ADDR)
And finally I would use this formula:
ADCResult=__LL_ADC_CALC_DATA_TO_VOLTAGE(ADCVrefInternal, ADCResult, LL_ADC_RESOLUTION_12B);Thanks for support.
Jan.
