can USB be used to create a virtual com port?
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
can USB be used to create a virtual com port?
Hi,
Some controllers come with onboard USB functionality.
Can this interface be used to create a com port similar to the VCP that is available through the onboard ST-Link?
Some controllers come with onboard USB functionality.
Can this interface be used to create a com port similar to the VCP that is available through the onboard ST-Link?
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: can USB be used to create a virtual com port?
If this is too dumb a question, could someone please point me in the right direction to find an answer myself?
Thanks
Thanks
Re: can USB be used to create a virtual com port?
You may like to order one of those boards, like the stm32f405 feather board from Adafruit
https://learn.adafruit.com/adafruit-stm ... -ide-setup
https://learn.adafruit.com/adafruit-stm ... er-details
or one of those stm32f401 blackpills
https://www.aliexpress.com/wholesale?ca ... =stm32f401
Those have USB default on the connector. They use USB Serial (i.e. VCP)
That is normally USB CDC Serial on the selection menu in Arduino IDE
it is the same with 'blue pills' stm32f103, but for 'newbies', starting with stm32f4xx would have an easier life.
If you get a stm32f103 e.g. blue pills, u'd need in addition that st-link dongle or a usb-uart dongle in addition to program it.
There are more from others, e.g. Olimex
https://www.olimex.com/Products/ARM/ST/
https://www.olimex.com/Products/Duino/S ... e-hardware
https://learn.adafruit.com/adafruit-stm ... -ide-setup
https://learn.adafruit.com/adafruit-stm ... er-details
or one of those stm32f401 blackpills
https://www.aliexpress.com/wholesale?ca ... =stm32f401
Those have USB default on the connector. They use USB Serial (i.e. VCP)
That is normally USB CDC Serial on the selection menu in Arduino IDE
it is the same with 'blue pills' stm32f103, but for 'newbies', starting with stm32f4xx would have an easier life.
If you get a stm32f103 e.g. blue pills, u'd need in addition that st-link dongle or a usb-uart dongle in addition to program it.
There are more from others, e.g. Olimex
https://www.olimex.com/Products/ARM/ST/
https://www.olimex.com/Products/Duino/S ... e-hardware
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: can USB be used to create a virtual com port?
ok, did I get this right that I "just" have to configure USB CDC in the Arduino IDE and then I can get VCP support?
that would be pretty straight forward
that would be pretty straight forward

Re: can USB be used to create a virtual com port?
yesSTM32_Newbbe wrote: Thu Sep 16, 2021 9:36 am ok, did I get this right that I "just" have to configure USB CDC in the Arduino IDE and then I can get VCP support?
that would be pretty straight forward![]()
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: can USB be used to create a virtual com port?
so easy
thanks to everyone who helped making stm32duino possible
thanks to everyone who helped making stm32duino possible

-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: can USB be used to create a virtual com port?
I have to come back to this...
default HW Serial is LPUART1 on some STM32Lxxx Nucleos
when I enable CDC Serial supersedes U(S)ART, I get Serial output from generic Serial on the USB VCP
When I try to output something over LPUART1 using SerialLP1.print(), I get no output
trying to define Hardwareserial Serial.LP1 throws an multiple defintion error
Can I not use USB Serial and LPUART1 at the same time?
default HW Serial is LPUART1 on some STM32Lxxx Nucleos
when I enable CDC Serial supersedes U(S)ART, I get Serial output from generic Serial on the USB VCP
When I try to output something over LPUART1 using SerialLP1.print(), I get no output
trying to define Hardwareserial Serial.LP1 throws an multiple defintion error
Can I not use USB Serial and LPUART1 at the same time?
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: can USB be used to create a virtual com port?
which board?
Nucleo-L4R5ZI
which error?
Nucleo-L4R5ZI
which error?
c:/sloeber/arduinoplugin/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\xXxXxXxXx\Test_L4R5\Release/arduino.ar(HardwareSerial.cpp.o):(.bss.SerialLP1+0x0): multiple definition of `SerialLP1'; .\Test_L4R5.cpp.o:(.bss.SerialLP1+0x0): first defined here
Re: can USB be used to create a virtual com port?
SerialLP1 is created by default. So this is normal you get this error as it is defined twice.