cancel
Showing results for 
Search instead for 
Did you mean: 

DFU and USART on USB

Manny12
Associate III

Sorry about the dumb question.

Is it possible to have DFU and USART on the same USB port on a custom board?

I just want to upload firmware via USB and have the ability to receive sensor data output via UART using a virtual com port.

Two different things, on the same USB connector, not at the same time.

I know I cannot just wire USART to USB. Some online posts say you need an FTD chip, such as the ftd232, included on the board's design.

Is that the right approach?, basically include an ftd232 on the board, wire it to the USART on the STM32 chip, and use that as a virtual com port and to program the MCU.

Is there a better approach?

Thanks a lot

6 REPLIES 6

Not as a "USART" but a Virtual CDC / VCP USB Device implementation.

Which STM32 part? There like a thousand of unavailable ones at this point..

A single device could support multiple classes, with software/descriptors, and sufficient end-points. An MSC can support multiple Logical Units (LUNS)

For other "single cable" type devices, there are USB Hub chips where you could support multiple USB Devices on your PCB. There are also DUAL and QUAD CDC/VCP parts.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Manny12
Associate III

Sorry,, the STM32F401C is what is on my mind.

They have some in stock from where I order my PCBs

And yes, the stock is very bad, I noticed, I wonder what will happen in the near future with consumer electronics if things keep staying the same.

Regarding your answer, you did point me in the right direction. I appreciate it, thanks !

MM..1
Chief III

401 have USB DFU system bootloader, but you will need hw or sw switching method between DFU and APP mode. (app as CDC) No ftdi required, only usb con and cable

Yes, the datasheet says it does have DFU, page 18. I still cannot make my test board work with DFU properly, but that's for another post.

How do you switch modes in hw? I can imagine how with software+hw (using interrupts from a momentary switch), is that what you mean, or there is an option just with a jumper or switch?

gbm
Lead III

BOOT0 pin - essential part of any STM32 chip operation. In boot mode the MCU will act as DFU by itself, you may implement USB CDC (VCOM) in your app firmware. Yo may also invoke the built-in bootloader from your app.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
MM..1
Chief III

Read AN2606 and for sw vs hw you need method to activate DFU

SW is for example menu on display with jump to bootloader call.

HW is for example jumper , that changes BOOT0 high for power on reset.