cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Boot NUCLEO-G431RB after changing option bytes. NEED HELP!

YJeon.2
Associate

Hello! I have problem with booting NUCLEO-G431RB board.

There was no problem before I changed some registers.

I changed option bytes as below and now I cannot boot the board.

(in the user code part at main)

(I tried to change nSWBOOT bit as below)

/////////////

 HAL_FLASH_Unlock();

 HAL_FLASH_OB_Unlock();

 FLASH_OB_UserConfig(OB_USER_nSWBOOT0, 1);

 HAL_FLASH_OB_Launch();

////////////////

build was completed but there was problem when I tried debug with that code

(I bebug with ST-Link(ST-LINK GDB server))

At the First time, I can enter to debug session and there was problem at line  HAL_FLASH_OB_Launch();

But this is not my question

After several times of debug again, I can't even go to debug session because of error.

(I didn't change the code)

The error message is

//////////

Error message from debugger back end:

Error finishing flash operation

Failed to execute MI command:

load (my elf file location)

///////////////

Let me show you my console message

//////////////////////

STMicroelectronics ST-LINK GDB server. Version 5.4.0

Copyright (c) 2019, STMicroelectronics. All rights reserved.

Starting server with the following options:

    Persistent Mode      : Disabled

    Logging Level       : 1

    Listen Port Number     : 61234

    Status Refresh Delay    : 15s

    Verbose Mode        : Disabled

    SWD Debug         : Enabled

Waiting for debugger connection...

Debugger connected

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.3.0          

   -------------------------------------------------------------------

ST-LINK SN : 002500463137511233333639

ST-LINK FW : V3J4M2

Voltage   : 3.29V

SWD freq  : 24000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x468

Device name : STM32G43x/G44x

Flash size : 128 KBytes

Device type : MCU

Device CPU : Cortex-M4

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a41664.srec

 File     : ST-LINK_GDB_server_a41664.srec

 Size     : 16076 Bytes

 Address    : 0x08000000 

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 7]

Error: failed to erase memory

Error: failed to erase memory

Encountered Error when opening C:\ST\STM32CubeIDE_1.2.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.1.0.201910081157\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Debugger connection lost.

Shutting down...

///////////////////////////

I searched How to solve this problem but I can't find solution.

I'm waiting for you help!

Any comments will be very helpful.

////////////////////

And for you information, Let me tell you error at stm32CubeProgrammer.

I notice the program after all the above things, and I connect the board with the program and there is error as below

Error: Data read failed

Memory & File edition tab doesn't works, but i can apply and read Option bytes at Option bytes tab

I hope you can get hint from here!

Thankyou

1 REPLY 1
Markus GIRDLAND
ST Employee

You mention that you can apply and read option bytes but... can you erase the chip with CubeProgrammer stand-alone? And if so, are you able to get the board functioning again with another project? To just blink a LED or something to make sure the code is on the target.