cancel
Showing results for 
Search instead for 
Did you mean: 

Query: STM32F4 programming with USB

Mike xx
Associate III

I can program my bespoke board using a repurposed USB port. It would normally be used by a mouse.

I was under the impression that if I powered up the board with BOOT0 pin held high the MCU would be in a state to connect to USB and do it's enumeration. However, using USB Device Tree Viewer I can see the 43 error.

If I then hold the NRST pin low for a few seconds, and then release enumeration follows and I am able to program the device.

Is this expected operation? I thought simply powering up the PCB with BOOT0 high would place the MCU in the correct state ready for programming?

4 REPLIES 4
SofLit
ST Employee

Hello,

You need to reset the MCU after holding high the BOOT pin .

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

Thanks for confirming. I can't find any programming guide or application note that says that, hence the question.

Furthermore, I find for reliable connection I have to power up in reset, remove the reset link and then attach the USB cable to the socket.

In fact the whole process of connecting is a little unreliable depending on port and / or the USB hub.

Check you cable and your hardware.

You can either use reset or power cycle the MCU after pulling up the BOOT pin.

You can also refer to these articles:

DFU mode with system bootloader is not working, while USB does

FAQ STM32 boot process

How can I use STM32CubeProgrammer to access the USB-DFU bootloader on my STM32 board?

Hope that helps.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
TDK
Guru

Powering up with BOOT0 held high should be sufficient. Might be running into an issue with the crystal having a startup time.

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