2022-10-28 09:53 AM
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
2022-10-28 10:07 AM
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.
2022-10-28 10:28 AM
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 !
2022-10-28 10:40 AM
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
2022-10-28 10:58 AM
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?
2022-10-28 11:27 PM
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.
2022-10-29 12:40 AM
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.