-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32F4 AnalogIn - Clear VBATE and TSVREFE bits before configuring ADC channels #3302
Conversation
@@ -183,13 +183,14 @@ static inline uint16_t adc_read(analogin_t *obj) | |||
return 0; | |||
} | |||
|
|||
ADC->CCR &= ~(ADC_CCR_VBATE | ADC_CCR_TSVREFE); // Workaround |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workaround? I dont see any explanation in the commit message neither here. What does this solve? can you add more details to the commit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the description. I will add more explanation on this line too.
/morph test |
@mbed-bot: TEST HOST_OSES=ALL |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
[Build 1139] |
Ports for Upcoming Targets 3241: Add support for FRDM-KW41 ARMmbed/mbed-os#3241 3291: Adding mbed enabled Maker board with NINA-B1 and EVA-M8Q ARMmbed/mbed-os#3291 Fixes and Changes 3062: TARGET_STM :USB device FS ARMmbed/mbed-os#3062 3213: STM32: Refactor us_ticker.c + hal_tick.c files ARMmbed/mbed-os#3213 3288: Dev spi asynch l0l1 ARMmbed/mbed-os#3288 3289: Bug fix of initial value of interrupt edge in "gpio_irq_init" function. ARMmbed/mbed-os#3289 3302: STM32F4 AnalogIn - Clear VBATE and TSVREFE bits before configuring ADC channels ARMmbed/mbed-os#3302 3320: STM32 - Add ADC_VREF label ARMmbed/mbed-os#3320 3321: no HSE available by default for NUCLEO_L432KC ARMmbed/mbed-os#3321 3352: ublox eva nina - fix line endings ARMmbed/mbed-os#3352 3322: DISCO_L053C8 doesn't support LSE ARMmbed/mbed-os#3322 3345: STM32 - Remove TIM_IT_UPDATE flag in HAL_Suspend/ResumeTick functions ARMmbed/mbed-os#3345 3309: [NUC472/M453] Fix CI failed tests ARMmbed/mbed-os#3309 3157: [Silicon Labs] Adding support for EFR32MG1 wireless SoC ARMmbed/mbed-os#3157 3301: I2C - correct return values for write functions (docs) - part 1 ARMmbed/mbed-os#3301 3303: Fix #2956 #2939 #2957 #2959 #2960: Add HAL_DeInit function in gpio_irq destructor ARMmbed/mbed-os#3303 3304: STM32L476: no HSE is present in NUCLEO and DISCO boards ARMmbed/mbed-os#3304 3318: Register map changes for RevG ARMmbed/mbed-os#3318 3317: NUCLEO_F429ZI has integrated LSE ARMmbed/mbed-os#3317 3312: K64F: SPI Asynch API implementation ARMmbed/mbed-os#3312 3324: Dev i2c common code ARMmbed/mbed-os#3324 3369: Add CAN2 missing pins for connector CN12 ARMmbed/mbed-os#3369 3377: STM32 NUCLEO-L152RE Update system core clock to 32MHz ARMmbed/mbed-os#3377 3378: K66F: Enable LWIP feature ARMmbed/mbed-os#3378 3382: [MAX32620] Fixing serial readable function. ARMmbed/mbed-os#3382 3399: NUCLEO_F103RB - Add SERIAL_FC feature ARMmbed/mbed-os#3399 3409: STM32L1 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3409 3416: Renames i2c_api.c for STM32F1 targets to fix IAR exporter ARMmbed/mbed-os#3416 3348: Fix frequency function of CAN driver. ARMmbed/mbed-os#3348 3366: NUCLEO_F412ZG - Add new platform ARMmbed/mbed-os#3366 3379: STM32F0 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3379 3393: ISR register never re-evaluated in HAL_DMA_PollForTransfer for STM32F4 ARMmbed/mbed-os#3393 3408: STM32F7 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3408 3411: STM32L0 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3411 3424: STM32F4 - FIX to add the update of hdma->State variable ARMmbed/mbed-os#3424 3427: Fix stm i2c slave ARMmbed/mbed-os#3427 3429: Fix stm i2c fix init ARMmbed/mbed-os#3429 3434: [NUC472/M453] Fix stuck in lp_ticker_init and other updates ARMmbed/mbed-os#3434
Description
This is a fix of Issue #1685:
Measuring VBAT sets the ADC_CCR_VBATE bit in ADC->CCR, and there is not possibility with the ST HAL driver to clear it. If it isn't cleared, VBAT remains connected to the ADC channel in preference to temperature, so VBAT readings are returned in place of temperature.
This is a workaround until a better solution is done in ST HAL driver.
Status
READY
Migrations
NO