cancel
Showing results for 
Search instead for 
Did you mean: 

there could be a conflict if the I2C clock line is the same than SWD clock line ?

ABoya.14
Associate II

hello everyone,

i'm using a STM32F301 MCU on a newly custom designed PCB. i'm using a NUCLEO board to flash the MCU thanks to SWD connector (CN2 jumper off).

The SWD pins are SWDIO, SWCLK, GND and VCC. The first flashing succeded and the programm in which i'm using I2C bus is operating. 

But now i'm trying to re-flash the MCU and i'm getting an error (device not found). Do you think this issue can have a link with the fact that the SWD and I2C clock lines are the same ? can the NRST (Reset) pin solve this problem ?

thank you all.

6 REPLIES 6
S.Ma
Principal

Don't think it's related to I2C. Are you using low power modes in the MCU such as clock stop modes?

They may prevent the debugger to interact with the (stopped) core. First time works because the clock stop mode is yet to be activated...

You might have either to make the MCU in run mode or use the boot pin to prevent it from going to stop mode. There maybe other solutions, these are the ones xing my mind

thank you for your answer.

so if i get it, you're recommending me to use the BOOT0 pin ?

My MCU is not a low power one and i have nowhere in my soft configured something in order to use low power.

S.Ma
Principal

Boot0 pin is your buoy to make sure the MCU is under control after reset. Let us know if this is enough to reflash it.

BOOT0 High will stop your code running, so if something goes awry there, like low power, or pin reconfiguration, you can recover the situation.

Entering the debugger is not instantaneous, it has the wrestle control of the processor into a halted/controlled stated. Figure several hundred or thousand of instructions could execute.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

thank you for your answer.

i'm going to try this trick and come back to you after this.