Skip to main content
Visitor II
July 11, 2016
Question

Configure GPIOs PA11 and PA12 to USB D+ and D-

  • July 11, 2016
  • 3 replies
  • 1688 views
Posted on July 11, 2016 at 17:27

I'm working with STM32F070xB

I need to configure GPIOs PA11 and PA12 to USB D+ and D- alternate function. According to datasheet it is listed as Additional functions (not Alternate) USB_DM and USB_DP.

It is not clear how to configure these GPIO for USB functionality. If they are not Alternate functions so how can I reach desired functionality?

We are not using Standard Peripheral Library. I need explanation in terms of GPIO port registers.

Thanks.

    This topic has been closed for replies.

    3 replies

    Graduate II
    July 11, 2016
    Posted on July 11, 2016 at 19:59

    I suspect that it has specialized pin-drivers that recognize and perform the USB connectivity, switching out the normal driver/af behaviour. Don't think you get to configure them. This is a user forum, use the online support or CALL your local ST office or FAE.

    dimaxAuthor
    Visitor II
    July 19, 2016
    Posted on July 19, 2016 at 18:26

    Got a reply from online support. You are right USB functionality takes over GPIO driver. 

    Now I have another problem. For some reason I can't write endpoint registers EP0R for instance, while I do can write control registers like CNTR. I'm getting USB RESET interrupt and try to configure EP0 but for some reason writes to EP0R are inhibited. Do you know what can be a problem? Some clock is missing?

    Graduate
    March 3, 2024

    Do you find the cause of your problem with EP0 inhibited problem?

    August 2, 2016
    Posted on August 02, 2016 at 03:35

    Did you find out the reason for this? I can also write to various USB registers but not the endpoint registers EPnR etc.