diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 084aca223..7db6818c9 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -494,7 +494,7 @@ jobs: strategy: fail-fast: false matrix: - arduino-platform: ["picow_rp2040_tinyusb"] + arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb"] steps: - uses: actions/setup-python@v5 with: diff --git a/examples/Wippersnapper_NoFS/.picow_rp2350_tinyusb.test.skip b/examples/Wippersnapper_NoFS/.picow_rp2350_tinyusb.test.skip new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/examples/Wippersnapper_NoFS/.picow_rp2350_tinyusb.test.skip @@ -0,0 +1 @@ + diff --git a/examples/Wippersnapper_demo/.picow_rp2350_tinyusb.generate b/examples/Wippersnapper_demo/.picow_rp2350_tinyusb.generate new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/examples/Wippersnapper_demo/.picow_rp2350_tinyusb.generate @@ -0,0 +1 @@ + diff --git a/examples/wippersnapper_debug/.picow_rp2350_tinyusb.test.skip b/examples/wippersnapper_debug/.picow_rp2350_tinyusb.test.skip new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/examples/wippersnapper_debug/.picow_rp2350_tinyusb.test.skip @@ -0,0 +1 @@ + diff --git a/platformio.ini b/platformio.ini index dd4acafc2..6b8decfd5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -112,9 +112,9 @@ lib_archive = no ; debug timer issues see https://community.platformio.org/t/cho lib_ignore = OneWire [common:rp2040] -platform = https://github.com/maxgerhardt/platform-raspberrypi.git +platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop ; platform_packages = -; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico +; ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico ; framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master board = rpipicow framework = arduino @@ -473,7 +473,7 @@ extends = common:rp2040 [env:raspberypi_picow_debug] extends = common:rp2040 -platform = https://github.com/maxgerhardt/platform-raspberrypi.git +; platform = https://github.com/maxgerhardt/platform-raspberrypi.git ; platform_packages = ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico ; framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master @@ -494,7 +494,7 @@ build_flags = -DDEBUG_RP2040_CORE -DDEBUG_RP2040_WIFI -DNDEBUG - -DLWIP_DEBUG + -DLWIP_DEBUG=1 -DDEBUG_RP2040_PORT=Serial1 -DDEBUG_RP2040_UART_1 -DDEBUG_RP2040_UART=1 @@ -511,3 +511,63 @@ build_flags = ; ; No USB stack ; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6 + + +[env:raspberypi_pico2w] +extends = common:rp2040 +platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop +platform_packages = + framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git +board = rpipico2w +build_flags = + -DWIFICC=CYW43_COUNTRY_UK + -DUSE_TINYUSB + ; -DARDUINO_ARCH_RP2040 + ; -DUSBD_MAX_POWER_MA=250 + ; -DPICO_CYW43_SUPPORTED=1 + +[env:raspberypi_pico2w_debug] +extends = common:rp2040 +platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop +platform_packages = + framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git +; ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico +board = rpipico2w +build_type = debug +framework = arduino +debug_tool = cmsis-dap +upload_protocol = cmsis-dap +; board can use both Arduino cores -- we select Arduino-Pico here +board_build.core = earlephilhower +board_build.filesystem_size = 0.5m +debug_init_break = tbreak runNetFSM +build_flags = + ; -UARDUINO + ; -DPICO_BUILD + -DARDUINO_ARCH_RP2040 + -DUSBD_MAX_POWER_MA=250 + -DPICO_CYW43_SUPPORTED=1 + -DWIFICC=CYW43_COUNTRY_UK + ; -DDEBUG + ; -DDEBUG_RP2040_WIRE + ; -DDEBUG_RP2040_SPI + ; -DDEBUG_RP2040_CORE + ; -DDEBUG_RP2040_WIFI + ; -DNDEBUG + ; -DLWIP_DEBUG + ; -DDEBUG_RP2040_PORT=Serial1 + ; -DDEBUG_RP2040_UART_1 + ; -DDEBUG_RP2040_UART=1 + -Og + ; Enable debug stack protection + -fstack-protector + ; Enable Exceptions + -DPIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS + ; Enable RTTI + -DPIO_FRAMEWORK_ARDUINO_ENABLE_RTTI + ; ; Enable default USB Stack of Pico SDK USB Stack with none of below usb options + ; Adafruit TinyUSB + -DUSE_TINYUSB + ; ; No USB stack + ; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB + ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6 diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 37e3db870..f98acb4e5 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -189,7 +189,12 @@ #define BOARD_ID "rpi-pico-w" #define USE_TINYUSB #define USE_STATUS_LED -#define STATUS_LED_PIN 32 +#define STATUS_LED_PIN LED_BUILTIN +#elif defined(ARDUINO_RASPBERRY_PI_PICO_2W) +#define BOARD_ID "rpi-pico-2w" +#define USE_TINYUSB +#define USE_STATUS_LED +#define STATUS_LED_PIN LED_BUILTIN #else #warning "Board type not identified within Wippersnapper_Boards.h!" #endif diff --git a/src/components/statusLED/Wippersnapper_StatusLED.cpp b/src/components/statusLED/Wippersnapper_StatusLED.cpp index 47b170462..464e0b8ba 100644 --- a/src/components/statusLED/Wippersnapper_StatusLED.cpp +++ b/src/components/statusLED/Wippersnapper_StatusLED.cpp @@ -83,7 +83,7 @@ void initStatusLED() { #elif defined(ARDUINO_ARCH_ESP32) WS._pwmComponent->attach(STATUS_LED_PIN, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT); WS._pwmComponent->writeDutyCycle(STATUS_LED_PIN, 0); // turn OFF -#elif defined(ARDUINO_RASPBERRY_PI_PICO_W) +#elif defined(ARDUINO_ARCH_RP2040) digitalWrite(STATUS_LED_PIN, 0); #else analogWrite(STATUS_LED_PIN, 0); @@ -177,7 +177,7 @@ void setStatusLEDColor(uint32_t color) { #ifdef USE_STATUS_LED if (!WS.lockStatusLED) return; // status pixel is in-use elsewhere -#ifdef ARDUINO_RASPBERRY_PI_PICO_W +#ifdef ARDUINO_ARCH_RP2040 digitalWrite(STATUS_LED_PIN, color > 0); #else if (color != BLACK) @@ -236,7 +236,7 @@ void setStatusLEDColor(uint32_t color, int brightness) { if (!WS.lockStatusLED) return; -#ifdef ARDUINO_RASPBERRY_PI_PICO_W +#ifdef ARDUINO_ARCH_RP2040 digitalWrite(STATUS_LED_PIN, color > 0); #else if (color != BLACK) { diff --git a/src/network_interfaces/ws_networking_pico.h b/src/network_interfaces/ws_networking_pico.h index 25ce278b1..0ea955112 100644 --- a/src/network_interfaces/ws_networking_pico.h +++ b/src/network_interfaces/ws_networking_pico.h @@ -137,12 +137,23 @@ class ws_networking_pico : public Wippersnapper { // User-set network not found, print scan results to serial console WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!"); - WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks: "); - for (int i = 0; i < n; ++i) { + WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:"); + for (uint8_t i = 0; i < n; ++i) { WS_DEBUG_PRINT(WiFi.SSID(i)); - WS_DEBUG_PRINT(" "); + WS_DEBUG_PRINT(" ("); + uint8_t BSSID[WL_MAC_ADDR_LENGTH]; + WiFi.BSSID(i, BSSID); + for (int m = 0; m < WL_MAC_ADDR_LENGTH; ++m) { + if (m != 0) { + WS_DEBUG_PRINT(":"); + } + WS_DEBUG_PRINTHEX(BSSID[m]); + } + WS_DEBUG_PRINT(") "); WS_DEBUG_PRINT(WiFi.RSSI(i)); - WS_DEBUG_PRINTLN("dB"); + WS_DEBUG_PRINT("dB (ch"); + WS_DEBUG_PRINT(WiFi.channel(i)) + WS_DEBUG_PRINTLN(")"); } return false; diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index d99c6098b..74e58a90f 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -24,7 +24,7 @@ defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_TFT) || \ - defined(ARDUINO_RASPBERRY_PI_PICO_W) || \ + defined(ARDUINO_ARCH_RP2040) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2)