Page 1 of 1

Example code for Serial Communication over USB

Posted: Fri May 25, 2012 3:55 am
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

Re: Example code for Serial Communication over USB

Posted: Fri May 25, 2012 7:23 am
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

Re: Example code for Serial Communication over USB

Posted: Wed May 30, 2012 1:04 am
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

Re: Example code for Serial Communication over USB

Posted: Wed May 30, 2012 6:26 am
by Giovanni
Hi,

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

Giovanni

Re: Example code for Serial Communication over USB

Posted: Sat Jun 02, 2012 2:50 am
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