cancel
Showing results for 
Search instead for 
Did you mean: 

F107 USB OTG as a device only

DiBosco
Senior
Posted on May 05, 2016 at 19:13

Folks,

I have code for using the F103's USB device port as a virtual com port. Does anyone know:

1. Could I use that ''as is'' on the F107's OTG port. I only ever want to use it as a device.

2. Do I really have to have  OTG_FS_VBUS connected to the USB connector's 5V line? Sadly, the board's been laid out with PA9 - which is the VBUS connector - as the USART function.

Thanks!

Rob

3 REPLIES 3
slimen
Senior
Posted on May 06, 2016 at 15:39

Hi,

I'd recommend you to have a look to the

http://www2.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

, paragraph ''13.3.4  PA9 excessive power consumption when USB cable is plugged in bootloader V2.0 :

When connecting a USB cable after booting from System-Memory mode, PA9 pin (connected to VBUS=5 V) is also shared with USART TX pin which is configured as alternate push-pull and forced to 0 since the USART peripheral is not yet clocked. As a consequence, a current higher than 25 mA is drained by PA9 I/O and may affect the I/O pad reliability.

This limitation is fixed in bootloader version 2.1 by configuring PA9 as alternate function push-pull when a correct 0x7F is received on RX pin and the USART is clocked. Otherwise, PA9 is configured as alternate input floating. 

''

Regards

DiBosco
Senior
Posted on May 09, 2016 at 11:10

Hi,

I'm not worried about the bootloader as we're doing that over USB and Ethernet.

I'm concerned over whether I can use the F103 device code as is with the OTG peripheral and whether it will work if I ignore PA9.

Thanks!

DiBosco
Senior
Posted on May 12, 2016 at 19:43

Bump!

Has no-one done this? Has no-one used the F107 as a CDC? Do you *have* to invoke the OTG_DEV_Init() for example? Can you just run it exactly as the F103? I've tried the latter, but absolutely no registers in the USB_OTG_DEVICE module are being set. If I try and compile for OTG support I get zillions of errors. I suspect partly because I'm using such old libraries with this very old version of FreeRTOS.

I'm chasing my tail here and would *really* appreciate some advice from someone who has implemented this as a CDC or VCP device - which terminology you prefer.

Most especially, if I don't implement OTG_FS_VBUS

 am I doomed to failure, even if I manage to compile for USB_OTG support?

Many thanks.