2025-01-08 12:22 PM - edited 2025-01-09 01:02 AM
Hi,
In CubeIDE, new project, choosing STM32H755ZIT6 (the NUCLEO-H755ZI-Q), the board stops responding when turning off and on the power to the board. I have made a simple LED example with everything set to default with the addition of two user LEDs blinking - one controlled by M7 and one by M4 core. It works fine until you remove the USB and put it back in. Then ST-link cannot connect.
I have used the debug configuration from the application note:
STM32Cube Version: 1.17.0
CubeMX version: 6.13
Firmware package: H7 V1.12.1
Best regards Nikolaj
Solved! Go to Solution.
2025-01-09 06:25 AM - edited 2025-01-09 06:56 AM
Hello @NDagn.1 ,
I reproduced the behavior and I think I found the origin of it.
There is a new change in CubeH7 (I think starting from CubeH7 V1.12.x) especially the management of the power and the power config is set in the boot file (system_stm32h7xx_dualcore_boot_cm4_cm7.c). A new function has been added called ExitRun0Mode().
That function is called in the startup file (Application\User\Startup\startup_stm32h755zitx.s) after reset even before SystemInit:
/* Call the ExitRun0Mode function to configure the power supply */
bl ExitRun0Mode
/* Call the clock system initialization function.*/
bl SystemInit
/* Copy the data segment initializers from flash to SRAM */
ldr r0, =_sdata
The problem I see is that the generated project creates two defines for the power supply one for SMPS and one for LDO:
LDO define is called at first in ExitRun0Mode() -> #if defined(USE_PWR_LDO_SUPPLY) -> LDO configuration:
void ExitRun0Mode(void)
{
#if defined(USE_PWR_LDO_SUPPLY)
#if defined(SMPS)
/* Exit Run* mode by disabling SMPS and enabling LDO */
PWR->CR3 = (PWR->CR3 & ~PWR_CR3_SMPSEN) | PWR_CR3_LDOEN;
#else
/* Enable LDO mode */
PWR->CR3 |= PWR_CR3_LDOEN;
#endif /* SMPS */
/* Wait till voltage level flag is set */
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
{}
#elif defined(USE_PWR_EXTERNAL_SOURCE_SUPPLY)
#if defined(SMPS)
/* Exit Run* mode */
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_SMPSEN | PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
#else
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
#endif /* SMPS */
/* Wait till voltage level flag is set */
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
{}
#elif defined(USE_PWR_DIRECT_SMPS_SUPPLY) && defined(SMPS)
/* Exit Run* mode */
PWR->CR3 &= ~(PWR_CR3_LDOEN);
/* Wait till voltage level flag is set */
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
{}
As #if #elseif are used, that sets the board to LDO power mode which is not the right power config of the board. The correct config is SMPS (the 3rd condition: #elif defined(USE_PWR_DIRECT_SMPS_SUPPLY) && defined(SMPS))
Unfortunately if you remove the definition of the define USE_PWR_LDO_SUPPLY from the project preprocessor and you regenerate the code it will appear again. So for the moment each time you generate the code you need to remove that definition and keeping USE_PWR_DIRECT_SMPS_SUPPLY.
I will raise that issue immediately. Internal ticket number 200085 for follow up (not accessible by the community users)
2025-01-08 11:54 PM - edited 2025-01-09 01:01 AM
Additional info: Everything works when using older software releases - I can power cycle the board as much as I like and the program runs every time with the LEDs blinking.
With these software releases, everything works:
STM32Cube Version: 1.16.1
CubeMX version: 6.12.1
Firmware package: H7 V1.11.2
2025-01-09 06:25 AM - edited 2025-01-09 06:56 AM
Hello @NDagn.1 ,
I reproduced the behavior and I think I found the origin of it.
There is a new change in CubeH7 (I think starting from CubeH7 V1.12.x) especially the management of the power and the power config is set in the boot file (system_stm32h7xx_dualcore_boot_cm4_cm7.c). A new function has been added called ExitRun0Mode().
That function is called in the startup file (Application\User\Startup\startup_stm32h755zitx.s) after reset even before SystemInit:
/* Call the ExitRun0Mode function to configure the power supply */
bl ExitRun0Mode
/* Call the clock system initialization function.*/
bl SystemInit
/* Copy the data segment initializers from flash to SRAM */
ldr r0, =_sdata
The problem I see is that the generated project creates two defines for the power supply one for SMPS and one for LDO:
LDO define is called at first in ExitRun0Mode() -> #if defined(USE_PWR_LDO_SUPPLY) -> LDO configuration:
void ExitRun0Mode(void)
{
#if defined(USE_PWR_LDO_SUPPLY)
#if defined(SMPS)
/* Exit Run* mode by disabling SMPS and enabling LDO */
PWR->CR3 = (PWR->CR3 & ~PWR_CR3_SMPSEN) | PWR_CR3_LDOEN;
#else
/* Enable LDO mode */
PWR->CR3 |= PWR_CR3_LDOEN;
#endif /* SMPS */
/* Wait till voltage level flag is set */
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
{}
#elif defined(USE_PWR_EXTERNAL_SOURCE_SUPPLY)
#if defined(SMPS)
/* Exit Run* mode */
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_SMPSEN | PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
#else
PWR->CR3 = (PWR->CR3 & ~(PWR_CR3_LDOEN)) | PWR_CR3_BYPASS;
#endif /* SMPS */
/* Wait till voltage level flag is set */
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
{}
#elif defined(USE_PWR_DIRECT_SMPS_SUPPLY) && defined(SMPS)
/* Exit Run* mode */
PWR->CR3 &= ~(PWR_CR3_LDOEN);
/* Wait till voltage level flag is set */
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0U)
{}
As #if #elseif are used, that sets the board to LDO power mode which is not the right power config of the board. The correct config is SMPS (the 3rd condition: #elif defined(USE_PWR_DIRECT_SMPS_SUPPLY) && defined(SMPS))
Unfortunately if you remove the definition of the define USE_PWR_LDO_SUPPLY from the project preprocessor and you regenerate the code it will appear again. So for the moment each time you generate the code you need to remove that definition and keeping USE_PWR_DIRECT_SMPS_SUPPLY.
I will raise that issue immediately. Internal ticket number 200085 for follow up (not accessible by the community users)
2025-01-09 06:42 AM
Now as your board was wrongly set to LDO instead of SMPS you need to recover it.
1- Disconnect the STLINK USB cable
2- Connect BOOT pin to VDD
3- Connect the STLINK USB cable
4- Use Cube Programmer and erase the board.
Note that the implementation of that new function was to be inline with the specification described in the reference manual regarding RUN* mode:
2025-01-09 11:16 AM
Thank you very much for the good explanation and the solution. I went into Project->Properties->C/C++ Build->Settings and deleted the definition of USE_PWR_LDO_SUPPLY as you explained and everything works again. I will remember to delete the definition every time the code is regenerated.
Best regards Nikolaj