0
\$\begingroup\$

I have a system based on STM32F103 microchip. It has a PCB boot0 pin which is used only when flashing new firmware. During the daily usage of the system, the PCB boot0 is not connected to anything. I have always connected to 1.5 Volts input in order to make it to the bootloader mode and flash it with a new firmware, when needed. I have done it for about a year on a weekly basis, without any problems. The 1.5 Volt input was chosen in order to work "safely" and not to give too high voltage (the max value it can handle according to its datasheet is 9 Volts).

But today it got stuck on the boot0 bootloader mode and can't get back to the regular mode (when boots from the internal 0x08000000 flash). I can see using SWD hardware debugger that the PC is in the area of 0x1FFFF7XX, which is related to boot mode ROM. Since I am not the system engineer of that PCB device, I can't tell whether it is connected to specific resistors or not.

Is there any way to get it back to the boot-from-flash regular mode? Or any way to disable the boot0 mode via SWD/JTAG?

STM32

\$\endgroup\$
2
  • \$\begingroup\$ Zhu Bajie - Hi, (a) The text description seems contradictory. It seems to say that BOOT0 is connected to 1.5 V, but also that it is not connected to anything. Please edit the question to clarify the text & add a schematic diagram of (at least) the relevant part of your design. (b) Why do you say that you connected BOOT0 to specifically 1.5 V - why was that voltage chosen and how is it generated? What logic level is that intended to be? (c) How did you decide that the MCU was in bootloader mode, and not any other problem preventing your (user-)programmed code from running? Thanks. \$\endgroup\$
    – SamGibson
    Apr 9, 2023 at 15:19
  • \$\begingroup\$ Hello. Thank you for the questions. (a) I connect the BOOT0 to 1.5 V only when I need to flash the STM32. (b) Just used a low "safe" voltage in order not to destroy the elements. (c) I saw its PC value in the SWD debugger, pointing to addresses of bootloader ROM. \$\endgroup\$
    – Zhu Bajie
    Apr 9, 2023 at 15:55

2 Answers 2

2
\$\begingroup\$

Leaving the pin floating can make it read low or high, so it is incorrect desicion to leave it floating.

Adding a 10k pull-down resistor to ground should solve the problem, if the problem even is the floating BOOT0 pin.

Applying 1.5V is also incorrect. It is in the area of not determined, at least for 3.3V supply voltage. So even if it has worked for you, it does not mean it should work.

\$\endgroup\$
1
  • \$\begingroup\$ Fixed it temporarily using SWD debugger. Reset the STM32 controller, set 0xE000ED08 VTOR register to point to the flash firmware start at 0x08000000 and set PC to be at the IVT handler of the firmware's entry point. Need to set it each time you turn the device on, but works. \$\endgroup\$
    – Zhu Bajie
    Apr 10, 2023 at 12:02
0
\$\begingroup\$

1.5V doesn't make any sense at all. Either connect it to GND or pull it up via a 10k or similar resistor to VCCIO. I'd need to look up which does which but there is no reason to connect it to some value where it's not clear if it's a logic 1 or 0. What you CAN do is to pull it up with a resistor if you want the internal bootrom to run and short it to GND if you want to run your application from flash. That way, you do not need to remove the Pull-Up resistor.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.