Skip to main content
Visitor II
January 6, 2021
Question

With the STM32F417VGT6 chip used, after PA11 PA12 is configured as USB HOST (non-OTG mode, HNP or SRP mode is not used), PA9 cannot be configured as input pull-up mode.

  • January 6, 2021
  • 3 replies
  • 1743 views

After using STM32F417VGT6 chip, PA11 PA12 is configured as USB HOST (non-OTG mode, HNP or SRP mode is not used), PA9 cannot be configured as input pull-up mode; without USB HOST, PA9 can be configured as input pull-up Yes; try to configure PA9 to output pull-up or serial port can be used normally; configure PA9 to input pull-up mode, without connecting any peripherals, measure PA9 pin as low level. When using PA11 PA12 USB HOST, do you configure PA9 as input pull-up?

    This topic has been closed for replies.

    3 replies

    qyuyu.1Author
    Visitor II
    January 6, 2021

    Sorry, my chip model is wrong, it is STM32F205RET6.

    Super User
    January 6, 2021

    Is this some "library" like Cube? Then read the library's manual to find out how to avoid VBUS sensing. It's controlled by bits in GCCFG register which override any GPIO setting for PA9.

    JW

    qyuyu.1Author
    Visitor II
    January 6, 2021

    Thank you very much JW.

    My USB library version is relatively old, not cube. Check the GCCGF register, there are two positions (NOVBUSSENS and VBUSASEN) that will affect VBUS. According to the register analysis, NOVBUSSENS controls whether the VBUS sense is valid; check the drive code NOVBUSSENS is set to 1, and VBUSASEN is also set to 1; According to the manual analysis, it should be that VBUS sense is invalid. In fact, PA9 still cannot be used as an input pull-up; try to set VBUSASEN to 0, PA9 can be used as an input pull-up.

    If so, JW would you please help me analyze if there is a problem with my modification?

    Anyway, thank you JW.

    Modify the code:

    0693W000006HfB8QAK.png

    GCCFG register:0693W000006Hf6mQAC.png

    Super User
    January 7, 2021

    I don't know if your code is in any way dependent on the sense enabled by VBUSASEN, but quite likely it's not.

    Setting GCCFG.NOVBUSSENS has the same effect than pulling VBUS pin high, regardless of GCCFG.VBUSBSEN. I'm not sure about VBUSASEN, but I'd be surprised if it would be different.

    JW

    qyuyu.1Author
    Visitor II
    January 7, 2021

    Thank you JW.

    The board I use is self-powered and does not require VBUS sense. The program controls whether to turn on VBUS sense according to whether the macro VBUS_SENSING_ENABLED is defined; if the code is not modified, VBUSASEN is always 1, and the VBUS sense is controlled by NOVBUSSENS set to 1 or 0.

    After communicating with you, I found a better modification method as follows.

    0693W000006HlypQAC.png