Skip to content

Commit

Permalink
[RP2XXX] more of RP2350 build infra
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Nov 27, 2024
1 parent 6bae831 commit e8b1d84
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 34 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ jobs:
'arduino:renesas_uno:unor4wifi',
'rp2040:rp2040:generic',
'rp2040:rp2040:rpipicow',
'rp2040:rp2040:rpipico2',
'rp2040:rp2040:rpipico2:arch=arm',
'rp2040:rp2040:rpipico2:arch=riscv',
#'rp2040:rp2040:rpipico2w:arch=arm',
#'rp2040:rp2040:rpipico2w:arch=riscv',
'arduino:mbed_rp2040:pico',
#'arduino:mbed_nano:nanorp2040connect',
'SiliconLabs:silabs:nano_matter:protocol_stack=ble_arduino',
Expand Down Expand Up @@ -408,6 +411,7 @@ jobs:
if [[ "$BOARD" =~ "rp2040:rp2040:" ]]; then
arduino --pref "boardsmanager.additional.urls=https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json" --save-prefs ;
arduino --install-boards rp2040:rp2040:4.2.1 ;
#arduino --install-boards rp2040:rp2040:4.3.0 ;
arduino --board $BOARD --save-prefs ;
if [[ "$BOARD" =~ "rp2040:rp2040:rpipicow" ]]; then
arduino --pref "custom_freq=rpipicow_120" --save-prefs ;
Expand Down
12 changes: 12 additions & 0 deletions software/firmware/source/SkyView/Platform_RP2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ static void RP2040_fini()
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
if (RP2040_board == RP2040_RPIPICO_W) {
if (cyw43_is_initialized(&cyw43_state)) cyw43_arch_deinit();
#if !(ARDUINO_PICO_MAJOR == 4 && ARDUINO_PICO_MINOR == 3 && ARDUINO_PICO_REVISION == 0)
pinMode(CYW43_PIN_WL_REG_ON, INPUT_PULLDOWN);
#endif
}
#endif /* ARDUINO_RASPBERRY_PI_PICO_W */

Expand Down Expand Up @@ -1792,8 +1794,18 @@ IODev_ops_t RP2040_USBSerial_ops = {
};

const SoC_ops_t RP2040_ops = {
#if defined(PICO_RP2350)
#if defined(PICO_RISCV)
SOC_RP2350_RISC,
"RP2350-RISC",
#else
SOC_RP2350_ARM,
"RP2350-ARM",
#endif /* PICO_RISCV */
#else
SOC_RP2040,
"RP2040",
#endif /* PICO_RP2350 */
RP2040_setup,
RP2040_post_init,
RP2040_loop,
Expand Down
2 changes: 2 additions & 0 deletions software/firmware/source/SkyView/Platform_RP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ enum RP2040_board_id {
RP2040_RPIPICO,
RP2040_RPIPICO_W,
RP2040_WEACT,
RP2350_RPIPICO_2,
RP2350_RPIPICO_2W,
};

/* Console I/O */
Expand Down
10 changes: 9 additions & 1 deletion software/firmware/source/SkyView/SoCHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ enum
SOC_ESP32,
SOC_ESP32S2,
SOC_ESP32S3,
SOC_ESP32C2,
SOC_ESP32C3,
SOC_ESP32C6,
SOC_ESP32H2,
SOC_ESP32P4,
SOC_RPi,
SOC_CC13X0,
SOC_CC13X2,
Expand All @@ -86,7 +89,12 @@ enum
SOC_SAMD,
SOC_AVR,
SOC_ASR66,
SOC_RP2040
SOC_RP2040,
SOC_RP2350_ARM,
SOC_RP2350_RISC,
SOC_RA4M1,
SOC_EFR32,
SOC_CH32
};

extern const SoC_ops_t *SoC;
Expand Down
10 changes: 10 additions & 0 deletions software/firmware/source/SkyWatch/Platform_RP2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,18 @@ IODev_ops_t RP2040_USBSerial_ops = {
};

