On the Pico W I use the SDK cyw43_arch_gpio_get() function to report the USB power state. It works ... mostly. Occasionally it returns false even when USB power is connected. I use this to determine whether to go to low power mode and this causes false positives.
I'm using the arduino-pico core but this is a direct call to an SDK function.
I can work around the occasional hiccup by requiring it to return false for n consecutive calls before deciding to go to low power mode, but I can't guarantee that will always solve the problem.
Any thoughts ? I've checked the cable, connectors, USB voltage, etc, etc.
bool vbus_supplied(void) {
// Pico W uses wifi chip GPIO to detect USB power - pin 2
return cyw43_arch_gpio_get(CYW43_WL_GPIO_VBUS_PIN);
}
I'm using the arduino-pico core but this is a direct call to an SDK function.
I can work around the occasional hiccup by requiring it to return false for n consecutive calls before deciding to go to low power mode, but I can't guarantee that will always solve the problem.
Any thoughts ? I've checked the cable, connectors, USB voltage, etc, etc.
bool vbus_supplied(void) {
// Pico W uses wifi chip GPIO to detect USB power - pin 2
return cyw43_arch_gpio_get(CYW43_WL_GPIO_VBUS_PIN);
}
Statistics: Posted by obdevel — Wed Jul 17, 2024 1:59 am — Replies 0 — Views 31