cancel
Showing results for 
Search instead for 
Did you mean: 

Missing option in CubeMX for battery charging on STM32H730

MRick.2
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

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.

View solution in original post

4 REPLIES 4
Sara BEN HADJ YAHYA
ST Employee

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.

MRick.2
Associate II

Sorry the STM32H730

Sara BEN HADJ YAHYA
ST Employee

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.

MRick.2
Associate II

Case closed 🙂