2022-01-10 11:00 PM
In CubeMX ther is missing optines to select charging of the battery and the seceltion of charging resistor 1.5K or 5K
I would expect it to be under "System Core" -> RCC as it should go into resig PWR_CR3
So for my system I have to duck in "main.c"
HAL_PWREx_ConfigSupply (PWR_LDO_SUPPLY);
to
HAL_PWREx_ConfigSupply (PWR_LDO_SUPPLY | PWR_CR3_VBE | PWR_BATTERY_CHARGING_RESISTOR_1_5);
But it gets keeping over written from CubeMX
It is this 2 bits in PWR_CR3
Bit 9 VBRS: VBAT charging resistor selection
0: Charge VBAT through a 5 k Ω resistor.
1: Charge VBAT through a 1.5 k Ω resistor.
Bit 8 VBE: VBAT charging enable
0: VBAT battery charging disabled.
1: VBAT battery charging enabled.
Solved! Go to Solution.
2022-01-11 06:02 AM
Hello @MRick.2 ,
There are HAL_PWREx_EnableBatteryCharging (uint32_t ResistorValue) and HAL_PWREx_DisableBatteryCharging (void) functions that enables and disables battery charging, these functions are placed in stm32h7xx_hal_pwr_ex.c file.
HAL_PWREx_ConfigSupply() Configures the system Power Supply and it doesn't enable or disable battery charging.
I hope this helps !
If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-01-11 05:28 AM
Hello @MRick.2 ,
Thanks for your feedback,
Actually there is no PWR_CR3 for STM32F730, could you please provide us with more details to understand your request.
Thanks,
Sara.
2022-01-11 05:33 AM
Sorry the STM32H730
2022-01-11 06:02 AM
Hello @MRick.2 ,
There are HAL_PWREx_EnableBatteryCharging (uint32_t ResistorValue) and HAL_PWREx_DisableBatteryCharging (void) functions that enables and disables battery charging, these functions are placed in stm32h7xx_hal_pwr_ex.c file.
HAL_PWREx_ConfigSupply() Configures the system Power Supply and it doesn't enable or disable battery charging.
I hope this helps !
If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-01-12 03:54 AM
Case closed :)