cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 DFU USB CDC

AAgar.2
Associate III

Is it possible to do a DFU/SFU via USB CDC, how? On the UM2262 Applicate Note it mentioned on page 39 that local firmware download can be done through a UART Virtual COM port. I assume UART Virtual COM port is not the same as USB CDC. 

Appreciate your support.

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

DFU and CDC are different USB protocols. So no, if you want DFU, it is not CDC.

>  I assume UART Virtual COM port is not the same as USB CDC.

Virtual COM port is the same as USB CDC (more correctly, a subset of CDC).

-- pa

View solution in original post

7 REPLIES 7
Pavel A.
Evangelist III

DFU and CDC are different USB protocols. So no, if you want DFU, it is not CDC.

>  I assume UART Virtual COM port is not the same as USB CDC.

Virtual COM port is the same as USB CDC (more correctly, a subset of CDC).

-- pa

Does UART Virtual COM port = Virtual COM port?

Is there a difference in hardware wiring for DFU vs CDC?

Can I use both DFU and CDC modes (with composite interface)?

Appreciate your time.

Pavel A.
Evangelist III

> Does UART Virtual COM port = Virtual COM port?

UART is a normal physical COM port. Not virtual. "Virtual COM port" in this context usually means USB.

> Is there a difference in hardware wiring for DFU vs CDC?

No, the difference is only in protocol.

> Can I use both DFU and CDC modes (with composite interface)?

Sure, if there are enough available endpoints for all interfaces,

-- pa

> UART is a normal physical COM port. Not virtual. "Virtual COM port" in this context usually means USB.

Thats what I figured but was confused when the UM2262 documentation said "UART Virtual COM" on page 39. Thanks for clarifying.

> Sure, if there are enough available endpoints for all interfaces,

What does endpoint mean? What I would want to do is only use one interface at a time (either CDC or DFU).

One more question as an aside. Is any of this different in terms of hardware wiring for SFU? (is the difference between DFU and SFU only in protocol).

Pavel A.
Evangelist III

Endpoints are the "pipes" of the USB device controller. Each interface of a composite USB device has some number of input or output endpoints.

For details, please read some USB tutorial online, or a book.

Even if the host uses only one interface at a time, you should populate all declared interfaces with endpoints. Else there is no point to declare an interface. How the device can guess which interface the host will use?

Sorry, I don't know much about SFU (Secure firmware update?)

-- pa

Got it definitely need some reading on USB.

I was looking around for some more information on DFU and I am finding that sometimes BOOT0 is required to use DFU. Is BOOT0 wiring required to do DFU or can you just use the standard USB pins (D+, D-, VDD and GND).

TDK
Guru

> Is BOOT0 wiring required to do DFU or can you just use the standard USB pins (D+, D-, VDD and GND).

In order to get into the bootloader, you need to have BOOT0 shorted to 3V3 during reset, or you need to jump to the bootloader from your application. Otherwise, if you want the DFU protocol supported in your application, that's something you need to implement yourself.

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