Communication with cyw43 fails at system clock speeds <= 60MHz #1392

Closed
opened 2023-05-25 09:22:04 -05:00 by MichaelBell · 2 comments
MichaelBell commented 2023-05-25 09:22:04 -05:00 (Migrated from github.com)

It's sometimes useful to run the RP2040 quite slowly to reduce power consumption. I'm not sure whether it is reasonable to expect Wifi to continue to work at low clock speeds - but I think it is reasonable to at least expect to be able to use the CYW43 GPIO.

However, at around 60MHz and below setting/reading the GPIO from the CYW43 doesn't work. This means you can't determine whether VBUS is present, and can't control the LED.

A simple repro is to add set_sys_clock_48mhz() to the top of the pico_w blink example.

index 149b477..600e2a2 100644
--- a/pico_w/wifi/blink/picow_blink.c
+++ b/pico_w/wifi/blink/picow_blink.c
@@ -8,6 +8,7 @@
 #include "pico/cyw43_arch.h"

 int main() {
+    set_sys_clock_48mhz();
     stdio_init_all();
     if (cyw43_arch_init()) {
         printf("Wi-Fi init failed");
It's sometimes useful to run the RP2040 quite slowly to reduce power consumption. I'm not sure whether it is reasonable to expect Wifi to continue to work at low clock speeds - but I think it is reasonable to at least expect to be able to use the CYW43 GPIO. However, at around 60MHz and below setting/reading the GPIO from the CYW43 doesn't work. This means you can't determine whether VBUS is present, and can't control the LED. A simple repro is to add set_sys_clock_48mhz() to the top of the pico_w blink example. ```diff index 149b477..600e2a2 100644 --- a/pico_w/wifi/blink/picow_blink.c +++ b/pico_w/wifi/blink/picow_blink.c @@ -8,6 +8,7 @@ #include "pico/cyw43_arch.h" int main() { + set_sys_clock_48mhz(); stdio_init_all(); if (cyw43_arch_init()) { printf("Wi-Fi init failed"); ```
mvds00 commented 2023-10-23 04:15:53 -05:00 (Migrated from github.com)

WiFi works flawlessly for us with the Pi Pico running at 12 MHz from xosc. Set clock divider at 1 and spi program spi_gap01_sample0. Running at 48 MHz (to enable USB stdio) clock divider 2 and spi program spi_gap0_sample1 can be used, IIRC.

WiFi works flawlessly for us with the Pi Pico running at 12 MHz from xosc. Set clock divider at 1 and spi program spi_gap01_sample0. Running at 48 MHz (to enable USB stdio) clock divider 2 and spi program spi_gap0_sample1 can be used, IIRC.
peterharperuk commented 2024-08-09 06:55:57 -05:00 (Migrated from github.com)

I seem to be able to be able to use cyw43 to flash the led when running from xosc by calling the new function cyw43_set_pio_clock_divisor(1, 0). I didn't seem to have to set CYW43_SPI_PROGRAM_NAME? Anyway - I think this is resolved now as you shouldn't have to hack the code?

I seem to be able to be able to use cyw43 to flash the led when running from xosc by calling the new function cyw43_set_pio_clock_divisor(1, 0). I didn't seem to have to set CYW43_SPI_PROGRAM_NAME? Anyway - I think this is resolved now as you shouldn't have to hack the code?
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#1392
No description provided.