2020-10-29 08:52 AM
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?
Solved! Go to Solution.
2020-10-29 12:29 PM
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.
2020-10-29 12:29 PM
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.