cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with flashing STM32G070 MCU via i2c after ST link has been used

ChrisTh.2
Associate

I'm using a STM32G070 MCU which I flash via i2c when the boot0 pin is set to high.

This works fine until I connect a ST-link to the MCU, program it and then disconnect the ST-link again. After that the i2c flash will fail, I have checked the boot0 and reset pin and these are set correctly, but when checking the i2c communication it seems like there is no reply from the boot loader address 0x51.

When I power cycle the MCU the i2c flash works fine again.

I have checked the boot select bit in the user option byte and it looks ok.

Anyone know if this is expected behavior after the ST link has been used or if it might be something I have missed?

1 ACCEPTED SOLUTION

Accepted Solutions
Bubbles
ST Employee

Hi @ChrisTh.2​,

it would appear that by connecting the debug interface, you have engaged read protection. That can only be lifted using power cycle, not by a system reset. It's a precaution to prevent reading the system memory (which contains more than just the i2c bootloader).

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Bubbles
ST Employee

Hi @ChrisTh.2​,

it would appear that by connecting the debug interface, you have engaged read protection. That can only be lifted using power cycle, not by a system reset. It's a precaution to prevent reading the system memory (which contains more than just the i2c bootloader).

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

ChrisTh.2
Associate

Ok I didn't know about the read protection, but then it makes sense.

Thanks for the reply!