cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to connect to Nucelo G071RB which seems to be in a reboot loop

Dominik Lorych
Associate III

Hi,

i have a G0 which seems to be in a reboot loop. I am unable to connect to it or erase it. I also have another chip of the same model which i am using to test how the chip is responding to some things. I tried the following:

Conecting using the STM32CubeProgrammer with many different configurations (SWD or JTAG, multiple different frequencies, "under reset" or normal mode, all reset modes (software reset, hardware reset, core reset)). -> Resulting in ST-Link errors (DEV_CONNECT_ERR and DEV_USB_COMM_ERR).

Upgrading the ST-LINK firmware -> Error connecting to device ST-LINK/V2-1 (error 0x21).

Trying to boot the system memory bootloader using the Boot0 pin and connecting via UART using the Flash Loader Demonstrator and STM32CubeProgrammer -> Some error about the device not responding

Testing the system memory bootloader on the working chip: I tested multiple different Option Byte configurations: I am able to boot the bootloader using the nBoot0 bit, but even then the Flash Loader Demonstrator and the STM32CubeProgrammer are not able to connect via UART, using either the USART1 or the USART2 pins referenced in AN2606. When i try to boot via the BOOT0 pin (while the nBOOT_SEL bit is set accordingly) the system memory bootloader is not starting, instead the normal application is starting.

Trying to connect via the ST-Link Utility, which is giving the same errors as the CubeProgrammer.

Some info about the programm which is running on the G0:

The reboot loop is caused by a faulty option byte programming which tries to program new OB every boot, causing another reboot. The code was programmed to the chip using OpenOCD and Clion. I was able to see the rebooting happening because i had UART connected to the chip which repeatedly printed "SuccessfullInitiali" (No idea though which code printed this String, i searched for this string using grep and did not find any occurrence of that string or something similar (assuming some error was made in transmission) in my code). But this string also was only printed at the first time, after reconnecting the USB i did not get anymore printing on the UART.

Does anybody have an idea what else i could try? Thanks for the help 🙂

2 REPLIES 2
Andreas Bolsch
Lead II

Not sure whether this helps in your setting, but you might try the following:

1) Pull NRST low and *keep* it low. (If anything else connected to this pin externally, make sure the short to GND doesn't damage anything.)

2) Power cycle the MCU, but not the debug adapter (if NRST pin is reconfigured by the programmed firmware, a power-on reset is the only method to assert a reset and keep the MCU in reset).

3) Start openocd (maybe several times if it bails out with an error) with "-f ..." (the appropriate cfg file) and connect to it via telnet.

4) Issue "reset halt" (don't mind the "timed out while waiting for target halted, TARGET: stm32g0x.cpu - Not halted" message, that's because the CPU is still in reset).

5) Release NRST.

6) Check with  "mdw 0x40022000 16" that the flash registers show sensible values.

7) Perform a mass erase with "stm32l4x mass_erase 0" and maybe revert the option bytes to factory default (if the current setting causes trouble).

This method works on a Nucleo-G070RB, fortunately the embedded ST-Link doesn't mind overriding the targets NRST.

Dominik Lorych
Associate III

I now found some time to try this. It did not work, openocd did not manage to get any connection to the chip, and also when applying these steps with the CubeProgrammer instead of openocd i could not get any connection. But thank you anyway 🙂