const SoC_ops_t RP2040_ops = {
#if defined(PICO_RP2350)
#if defined(PICO_RISCV)
SOC_RP2350_RISC,
"RP2350-RISC",
#else
SOC_RP2350_ARM,
"RP2350-ARM",
#endif /* PICO_RISCV */
#else
SOC_RP2040,
"RP2040",
#endif /* PICO_RP2350 */
RP2040_setup,
RP2040_post_init,
RP2040_loop,
Expand Down
2 changes: 2 additions & 0 deletions software/firmware/source/SkyWatch/Platform_RP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ enum RP2040_board_id {
RP2040_RPIPICO,
RP2040_RPIPICO_W,
RP2040_WEACT,
RP2350_RPIPICO_2,
RP2350_RPIPICO_2W,
};

/* Console I/O */
Expand Down
10 changes: 9 additions & 1 deletion software/firmware/source/SkyWatch/SoCHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ enum
SOC_ESP32,
SOC_ESP32S2,
SOC_ESP32S3,
SOC_ESP32C2,
SOC_ESP32C3,
SOC_ESP32C6,
SOC_ESP32H2,
SOC_ESP32P4,
SOC_RPi,
SOC_CC13X0,
SOC_CC13X2,
Expand All @@ -83,7 +86,12 @@ enum
SOC_SAMD,
SOC_AVR,
SOC_ASR66,
SOC_RP2040
SOC_RP2040,
SOC_RP2350_ARM,
SOC_RP2350_RISC,
SOC_RA4M1,
SOC_EFR32,
SOC_CH32
};

extern const SoC_ops_t *SoC;
Expand Down
3 changes: 2 additions & 1 deletion software/firmware/source/SoftRF/src/driver/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ void WiFi_setup()
host_name += "-";
host_name += String((SoC->getChipId() & 0xFFFFFF), HEX);

