Skip to main content
MRick.2
Associate II
January 11, 2022
Solved

Missing option in CubeMX for battery charging on STM32H730

  • January 11, 2022
  • 4 replies
  • 2128 views

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.

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

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.

4 replies

Sara BEN HADJ YAHYA
ST Technical Moderator
January 11, 2022

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
MRick.2
MRick.2Author
Associate II
January 11, 2022

Sorry the STM32H730

Sara BEN HADJ YAHYA
ST Technical Moderator
January 11, 2022

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
MRick.2
MRick.2Author
Associate II
January 12, 2022

Case closed :)