cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H750VB - Code not automatically starting after power reset

Nick S
Associate

Hello, I'm having trouble getting a blink sketch to run on my STM32H750VB after a power reset. uVision 5 compiles my code without any errors, and programs the chip using a STLink. In order for my code to run, I need to have the BOOT0 pin high, press the reset button, toggle BOOT0 to low, then press the reset button again. After doing this, the blink sketch works as expected. However, when I turn the power to the board off and then back on, my code does not run until I toggle the BOOT0 pin high and back to low while pressing the reset button in between.

My code is being stored at address 0x08000000, and by using the ST-LINK Utility tool, I can see the the values stored in the BOOT_ADD0 and BOOT_ADD1 registers are 0x0800 and 0x1FF0, the default values programmed by ST. I'm using CubeMX to generate the initial code, using the HAL_Delay and HAL_GPIO_Toggle functions inside the while loop in main.c, and can see my code working as expected after doing the BOOT0 toggling and reset sequence. I've looked over the datasheet and the STM32 microcontroller system memory boot mode application note (AN2606) but can not seem to find a solution.

Does anyone have experience with this issue or know how I can configure the microcontroller to run my code immediately when powered on?

9 REPLIES 9

Not using the H750 here.

What stepping of the part are you using? Report value in DBGMCU->IDCODE

Make sure your SystemClock_Config() has the following line

 /*!< Supply configuration update enable - DISABLE */

 MODIFY_REG(PWR->CR3, PWR_CR3_SCUEN, 0);

Enable SRAM clocks

 /* Enable D2 domain SRAM3 Clock (0x30040000 AXI)*/

 __HAL_RCC_D2SRAM3_CLK_ENABLE();

  

 /* Enable SRAM1/SRAM2/SRAM3 clocks on D2 domain */

 __HAL_RCC_D2SRAM1_CLK_ENABLE();

 __HAL_RCC_D2SRAM2_CLK_ENABLE();

 __HAL_RCC_D2SRAM3_CLK_ENABLE();

Put something in the Error_Handler() and HardFault_Handler() so you can observe if it ends up there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for the response Clive!

None of those lines are in my SystemClock_Config function, and adding them did not seem to help either. I added a HAL_GPIO_WritePin in the Error_Handler function, and the connected LED never turned on. I also wasn't sure where to find the DBGMCU->IDCODE value.

Looking closely at the SystemClock_Config function however, I noticed these line near the top

RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
 
  /**Configure the main internal regulator output voltage 
  */
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
 
  while ((PWR->D3CR & (PWR_D3CR_VOSRDY)) != PWR_D3CR_VOSRDY) 
  {
    
  }

I commented out the while loop, suspecting that it may be keeping the program locked up, recompiled, and loaded the code onto the chip and now it is working perfectly. The program gets put on while BOOT0 is high, then starts immediately when BOOT0 is low.

I probably never would of looked as closely at that function without you mentioning it, so thank you!

Pedro3
Senior

Hi!

I also had this problem with H750, even debbuging with ST-Link: got stucked on "PWR_D3CR_VOSRDY while". Using H743, no problem at all...

Is it safe to remove this line?

What stepping of the part are you using? X Y Z

What type of supply configuration?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Clive

I'm using "Y" revision. Not using HSE, but HSI and SysClk at 400 MHz. Power supply is based on LM340 (12VDC to 5VDC) and LM1117 (5VDC to 3.3VDC). This is exactly the same setup for H743.

Thanks!

mohammad poorkhalili
Associate II

Hello, I have exactly the same problem.

STM32H750IBK6 Revision Y, after connect supply if mcu is blank detect by stlink, and if loaded app to mcu i must put mcu in boot and reset to run app

I will test the way you said tomorrow, I hope my problem will be solved, thank you

Right, because the H7 latches state that can't be cleared with a simple reset. Often you'd need to power cycle.

You could check what your Reset_Handler is doing, if it is taking control and losing it, or needs to remap the memory at zero, or change SCB->VTOR.

Puts some code in Reset_Handler to toggle some GPIO, or output via a USART to confirm it is getting there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for your reply, I think I found the problem.
My project was built with earlier versions of Cubemx.
In the previous version with which I built my project, the default voltage supply required by the core was set with an external regulator.
h750ibk6.png
But in the new cubemx, the default supply is with internal regulator.
For this reason, immediately after turning on the mcu during the execution of the rcc configuraion function, the power supply to the core was cut off and the mcu was not recognized by the stlink.
i measured vcap1 & vcap2 by multimeter and show zero.
stm32h750ibk.PNG
I will test this change tomorrow and post the result here. Thanyou

I tested and my problem was solved by changing the core supply source to internal LDO.