Pedro Ramilo
Pedro Ramilo

Reputation: 189

Activating DFU (USB programming) on STM32F303

I am building a board based on the STM32F303RET6.

The Processor Datasheet, page 17/section 3.5, mentions programming can be done "using USART1 (PA9/PA10), USART2 (PA2/PA3) or USB (PA11/PA12) through DFU (device firmware upgrade)"

I am using a NUCLEO board with this processor.

I have connected the Vdd, Gnd, D+ and D- pins of USB to a NUCLEO board and disabled the power from the add-on programmer board.

However whenever I reboot it with BOOT0 HIGH the USB never enumerates any device. I am connecting the pins directly to the USB plug without any external resistor. The datasheet seems to suggest these are not needed.

To make things a bit trickier, this processor has the additional particularity of not having a BOOT1 pin; it is a software bit.

My question is, does the processor actually support DFU by using the built in bootloader? If so, how should one go about starting it and programming via USB?

Thank you very much, Pedro.

PS: ST has actually got conflicting information about support for USB programming on this processor. While the Datasheet says it's supported, Application Note AN2606, page 81 (section 19) only mentions support for programming via USART1, USART 2 and I2C. It references the USARTs but it's unclear how they can be used.

Upvotes: 2

Views: 5517

Answers (1)

I have connected the Vdd, Gnd, D+ and D- pins of USB to a NUCLEO board and disabled the power from the add-on programmer board.

Check the actual voltage and current on Vdd. The host might limit the current, or shut the port down when the consumption exceeds 100mA before enumeration. Try it with an external power supply.

I am connecting the pins directly to the USB plug without any external resistor.

You need an 1.5k pullup on D+ (full speed) or D- (low speed). This is from the STM32F3 Discovery schematics (that's an OTG socket, ignore the ID line for regular 4-wire ports)

enter image description here

When there is no pullup, the host can't detect when the device is plugged in, and therefore won't enumerate it.

ST has actually got conflicting information about support for USB programming on this processor. While the Datasheet says it's supported, Application Note AN2606, page 81 (section 19) only mentions support for programming via USART1, USART 2 and I2C.

There is no conflicting information there. Section 19 on page 81 refers to some other controllers.

The capabilities of your STM32F303RET6 are listed in table 36, section 18.1 on page 77. (As I've already pointed it out.) See also table 3 on page 23, line STM32F302xD(E)/303xD(E).

Upvotes: 1

Related Questions