Skip to main content
CChen.16
Associate II
May 7, 2019
Question

I am testing the boot mode of STM32G070 with Nucleo-G070RB board, using an IAR I-iet emulator. Thanks.

  • May 7, 2019
  • 2 replies
  • 909 views

I try to use UART to download firmware to the board with STM32CubeProgrammer, UART 1 was connected to the PC. 

I added the following code trying to set the MCU to boot mode, but after run this code, my I-jet emulator stop working, cannot talk to the CPU any more. Now nothing works with the board, my questions are:

1. How can I recover? 

2. Is there any other way to check the status of the MCU? 

void set_to_boot_mode(void)

{

 FLASH_OBProgramInitTypeDef OBInit;

 uint32_t config = 0;

 

 /* Unlock tha User Flash area */

 HAL_FLASH_Unlock();

 HAL_FLASH_OB_Unlock();

 /* Get the Dual boot configuration status */

 HAL_FLASHEx_OBGetConfig(&OBInit);

 

 config = OBInit.USERConfig;

 

 OBInit.USERConfig = OB_BOOT0_FROM_OB | OB_BOOT1_SYSTEM | OB_nBOOT0_SET;

 

 HAL_FLASHEx_OBProgram(&OBInit);

 

 HAL_FLASH_OB_Launch();

 // reset

 HAL_NVIC_SystemReset();

}

This topic has been closed for replies.

2 replies

JVerv.948
Visitor II
November 8, 2019

Hi, I appear to have done the same mistake you have. On my STM32G031 Nucleo-32 I configured the MCU to use the external Boot0 pin but now it does not appear to boot at all. It is no longer recognized by the onboard ST-Link and no matter if I set Boot0 to High or Low it does not appear to be running. Did you ever determine what you issue was and, if so, how to fix it?

ST Employee
November 11, 2019

​Hello,

I am afraid that you don't keep the config of previsouly programmed user options.

And would then rewrite them with 0 in your sequence. (Leading to setup of RAM parity check and Hardware watchdog starting)

Using CubeProgrammer or ST-Link Utility you should be able to connect to target under reset, and modify those OB afterward back to default values.