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

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
Leviro
Posts: 11
Joined: Sat Aug 01, 2020 9:07 am

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

Post 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.
by fpiSTM » Fri Oct 16, 2020 8:09 am
Enable the USB support in the menu...
Go to full post
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

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

Post by fpiSTM »

Enable the USB support in the menu...
Leviro
Posts: 11
Joined: Sat Aug 01, 2020 9:07 am

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

Post by Leviro »

Oh that's great! I didn't know that was a thing.
Okay then, how can I send/receive data?
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

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

Post by stevestrong »

Serial.print()...
Serial.read()...
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

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

Post 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
Leviro
Posts: 11
Joined: Sat Aug 01, 2020 9:07 am

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

Post by Leviro »

Thanks everyone!
Post Reply

Return to “General discussion”