if (SoC->id == SOC_ESP8266 || SoC->id == SOC_RP2040) {
if (SoC->id == SOC_ESP8266 || SoC->id == SOC_RP2040 ||
SoC->id == SOC_RP2350_ARM || SoC->id == SOC_RP2350_RISC) {
WiFi.mode(WIFI_STA);
if (SoC->WiFi_hostname(host_name) == false) {
return;
Expand Down
25 changes: 16 additions & 9 deletions software/firmware/source/SoftRF/src/platform/RP2XXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ static void RP2xxx_setup()
SPI1.setSCK(SOC_GPIO_PIN_SCK);
#if !defined(ARDUINO_RASPBERRY_PI_PICO) && \
!defined(ARDUINO_RASPBERRY_PI_PICO_W) && \
!defined(ARDUINO_RASPBERRY_PI_PICO_2) && \
!defined(ARDUINO_RASPBERRY_PI_PICO_2W)
SPI1.setCS(SOC_GPIO_PIN_SS);
#endif /* ARDUINO_RASPBERRY_PI_PICO or ARDUINO_RASPBERRY_PI_PICO_W */
Expand Down Expand Up @@ -340,7 +341,7 @@ static void RP2xxx_setup()
#elif defined(ARDUINO_RASPBERRY_PI_PICO_W)
RP2xxx_board = rp2040.isPicoW() ? RP2040_RPIPICO_W : RP2040_RPIPICO;
#elif defined(ARDUINO_RASPBERRY_PI_PICO_2W)
RP2xxx_board = rp2040.isPicoW() ? RP2040_RPIPICO_2W : RP2040_RPIPICO;
RP2xxx_board = rp2040.isPicoW() ? RP2350_RPIPICO_2W : RP2350_RPIPICO_2;
#endif /* ARDUINO_RASPBERRY_PI_PICO */

RP2xxx_board = (SoC->getChipId() == 0xcf516424) ?
Expand Down Expand Up @@ -517,7 +518,7 @@ static void RP2xxx_fini(int reason)
Wire.end();

#if defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_RASPBERRY_PI_PICO_2W)
if (RP2xxx_board == RP2040_RPIPICO_W) {
if (RP2xxx_board == RP2040_RPIPICO_W || RP2xxx_board == RP2350_RPIPICO_2W) {
if (cyw43_is_initialized(&cyw43_state)) cyw43_arch_deinit();
#if !(ARDUINO_PICO_MAJOR == 4 && ARDUINO_PICO_MINOR == 3 && ARDUINO_PICO_REVISION == 0)
pinMode(CYW43_PIN_WL_REG_ON, INPUT_PULLDOWN);
Expand Down Expand Up @@ -761,7 +762,7 @@ static bool RP2xxx_WiFi_hostname(String aHostname)
{
bool rval = false;
#if !defined(EXCLUDE_WIFI) && !defined(USE_ARDUINO_WIFI)
if (RP2xxx_board == RP2040_RPIPICO_W) {
if (RP2xxx_board == RP2040_RPIPICO_W || RP2xxx_board == RP2350_RPIPICO_2W) {
WiFi.hostname(aHostname.c_str());
rval = true;
}
Expand Down Expand Up @@ -881,7 +882,8 @@ static void RP2xxx_EEPROM_extension(int cmd)
#endif /* USE_USB_HOST */
#endif /* EXCLUDE_WIFI and EXCLUDE_BLUETOOTH */

if (RP2xxx_board != RP2040_RPIPICO_W &&
if (RP2xxx_board != RP2040_RPIPICO_W &&
RP2xxx_board != RP2350_RPIPICO_2W &&
settings->bluetooth != BLUETOOTH_NONE) {
settings->bluetooth = BLUETOOTH_NONE;
}
Expand Down Expand Up @@ -1520,13 +1522,18 @@ IODev_ops_t RP2xxx_USBSerial_ops = {
};

const SoC_ops_t RP2xxx_ops = {
#if defined(ARDUINO_ARCH_RP2040)
#if defined(PICO_RP2350)
#if defined(PICO_RISCV)
SOC_RP2350_RISC,
"RP2350-RISC",
#else
SOC_RP2350_ARM,
"RP2350-ARM",
#endif /* PICO_RISCV */
#else
SOC_RP2040,
"RP2040",
#elif defined(ARDUINO_ARCH_RP2350)
SOC_RP2350_ARM,
"RP2350",
#endif /* 2XXX */
#endif /* PICO_RP2350 */
RP2xxx_setup,
RP2xxx_post_init,
RP2xxx_loop,
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/platform/RP2XXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ enum RP2xxx_board_id {
RP2040_RPIPICO_W,
RP2040_WEACT,
RP2350_RPIPICO_2,
RP2040_RPIPICO_2W,
RP2350_RPIPICO_2W,
};

struct rst_info {
Expand Down
48 changes: 28 additions & 20 deletions software/firmware/source/SoftRF/src/ui/Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ void handleSettings() {

#if !defined(EXCLUDE_BLUETOOTH)
/* SoC specific part 1 */
if (SoC->id == SOC_ESP32 || SoC->id == SOC_RP2040) {
if (SoC->id == SOC_ESP32 || SoC->id == SOC_RP2040 ||
SoC->id == SOC_RP2350_ARM || SoC->id == SOC_RP2350_RISC) {
snprintf_P ( offset, size,
PSTR("\
<tr>\
Expand Down Expand Up @@ -475,9 +476,10 @@ void handleSettings() {
size -= len;

/* SoC specific part 2 */
if (SoC->id == SOC_ESP32 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C2 || SoC->id == SOC_ESP32C3 ||
SoC->id == SOC_ESP32C6 || SoC->id == SOC_RP2040 ||
if (SoC->id == SOC_ESP32 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C2 || SoC->id == SOC_ESP32C3 ||
SoC->id == SOC_ESP32C6 || SoC->id == SOC_RP2040 ||
SoC->id == SOC_RP2350_ARM || SoC->id == SOC_RP2350_RISC ||
SoC->id == SOC_RA4M1) {
snprintf_P ( offset, size,
PSTR(
Expand All @@ -494,9 +496,10 @@ void handleSettings() {
offset += len;
size -= len;
}
if (SoC->id == SOC_ESP32S2 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C3 || SoC->id == SOC_ESP32C6 ||
SoC->id == SOC_RP2040) {
if (SoC->id == SOC_ESP32S2 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C3 || SoC->id == SOC_ESP32C6 ||
SoC->id == SOC_RP2040 || SoC->id == SOC_RP2350_ARM ||
SoC->id == SOC_RP2350_RISC) {
snprintf_P ( offset, size,
PSTR("<option %s value='%d'>USB</option>"),
(settings->nmea_out == NMEA_USB ? "selected" : ""), NMEA_USB);
Expand Down Expand Up @@ -529,9 +532,10 @@ void handleSettings() {

#if !defined(EXCLUDE_BLUETOOTH)
/* SoC specific part 3 */
if (SoC->id == SOC_ESP32 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C2 || SoC->id == SOC_ESP32C3 ||
SoC->id == SOC_ESP32C6 || SoC->id == SOC_RP2040 ||
if (SoC->id == SOC_ESP32 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C2 || SoC->id == SOC_ESP32C3 ||
SoC->id == SOC_ESP32C6 || SoC->id == SOC_RP2040 ||
SoC->id == SOC_RP2350_ARM || SoC->id == SOC_RP2350_RISC ||
SoC->id == SOC_RA4M1) {
snprintf_P ( offset, size,
PSTR("<option %s value='%d'>Bluetooth</option>"),
Expand All @@ -543,9 +547,10 @@ void handleSettings() {
}
#endif /* EXCLUDE_BLUETOOTH */

if (SoC->id == SOC_ESP32S2 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C3 || SoC->id == SOC_ESP32C6 ||
SoC->id == SOC_RP2040) {
if (SoC->id == SOC_ESP32S2 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C3 || SoC->id == SOC_ESP32C6 ||
SoC->id == SOC_RP2040 || SoC->id == SOC_RP2350_ARM ||
SoC->id == SOC_RP2350_RISC) {
snprintf_P ( offset, size,
PSTR("<option %s value='%d'>USB</option>"),
(settings->gdl90 == GDL90_USB ? "selected" : ""), GDL90_USB);
Expand Down Expand Up @@ -576,9 +581,10 @@ void handleSettings() {

#if !defined(EXCLUDE_BLUETOOTH)
/* SoC specific part 4 */
if (SoC->id == SOC_ESP32 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C2 || SoC->id == SOC_ESP32C3 ||
SoC->id == SOC_ESP32C6 || SoC->id == SOC_RP2040 ||
if (SoC->id == SOC_ESP32 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C2 || SoC->id == SOC_ESP32C3 ||
SoC->id == SOC_ESP32C6 || SoC->id == SOC_RP2040 ||
SoC->id == SOC_RP2350_ARM || SoC->id == SOC_RP2350_RISC ||
SoC->id == SOC_RA4M1) {
snprintf_P ( offset, size,
PSTR("<option %s value='%d'>Bluetooth</option>"),
Expand All @@ -590,9 +596,10 @@ void handleSettings() {
}
#endif /* EXCLUDE_BLUETOOTH */

if (SoC->id == SOC_ESP32S2 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C3 || SoC->id == SOC_ESP32C6 ||
SoC->id == SOC_RP2040) {
if (SoC->id == SOC_ESP32S2 || SoC->id == SOC_ESP32S3 ||
SoC->id == SOC_ESP32C3 || SoC->id == SOC_ESP32C6 ||
SoC->id == SOC_RP2040 || SoC->id == SOC_RP2350_ARM ||
SoC->id == SOC_RP2350_RISC) {
snprintf_P ( offset, size,
PSTR("<option %s value='%d'>USB</option>"),
(settings->d1090 == D1090_USB ? "selected" : ""), D1090_USB);
Expand Down Expand Up @@ -856,7 +863,8 @@ void handleRoot() {
#endif /* ENABLE_RECORDER */

/* SoC specific part 1 */
if (SoC->id != SOC_RP2040 && SoC->id != SOC_RA4M1) {
if (SoC->id != SOC_RP2040 && SoC->id != SOC_RP2350_ARM &&
SoC->id != SOC_RP2350_RISC && SoC->id != SOC_RA4M1) {
snprintf_P ( offset, size, PSTR("\
<td align=right><input type=button onClick=\"location.href='/firmware'\" value='Firmware update'></td>"));
len = strlen(offset);
Expand Down

0 comments on commit e8b1d84

Please sign in to comment.