Page 1 of 1

Is it possible to establish USB communication on STM32F1 Blue Pill?

Posted: Fri Oct 16, 2020 7:56 am
by Leviro
Board: STM32F103C8T6 (Blue Pill)
IDE: Arduino IDE
Core: Official core

I couldn't find any page mentioning USB communication neither in the GitHub wiki of the core nor here on the forums. So, is it possible to use USB communication to send and receive data alongside some existing code written on Arduino IDE? If yes, where can I find more information about it, I'm new to STM32 microcontrollers.

Re: Is it possible to establish USB communication on STM32F1 Blue Pill?

Posted: Fri Oct 16, 2020 8:09 am
by fpiSTM
Enable the USB support in the menu...

Re: Is it possible to establish USB communication on STM32F1 Blue Pill?

Posted: Sat Oct 17, 2020 9:34 am
by Leviro
Oh that's great! I didn't know that was a thing.
Okay then, how can I send/receive data?

Re: Is it possible to establish USB communication on STM32F1 Blue Pill?

Posted: Sat Oct 17, 2020 10:26 am
by stevestrong
Serial.print()...
Serial.read()...

Re: Is it possible to establish USB communication on STM32F1 Blue Pill?

Posted: Sun Oct 18, 2020 12:14 am
by mrburnette
https://stm32duinoforum.com/forum/wiki_ ... USB_Serial


Roger's libmaple core
Serial & USB Serial
Serial USB is enabled for all F103 boards when uploading using the bootloader, it is also available when uploading by ST-Link (SWD) In these cases:

Serial.print("Hello world"); will print via Serial USB (CDC).
Serial1 prints to hardware USART 1
Serial2 prints to hardware USART 2
etc
When uploading via "Serial" (external USB to Serial adaptor connected to PA9 and PA10 (USART1) on the STM32):

Serial.print("Hello world"); will print to hardware USART1 (the one the code was uploaded using)
Serial1 prints to hardware USART 2
etc

Re: Is it possible to establish USB communication on STM32F1 Blue Pill?

Posted: Sun Oct 18, 2020 6:29 pm
by Leviro
Thanks everyone!