Skip to main content
Visitor II
January 2, 2022
Question

My STM32F302C8T6 only runs the program when the code is loaded. If I reset it or power up, it does not run.

  • January 2, 2022
  • 3 replies
  • 5315 views

Maybe is a hardware problem since the microcontroller is on a custom board I designed. The problem is the following:

The microcontroller only runs the program the moment I load the code, if I reset it or power up the board after a power-off it does not run the program.

This is the following circuit for the reset and BOOT0 pins:

0693W00000HqLa2QAF.pngI program the microcontroller with an external STLINK. 

Thanks a lot for any help.

    This topic has been closed for replies.

    3 replies

    Super User
    January 3, 2022

    And does J1 have any jumper? BOOT0 must be grounded to run user code on reset. On some chips, the option bytes can override the BOOT0 pin.

    JMart.13Author
    Visitor II
    January 3, 2022

    Yes, BOOT0 has a jumper to ground.

    Super User
    January 3, 2022

    Probably it is stuck during startup in your startup code then. Attach a debugger without resetting it to figure out where the CPU is. Could also be some other schematic error not shown in the snippet provided. LSE can take a while to come up and could be timing out. Same for HSE.

    JMart.13Author
    Visitor II
    January 3, 2022

    Hum ok ok, is strange because I generated the project using the STM32Cube IDE so I guess the startup code is ok, but I will have to check it.

    JMart.13Author
    Visitor II
    January 10, 2022

    Ok, i figured it out, there is a short in the BOOT0 pin and with a pull up resistor and is maintaining the pin HIGH. Will try to fix it and make an update later. Thanks a lot