Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pico2w #664

Merged
merged 7 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_demo/.picow_rp2350_tinyusb.generate
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

68 changes: 64 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
7 changes: 6 additions & 1 deletion src/Wippersnapper_Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/components/statusLED/Wippersnapper_StatusLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
19 changes: 15 additions & 4 deletions src/network_interfaces/ws_networking_pico.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading