Skip to content

Commit

Permalink
Merge pull request #475 from ZuluSCSI/feature/pico_2w_daynaport
Browse files Browse the repository at this point in the history
Add Pico 2W WiFi DaynaPORT support to ZuluSCSI
  • Loading branch information
aperezbios authored Nov 27, 2024
2 parents 4f22dc4 + 0fe02af commit cbab596
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 19 deletions.
55 changes: 55 additions & 0 deletions boards/rpipico2w.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "none.S",
"usb_vid": "0x2E8A",
"usb_pid": "0xF00F"
}
},
"core": "earlephilhower",
"cpu": "cortex-m33",
"extra_flags": "-DARDUINO_RASPBERRY_PI_PICO_2W -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1",
"f_cpu": "150000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x2E8A",
"0xF00F"
]
],
"mcu": "rp2350",
"variant": "rpipico2w"
},
"debug": {
"jlink_device": "RP2350_0",
"openocd_target": "rp2350.cfg",
"svd_path": "rp2350.svd"
},
"frameworks": [
"arduino"
],
"name": "ZuluSCSI Pico 2 DaynaPORT",
"upload": {
"maximum_ram_size": 524288,
"maximum_size": 4194304,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": false,
"wait_for_upload_port": false,
"protocol": "cmsis-dap",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "http://zuluscsi.com",
"vendor": "Rabbit Hole Computing LLC"
}
2 changes: 1 addition & 1 deletion boards/rpipicow.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-DARDUINO_RASPBERRY_PI_PICO_W -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 ",
"extra_flags": "-DARDUINO_RASPBERRY_PI_PICO_W -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1 ",
"f_cpu": "133000000L",
"hwids": [
[
Expand Down
2 changes: 1 addition & 1 deletion lib/ZuluSCSI_platform_RP2MCU/ZuluSCSI_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ zuluscsi_speed_grade_t platform_string_to_speed_grade(const char *speed_grade_st
#ifdef ENABLE_AUDIO_OUTPUT
logmsg("Audio output enabled, reclocking isn't possible");
return SPEED_GRADE_DEFAULT;
#endif;
#endif

if (strcasecmp(speed_grade_str, sg_default) == 0)
grade = SPEED_GRADE_DEFAULT;
Expand Down
7 changes: 6 additions & 1 deletion lib/ZuluSCSI_platform_RP2MCU/ZuluSCSI_platform_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@
# define PLATFORM_MAX_SCSI_SPEED S2S_CFG_SPEED_SYNC_20
# define PLATFORM_DEFAULT_SCSI_SPEED_SETTING 10
#elif defined(ZULUSCSI_PICO_2)
# define PLATFORM_NAME "ZuluSCSI Pico 2"
# ifdef ZULUSCSI_PICO_2_DAYNAPORT
# define PLATFORM_NAME "ZuluSCSI Pico 2 DaynaPORT"
# else
# define PLATFORM_NAME "ZuluSCSI Pico 2"
# endif
# define PLATFORM_PID "Pico 2"
# define PLATFORM_REVISION "2.0"
# define PLATFORM_HAS_INITIATOR_MODE 1
# define DISABLE_SWO
# define PLATFORM_MAX_SCSI_SPEED S2S_CFG_SPEED_SYNC_20
# define PLATFORM_DEFAULT_SCSI_SPEED_SETTING 20

#elif defined(ZULUSCSI_RP2350A)
# define PLATFORM_NAME "ZuluSCSI RP2350A"
# define PLATFORM_PID "RP2350A"
Expand Down
2 changes: 1 addition & 1 deletion lib/ZuluSCSI_platform_RP2MCU/ZuluSCSI_platform_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static bool network_in_use = false;
bool platform_network_supported()
{
/* from cores/rp2040/RP2040Support.h */
#if !defined(ARDUINO_RASPBERRY_PI_PICO_W)
#if !defined(PICO_CYW43_SUPPORTED)
return false;
#else
extern bool __isPicoW;
Expand Down
4 changes: 0 additions & 4 deletions lib/ZuluSCSI_platform_RP2MCU/custom_timings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ bool CustomTimings::set_timings_from_file()
const char scsi_5_section[] = "scsi_5";
const char sdio_section[] = "sdio";


zuluscsi_timings_t custom_timings;


// pll
int32_t vco = ini_getl(pll_section, "vco_freq_hz", g_zuluscsi_timings->pll.vco_freq, CUSTOM_TIMINGS_FILE);
int32_t post_div1 = ini_getl(pll_section, "pd1", g_zuluscsi_timings->pll.post_div1, CUSTOM_TIMINGS_FILE);
Expand Down
9 changes: 4 additions & 5 deletions lib/ZuluSCSI_platform_RP2MCU/rp23xx-template.ld
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ SECTIONS
__binary_info_end = .;
. = ALIGN(4);

.ram_vector_table (NOLOAD): {
.ram_vector_table (COPY): {
*(.ram_vector_table)
} > RAM

.uninitialized_data (NOLOAD): {
.uninitialized_data (COPY): {
. = ALIGN(4);
*(.uninitialized_data*)
} > RAM
Expand All @@ -202,17 +202,16 @@ SECTIONS
*(vtable)

*(.time_critical*)

. = ALIGN(4);
/* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
*(.text)
*(.text*)
. = ALIGN(4);
*(.rodata*)
. = ALIGN(4);

*(.data*)
. = ALIGN(4);
*(.sdata*)

. = ALIGN(4);
*(.after_data.*)
. = ALIGN(4);
Expand Down
2 changes: 1 addition & 1 deletion lib/ZuluSCSI_platform_RP2MCU/timings_RP2MCU.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static zuluscsi_timings_t predefined_timings[] = {

bool set_timings(zuluscsi_speed_grade_t speed_grade)
{
uint8_t timings_index;
uint8_t timings_index = 0;

switch (speed_grade)
{
Expand Down
29 changes: 25 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; PlatformIO Project Configuration File https://docs.platformio.org/page/projectconf.html

[platformio]
default_envs = ZuluSCSIv1_0, ZuluSCSIv1_0_mini, ZuluSCSIv1_1_plus, ZuluSCSI_RP2040, ZuluSCSI_RP2040_Audio, ZuluSCSI_Pico, ZuluSCSI_Pico_DaynaPORT, ZuluSCSI_BS2, ZuluSCSI_Pico_2
default_envs = ZuluSCSIv1_0, ZuluSCSIv1_0_mini, ZuluSCSIv1_1_plus, ZuluSCSI_RP2040, ZuluSCSI_RP2040_Audio, ZuluSCSI_Pico, ZuluSCSI_Pico_DaynaPORT, ZuluSCSI_BS2, ZuluSCSI_Pico_2, ZuluSCSI_Pico_2_DaynaPORT

; Example platform to serve as a base for porting efforts
[env:template]
Expand Down Expand Up @@ -95,9 +95,9 @@ build_flags =

; ZuluSCSI settings shared among Raspberry Pi microcontroller like the RP2040 and RP2350
[env:ZuluSCSI_RP2MCU]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#2d445020acf8b792768a5fa5ba1870ac9607c11c
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c
platform_packages =
framework-arduinopico@https://github.com/rabbitholecomputing/arduino-pico.git#v4.1.1-DaynaPORT
framework-arduinopico@https://github.com/rabbitholecomputing/arduino-pico.git#v4.3.0-DaynaPORT
extra_scripts =
src/build_bootloader.py
src/process-linker-script.py
Expand Down Expand Up @@ -125,7 +125,7 @@ build_flags =
-DPICO_FLASH_SPI_CLKDIV=2
-DPLATFORM_MASS_STORAGE
-DFILE_COPY_CONSTRUCTOR_SELECT=FILE_COPY_CONSTRUCTOR_PUBLIC
; build flags mirroring the framework-arduinopico#v4.1.1-DaynaPORT static library build
; build flags mirroring the "framework-arduinopico#x.x.x-DaynaPORT" static library build
-DPICO_CYW43_ARCH_POLL=1
-DCYW43_LWIP=0
-DCYW43_USE_OTP_MAC=0
Expand Down Expand Up @@ -201,6 +201,7 @@ build_flags =
-DZULUSCSI_MCU_RP20XX
-DZULUSCSI_NETWORK
-DZULUSCSI_DAYNAPORT
-DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
-DROMDRIVE_OFFSET=${env:ZuluSCSI_Pico_DaynaPORT.program_flash_allocation}
; These take a large portion of the SRAM and can be adjusted
-DLOGBUFSIZE=8192
Expand Down Expand Up @@ -303,3 +304,23 @@ build_flags =
-DZULUSCSI_RP2350A
-DZULUSCSI_MCU_RP23XX
-DROMDRIVE_OFFSET=${env:ZuluSCSI_RP2350A.program_flash_allocation}


[env:ZuluSCSI_Pico_2_DaynaPORT]
extends = env:ZuluSCSI_RP2MCU
board = rpipico2w
; How much flash in bytes the bootloader and main app will be allocated
; It is used as the starting point for a ROM image saved in flash
; Changing this will cause issues with boards that already have a ROM drive in flash
program_flash_allocation = 589824
linker_script_template = lib/ZuluSCSI_platform_RP2MCU/rp23xx-template.ld
ldscript_bootloader = lib/ZuluSCSI_platform_RP2MCU/rp23xx_btldr.ld
build_flags =
${env:ZuluSCSI_RP2MCU.build_flags}
-DZULUSCSI_PICO_2
-DZULUSCSI_MCU_RP23XX
-DZULUSCSI_PICO_2_DAYNAPORT
-DZULUSCSI_NETWORK
-DZULUSCSI_DAYNAPORT
-DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
-DROMDRIVE_OFFSET=${env:ZuluSCSI_Pico_2_DaynaPORT.program_flash_allocation}
2 changes: 1 addition & 1 deletion src/ZuluSCSI_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <ZuluSCSI_platform_config.h>

// Use variables for version number
#define FW_VER_NUM "24.11.20"
#define FW_VER_NUM "24.11.26"
#define FW_VER_SUFFIX "devel"

#define ZULU_FW_VERSION FW_VER_NUM "-" FW_VER_SUFFIX
Expand Down

0 comments on commit cbab596

Please sign in to comment.