From cc82e8818b8b195f886995e8eab7b989a1b81029 Mon Sep 17 00:00:00 2001 From: Candas1 Date: Fri, 29 Sep 2023 20:28:16 +0200 Subject: [PATCH 1/2] ADC calibration --- .../hardware_specific/stm32/b_g431/b_g431_mcu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp b/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp index 3e10bbca..079b43ac 100644 --- a/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp +++ b/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp @@ -110,6 +110,9 @@ void* _configureADCLowSide(const void* driver_params, const int pinA,const int p MX_ADC1_Init(&hadc1); MX_ADC2_Init(&hadc2); + //HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED); + //HAL_ADCEx_Calibration_Start(&hadc2,ADC_SINGLE_ENDED); + MX_DMA1_Init(&hadc1, &hdma_adc1, DMA1_Channel1, DMA_REQUEST_ADC1); MX_DMA1_Init(&hadc2, &hdma_adc2, DMA1_Channel2, DMA_REQUEST_ADC2); From e28e34d686509a08aa1e9253a83e190f045f33be Mon Sep 17 00:00:00 2001 From: Candas1 Date: Fri, 29 Sep 2023 20:28:50 +0200 Subject: [PATCH 2/2] ADC Calibration --- .../hardware_specific/stm32/b_g431/b_g431_mcu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp b/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp index 079b43ac..8456759c 100644 --- a/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp +++ b/src/current_sense/hardware_specific/stm32/b_g431/b_g431_mcu.cpp @@ -110,8 +110,8 @@ void* _configureADCLowSide(const void* driver_params, const int pinA,const int p MX_ADC1_Init(&hadc1); MX_ADC2_Init(&hadc2); - //HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED); - //HAL_ADCEx_Calibration_Start(&hadc2,ADC_SINGLE_ENDED); + HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED); + HAL_ADCEx_Calibration_Start(&hadc2,ADC_SINGLE_ENDED); MX_DMA1_Init(&hadc1, &hdma_adc1, DMA1_Channel1, DMA_REQUEST_ADC1); MX_DMA1_Init(&hadc2, &hdma_adc2, DMA1_Channel2, DMA_REQUEST_ADC2);