USB Device OTG FS

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
chelox
Posts: 17
Joined: Tue Jan 22, 2013 8:24 pm

USB Device OTG FS

Post by chelox »

Hello!

I'm testing a board similar to Olimex STM32-E407, the difference is that it has a single USB_OTG.
This is connected to PA11/OTG_FS_DM and PA12/OTG_FS_DP.

I run the demos ARMCM4-STM32F407-lwIP-FATFS-USB and doing well!
What does not work is in USB_OTG1 serial_usb.

Viewing hardware note that this board is not connected in USB_OTG1: PA9/OTG_FS_VBUS and PA10/OTG_FS_ID.

Could this be the problem? Or having a single USB_OTG need not PA9/OTG_FS_VBUS and P10/OTG_FS_ID are connected?

Thank you!
Attachments
Only USB_OTG
Only USB_OTG
OTG_1.png (42.36 KiB) Viewed 7998 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: USB Device OTG FS

Post by Giovanni »

Hi,

Not having those two signals should not be a problem but I never tested the scenario.

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: USB Device OTG FS

Post by Tectu »

You don't need the ID pin as long as you're only in device mode. Simply keep it N/C.
Since you're now in device mode, your MCU does detect for a "connected"-event by checking the VBUS pin. Therefore, you need to connect this - or keep it high all the time, but I don't know how to handle the software in that case then.


~ Tectu
chelox
Posts: 17
Joined: Tue Jan 22, 2013 8:24 pm

Re: USB Device OTG FS

Post by chelox »

Ok! thank you!

Would have to modify the HAL interface for this case serial_usb...
chelox
Posts: 17
Joined: Tue Jan 22, 2013 8:24 pm

Re: USB Device OTG FS

Post by chelox »

Well! It worked!
Add the flag GCCFG_NOVBUSSENS in the file usb_lld.c

/* Internal FS PHY activation.*/
otgp->GCCFG = GCCFG_VBUSASEN | GCCFG_VBUSBSEN | GCCFG_PWRDWN | GCCFG_NOVBUSSENS;

Thanks!
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: USB Device OTG FS

Post by Tectu »

Oh yes, I knew the NOVBUSSENSE flag but I completely forgot to mention it. I'm sorry!
But glad to hear that you got it running now :)


~ Tectu
Post Reply