Example code for Serial Communication over USB

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
sapan
Posts: 56
Joined: Sat Dec 24, 2011 1:22 pm

Example code for Serial Communication over USB

Post by sapan »

Hi,

I want to transfer data over USB through Serial Over USB mode. Is there any sample code for STM32F4 Discovery board where I can send and receive data using hyper terminal.

Sapan
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Example code for Serial Communication over USB

Post by Giovanni »

Hi,

The STM32F4 OTG peripheral is not supported yet. The current USB driver is compatible with STM32F103 and STM32L1xx.

Work for F4 support is ongoing.

Giovanni
MarkusS
Posts: 14
Joined: Tue Mar 13, 2012 6:52 pm
Has thanked: 1 time

Re: Example code for Serial Communication over USB

Post by MarkusS »

Giovanni,

I would like to use USB (serial or any other protocol) to configure a board using a STM32F103. I looked through all demos/examples but could not find any code using the USB driver. Do you have a simple example using the USB driver you could share?

Thanks,

Markus
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Example code for Serial Communication over USB

Post by Giovanni »

Hi,

A demo is located under ./testhal/STM32F1xx/USB_CDC

Giovanni
MarkusS
Posts: 14
Joined: Tue Mar 13, 2012 6:52 pm
Has thanked: 1 time

Re: Example code for Serial Communication over USB

Post by MarkusS »

Giovanni,

thanks for the quick response. Works like a charm on my modded STM32VLDiscovery board.
I replaced the VL uC with a STM32F103RG XL):
--------- snip ----------
ChibiOS/RT Shell
ch> info
Kernel: 2.5.0
Compiler: GCC 4.6.0
Architecture: ARMv7-M
Core Variant: Cortex-M3
Port Info: Advanced kernel mode
Platform: STM32F1 Performance Line eXtra Density
Board: ST STM32VL-DiscoveryXL
Build time: Jun 1 2012 - 17:46:49
ch>
--------- snip ----------

Thanks again,
Markus
Post Reply