cancel
Showing results for 
Search instead for 
Did you mean: 

Hi everyone Why the generated code is not stable?

Mugtaba
Associate II

I am using STM32cubeIDE and STM32f103ret6 chip on my board

The schematic I used is here: https://github.com/mcauser/BLUE_BUTTON_F103RET6/blob/master/docs/STM32F103RET6_schematics.pdf

​I have two problems the NRST after some time _between 5 minutes to 4 hours_ gradually keep dropping its voltage until the MCU resets (I had to remove the pull-up 10k Resistor and connected it directly to to vcc to temporary solve this) it happens from time to time, so any idea why this is happening..? I have test 3 different boards.

The other problem is the I2c is not working at all, it worked once after I modified the generated code by calling the clock enable before the gpio enable in the generated init function it worked for some time and then without changing any thing stopped(the bus is 4.7k pulled up, my slave device is working properly I have tested it later ).

There is no power issues.

Thanks for your time

6 REPLIES 6
TDK
Guru

Your NRST pin isn't pulled up. The NRST signal is hooked up to SW1, but not to R9. You're missing a junction in your schematic where the wires cross.

If you feel a post has answered your question, please click "Accept as Solution".
Mugtaba
Associate II

Thank you for your reply.

That modification was done on the board and not on the schematic because I know Its not the right way to do it, that why I wrote a temporary solution and still asking for help.

Why it's happening and how to solve it

Because I can't reprogram the MCU until I remove this bridge between NRST & Vcc

Mugtaba
Associate II

Still waiting for a help here.

The problem is NRST isnt pulled up. Tying it to 3v3 isnt a good fix as it prevents the programmer from operating correctly.
The i2c issue is probably related. Fix one thing at a time.
If you feel a post has answered your question, please click "Accept as Solution".

But the I2C problem was the same previously when the NRST was pulled up by 10k, so I think it is not related.

> Still waiting for a help here.

This is a forum of voluntary ST users, no answer guaranteed at all.

You can get professional support by ST for a corresponding fee.

> The other problem is the I2c is not working at all, it worked once after I modified the generated code by calling the clock enable before the gpio enable in the generated init function it worked for some time and then without changing any thing stopped( ...

If you generate involuntary pulses during initialization, the attached I2C slave might get locked in a limbo state.

> The schematic I used is here: ...

The schematics seems wrong.

The connection from the NRST to the reset switch SW1 must be connected the R9/C4 connection.

According to the schematics, they just cross over.