2025-02-25 12:22 PM - edited 2025-02-25 12:44 PM
I'm using the NUCLEO-F412ZG board.
I need to be able to flash the program using USART 2. I'm using the standard Open Bootloader that comes from the factory on the board, and STM32CubeProgrammer v2.18.0.
I'm connecting to the USART 2 pins with USB to "TTL" adapter 3.3V levels, direct wired (crossover) on pins PD5 and PD6.
If I tie the BOOT pin to a 3V3 pin on CN8, and power up the board, STM32CubeProgrammer has no problem connecting to the board/bootloader. But if I press the reset button (or connect NRST to low and then disconnect it) STM32CubeProgrammer can no longer connect to the board/bootloader.
I have tried this with both powering from the ST-Link USB connector, and through VIN with an external 6V power adapter.
Does anyone know why it won't get into the proper bootloader mode when doing a reset instead of cycling the power?
Thank you,
Chris
2025-02-25 12:41 PM - edited 2025-02-25 12:46 PM
Could you clarify what you're trying to do? Connect to the built-in bootloader of STM32 or flash your own bootloader (Open Bootloader?) and connect to that?
> I'm using the standard Open Bootloader that comes from the factory on the board
The built-in bootloader of STM32F4 is not the "standard Open Bootloader". Though the Open Bootloader may be based on, or inspired by the ST built-in bootloaders, which never were open-sourced.
2025-02-25 12:47 PM
Thank you, I was confused by the terms (pretty new with dealing with the STM32 bootloader and such). If have correct my original question, to remove the "open". I'm using the bootloader that factory programmed on the board.
2025-02-26 9:46 AM - edited 2025-02-26 9:47 AM
Then... how do you toggle the BOOT0 pin: a button switch or jumper? Ensure that it's state is stable during power-on or reset via NRST.
2025-02-26 11:23 AM - edited 2025-02-26 11:37 AM
I have tried all the following, all of which have the BOOT0 pin connected to the 3V3 pin with a jumper. As for the power supply. I have tried with the power being supplied by the USB connector on ST-Link board that is part of the NUCLEO-F412ZG board. I have tried with a 6V adapter connected through VIN. I have tried powering with 5V on the E5V pin.
Also, I should have mentioned that I'm seeing some strange oscillation on the NRST pin when it driven to a high. I have tried adding an external pull up resistor to NRST pin, but it still is there and then isn't from the CP2102N GPIO pin.
With it not connected to the NRST pin.
And here is the whole conversation, including trying to connect with the STM32CubeProgramer (GUI v2.18.0, bootloader on board is v3.1, connection speed is 115200, but I have also tried 9600 with the same results)
Zoomed in to the trailing edge of NSRT.
Programmer connection part:
And one last observation, is that it looks like the STM32 sees "something" and tries to respond, with a 0xFF, but not at a matching baud rate. So, maybe it can't determine the right baud rate for some reason.
Also, I have tried this on two boards with the same result.
2025-02-26 12:03 PM
> I'm seeing some strange oscillation on the NRST pin when it driven to a high.
NRST is both input and output for STM32. If the program calls software reset, or watchdog goes off, the MCU will reset and pulse the NRST pin.
2025-02-26 12:15 PM
OK, thanks that explains the pulsing. Still have no idea what I'm doing wrong where I can't get it into bootloader mode when using the reset, but can if I cycle power.