cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with USB Host on NUCLEO L496ZG - device not powered

kurta999
Senior

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?

1 ACCEPTED SOLUTION

Accepted Solutions
kurta999
Senior

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.

View solution in original post

1 REPLY 1
kurta999
Senior

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.