Skip to main content
Visitor II
October 29, 2020
Solved

Problem with USB Host on NUCLEO L496ZG - device not powered

  • October 29, 2020
  • 1 reply
  • 768 views

Hi,

I bought a nucleo L496ZG, and I would like to connect a keyboard to it's micro USB. I read the nucleo manual that I need to enable the PowerPin (PG6), I did it. Now the LD8 should light and the device should get power, but nothing happens.

Does anybody have experience with USB Host?

    This topic has been closed for replies.
    Best answer by kurta999

    I almost break out the micro usb plug and throw the board into furnace, but thank to god I found the problem. CubeMX generates wrong code in MX_DriverVbusFS.

    The pin state should be oppisite as CubeMX generates it, here is the correct one:

     if(state == 0)

     {

      /* Drive high Charge pump */

      data = GPIO_PIN_RESET;

     }

     else

     {

      /* Drive low Charge pump */

      data = GPIO_PIN_SET;

     }

    Please look after this bug and fix it.

    1 reply

    kurta999AuthorAnswer
    Visitor II
    October 29, 2020

    I almost break out the micro usb plug and throw the board into furnace, but thank to god I found the problem. CubeMX generates wrong code in MX_DriverVbusFS.

    The pin state should be oppisite as CubeMX generates it, here is the correct one:

     if(state == 0)

     {

      /* Drive high Charge pump */

      data = GPIO_PIN_RESET;

     }

     else

     {

      /* Drive low Charge pump */

      data = GPIO_PIN_SET;

     }

    Please look after this bug and fix it.