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: 7
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: 742
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
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: 7
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: 307
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
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: 262
Joined: Thu Dec 19, 2019 1:23 am
Answers: 1

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: 7
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”