2019-05-06 05:21 PM
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();
}
2019-11-08 05:00 AM
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?
2019-11-11 03:09 AM
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.