From e6e4b80c59198760b48c7274655eb365d5d33913 Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Wed, 13 Nov 2024 14:36:29 -0700 Subject: [PATCH] Add SparkFun Thing Plus RP2350 --- README.md | 1 + boards.txt | 335 ++++++++++++++++++ package/package_pico_index.template.json | 3 + tools/json/sparkfun_thingplusrp2350.json | 56 +++ tools/makeboards.py | 1 + .../picow_digital.cpp | 60 ++++ .../sparkfun_thingplusrp2350/picow_init.cpp | 75 ++++ .../sparkfun_thingplusrp2350/pins_arduino.h | 57 +++ 8 files changed, 588 insertions(+) create mode 100644 tools/json/sparkfun_thingplusrp2350.json create mode 100644 variants/sparkfun_thingplusrp2350/picow_digital.cpp create mode 100644 variants/sparkfun_thingplusrp2350/picow_init.cpp create mode 100644 variants/sparkfun_thingplusrp2350/pins_arduino.h diff --git a/README.md b/README.md index dc4419dd6..f064bb345 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo * SparkFun ProMicro RP2040 * SparkFun ProMicro RP2350 * SparkFun Thing Plus RP2040 +* SparkFun Thing Plus RP2350 * uPesy RP2040 DevKit * VCC-GND YD-RP2040 * Viyalab Mizu RP2040 diff --git a/boards.txt b/boards.txt index 7feda9f99..90d235926 100644 --- a/boards.txt +++ b/boards.txt @@ -24921,6 +24921,341 @@ sparkfun_thingplusrp2040.menu.uploadmethod.picoprobe_cmsis_dap.upload.maximum_da sparkfun_thingplusrp2040.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool=picoprobe_cmsis_dap sparkfun_thingplusrp2040.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool.default=picoprobe_cmsis_dap +# ----------------------------------- +# SparkFun Thing Plus RP2350 +# ----------------------------------- +sparkfun_thingplusrp2350.name=SparkFun Thing Plus RP2350 +sparkfun_thingplusrp2350.vid.0=0x1b4f +sparkfun_thingplusrp2350.pid.0=0x0038 +sparkfun_thingplusrp2350.vid.1=0x1b4f +sparkfun_thingplusrp2350.pid.1=0x0138 +sparkfun_thingplusrp2350.vid.2=0x1b4f +sparkfun_thingplusrp2350.pid.2=0x4038 +sparkfun_thingplusrp2350.vid.3=0x1b4f +sparkfun_thingplusrp2350.pid.3=0x4138 +sparkfun_thingplusrp2350.vid.4=0x1b4f +sparkfun_thingplusrp2350.pid.4=0x8038 +sparkfun_thingplusrp2350.vid.5=0x1b4f +sparkfun_thingplusrp2350.pid.5=0x8138 +sparkfun_thingplusrp2350.vid.6=0x1b4f +sparkfun_thingplusrp2350.pid.6=0xc038 +sparkfun_thingplusrp2350.vid.7=0x1b4f +sparkfun_thingplusrp2350.pid.7=0xc138 +sparkfun_thingplusrp2350.upload_port.0.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.0.pid=0x0038 +sparkfun_thingplusrp2350.upload_port.1.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.1.pid=0x0138 +sparkfun_thingplusrp2350.upload_port.2.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.2.pid=0x4038 +sparkfun_thingplusrp2350.upload_port.3.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.3.pid=0x4138 +sparkfun_thingplusrp2350.upload_port.4.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.4.pid=0x8038 +sparkfun_thingplusrp2350.upload_port.5.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.5.pid=0x8138 +sparkfun_thingplusrp2350.upload_port.6.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.6.pid=0xc038 +sparkfun_thingplusrp2350.upload_port.7.vid=0x1b4f +sparkfun_thingplusrp2350.upload_port.7.pid=0xc138 +sparkfun_thingplusrp2350.build.usbvid=-DUSBD_VID=0x1b4f +sparkfun_thingplusrp2350.build.usbpid=-DUSBD_PID=0x0038 +sparkfun_thingplusrp2350.build.usbpwr=-DUSBD_MAX_POWER_MA=250 +sparkfun_thingplusrp2350.build.board=SPARKFUN_THINGPLUS_RP2350 +sparkfun_thingplusrp2350.build.variant=sparkfun_thingplusrp2350 +sparkfun_thingplusrp2350.upload.maximum_size=16777216 +sparkfun_thingplusrp2350.upload.wait_for_upload_port=true +sparkfun_thingplusrp2350.upload.erase_cmd= +sparkfun_thingplusrp2350.serial.disableDTR=false +sparkfun_thingplusrp2350.serial.disableRTS=false +sparkfun_thingplusrp2350.build.f_cpu=125000000 +sparkfun_thingplusrp2350.build.led= +sparkfun_thingplusrp2350.build.core=rp2040 +sparkfun_thingplusrp2350.build.ldscript=memmap_default.ld +sparkfun_thingplusrp2350.build.boot2=none +sparkfun_thingplusrp2350.build.usb_manufacturer="SparkFun" +sparkfun_thingplusrp2350.build.usb_product="Thing Plus RP2350" +sparkfun_thingplusrp2350.build.psram_length=0x800000 +sparkfun_thingplusrp2350.menu.flash.16777216_0=16MB (no FS) +sparkfun_thingplusrp2350.menu.flash.16777216_0.upload.maximum_size=16769024 +sparkfun_thingplusrp2350.menu.flash.16777216_0.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_0.build.flash_length=16769024 +sparkfun_thingplusrp2350.menu.flash.16777216_0.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_0.build.fs_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_0.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_65536=16MB (Sketch: 16320KB, FS: 64KB) +sparkfun_thingplusrp2350.menu.flash.16777216_65536.upload.maximum_size=16703488 +sparkfun_thingplusrp2350.menu.flash.16777216_65536.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_65536.build.flash_length=16703488 +sparkfun_thingplusrp2350.menu.flash.16777216_65536.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_65536.build.fs_start=285138944 +sparkfun_thingplusrp2350.menu.flash.16777216_65536.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_131072=16MB (Sketch: 16256KB, FS: 128KB) +sparkfun_thingplusrp2350.menu.flash.16777216_131072.upload.maximum_size=16637952 +sparkfun_thingplusrp2350.menu.flash.16777216_131072.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_131072.build.flash_length=16637952 +sparkfun_thingplusrp2350.menu.flash.16777216_131072.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_131072.build.fs_start=285073408 +sparkfun_thingplusrp2350.menu.flash.16777216_131072.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_262144=16MB (Sketch: 16128KB, FS: 256KB) +sparkfun_thingplusrp2350.menu.flash.16777216_262144.upload.maximum_size=16506880 +sparkfun_thingplusrp2350.menu.flash.16777216_262144.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_262144.build.flash_length=16506880 +sparkfun_thingplusrp2350.menu.flash.16777216_262144.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_262144.build.fs_start=284942336 +sparkfun_thingplusrp2350.menu.flash.16777216_262144.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_524288=16MB (Sketch: 15872KB, FS: 512KB) +sparkfun_thingplusrp2350.menu.flash.16777216_524288.upload.maximum_size=16244736 +sparkfun_thingplusrp2350.menu.flash.16777216_524288.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_524288.build.flash_length=16244736 +sparkfun_thingplusrp2350.menu.flash.16777216_524288.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_524288.build.fs_start=284680192 +sparkfun_thingplusrp2350.menu.flash.16777216_524288.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_1048576=16MB (Sketch: 15MB, FS: 1MB) +sparkfun_thingplusrp2350.menu.flash.16777216_1048576.upload.maximum_size=15720448 +sparkfun_thingplusrp2350.menu.flash.16777216_1048576.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_1048576.build.flash_length=15720448 +sparkfun_thingplusrp2350.menu.flash.16777216_1048576.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_1048576.build.fs_start=284155904 +sparkfun_thingplusrp2350.menu.flash.16777216_1048576.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_2097152=16MB (Sketch: 14MB, FS: 2MB) +sparkfun_thingplusrp2350.menu.flash.16777216_2097152.upload.maximum_size=14671872 +sparkfun_thingplusrp2350.menu.flash.16777216_2097152.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_2097152.build.flash_length=14671872 +sparkfun_thingplusrp2350.menu.flash.16777216_2097152.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_2097152.build.fs_start=283107328 +sparkfun_thingplusrp2350.menu.flash.16777216_2097152.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_3145728=16MB (Sketch: 13MB, FS: 3MB) +sparkfun_thingplusrp2350.menu.flash.16777216_3145728.upload.maximum_size=13623296 +sparkfun_thingplusrp2350.menu.flash.16777216_3145728.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_3145728.build.flash_length=13623296 +sparkfun_thingplusrp2350.menu.flash.16777216_3145728.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_3145728.build.fs_start=282058752 +sparkfun_thingplusrp2350.menu.flash.16777216_3145728.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_4194304=16MB (Sketch: 12MB, FS: 4MB) +sparkfun_thingplusrp2350.menu.flash.16777216_4194304.upload.maximum_size=12574720 +sparkfun_thingplusrp2350.menu.flash.16777216_4194304.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_4194304.build.flash_length=12574720 +sparkfun_thingplusrp2350.menu.flash.16777216_4194304.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_4194304.build.fs_start=281010176 +sparkfun_thingplusrp2350.menu.flash.16777216_4194304.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_5242880=16MB (Sketch: 11MB, FS: 5MB) +sparkfun_thingplusrp2350.menu.flash.16777216_5242880.upload.maximum_size=11526144 +sparkfun_thingplusrp2350.menu.flash.16777216_5242880.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_5242880.build.flash_length=11526144 +sparkfun_thingplusrp2350.menu.flash.16777216_5242880.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_5242880.build.fs_start=279961600 +sparkfun_thingplusrp2350.menu.flash.16777216_5242880.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_6291456=16MB (Sketch: 10MB, FS: 6MB) +sparkfun_thingplusrp2350.menu.flash.16777216_6291456.upload.maximum_size=10477568 +sparkfun_thingplusrp2350.menu.flash.16777216_6291456.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_6291456.build.flash_length=10477568 +sparkfun_thingplusrp2350.menu.flash.16777216_6291456.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_6291456.build.fs_start=278913024 +sparkfun_thingplusrp2350.menu.flash.16777216_6291456.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_7340032=16MB (Sketch: 9MB, FS: 7MB) +sparkfun_thingplusrp2350.menu.flash.16777216_7340032.upload.maximum_size=9428992 +sparkfun_thingplusrp2350.menu.flash.16777216_7340032.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_7340032.build.flash_length=9428992 +sparkfun_thingplusrp2350.menu.flash.16777216_7340032.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_7340032.build.fs_start=277864448 +sparkfun_thingplusrp2350.menu.flash.16777216_7340032.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_8388608=16MB (Sketch: 8MB, FS: 8MB) +sparkfun_thingplusrp2350.menu.flash.16777216_8388608.upload.maximum_size=8380416 +sparkfun_thingplusrp2350.menu.flash.16777216_8388608.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_8388608.build.flash_length=8380416 +sparkfun_thingplusrp2350.menu.flash.16777216_8388608.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_8388608.build.fs_start=276815872 +sparkfun_thingplusrp2350.menu.flash.16777216_8388608.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_9437184=16MB (Sketch: 7MB, FS: 9MB) +sparkfun_thingplusrp2350.menu.flash.16777216_9437184.upload.maximum_size=7331840 +sparkfun_thingplusrp2350.menu.flash.16777216_9437184.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_9437184.build.flash_length=7331840 +sparkfun_thingplusrp2350.menu.flash.16777216_9437184.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_9437184.build.fs_start=275767296 +sparkfun_thingplusrp2350.menu.flash.16777216_9437184.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_10485760=16MB (Sketch: 6MB, FS: 10MB) +sparkfun_thingplusrp2350.menu.flash.16777216_10485760.upload.maximum_size=6283264 +sparkfun_thingplusrp2350.menu.flash.16777216_10485760.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_10485760.build.flash_length=6283264 +sparkfun_thingplusrp2350.menu.flash.16777216_10485760.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_10485760.build.fs_start=274718720 +sparkfun_thingplusrp2350.menu.flash.16777216_10485760.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_11534336=16MB (Sketch: 5MB, FS: 11MB) +sparkfun_thingplusrp2350.menu.flash.16777216_11534336.upload.maximum_size=5234688 +sparkfun_thingplusrp2350.menu.flash.16777216_11534336.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_11534336.build.flash_length=5234688 +sparkfun_thingplusrp2350.menu.flash.16777216_11534336.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_11534336.build.fs_start=273670144 +sparkfun_thingplusrp2350.menu.flash.16777216_11534336.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_12582912=16MB (Sketch: 4MB, FS: 12MB) +sparkfun_thingplusrp2350.menu.flash.16777216_12582912.upload.maximum_size=4186112 +sparkfun_thingplusrp2350.menu.flash.16777216_12582912.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_12582912.build.flash_length=4186112 +sparkfun_thingplusrp2350.menu.flash.16777216_12582912.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_12582912.build.fs_start=272621568 +sparkfun_thingplusrp2350.menu.flash.16777216_12582912.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_13631488=16MB (Sketch: 3MB, FS: 13MB) +sparkfun_thingplusrp2350.menu.flash.16777216_13631488.upload.maximum_size=3137536 +sparkfun_thingplusrp2350.menu.flash.16777216_13631488.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_13631488.build.flash_length=3137536 +sparkfun_thingplusrp2350.menu.flash.16777216_13631488.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_13631488.build.fs_start=271572992 +sparkfun_thingplusrp2350.menu.flash.16777216_13631488.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_14680064=16MB (Sketch: 2MB, FS: 14MB) +sparkfun_thingplusrp2350.menu.flash.16777216_14680064.upload.maximum_size=2088960 +sparkfun_thingplusrp2350.menu.flash.16777216_14680064.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_14680064.build.flash_length=2088960 +sparkfun_thingplusrp2350.menu.flash.16777216_14680064.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_14680064.build.fs_start=270524416 +sparkfun_thingplusrp2350.menu.flash.16777216_14680064.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_15728640=16MB (Sketch: 1MB, FS: 15MB) +sparkfun_thingplusrp2350.menu.flash.16777216_15728640.upload.maximum_size=1040384 +sparkfun_thingplusrp2350.menu.flash.16777216_15728640.build.flash_total=16777216 +sparkfun_thingplusrp2350.menu.flash.16777216_15728640.build.flash_length=1040384 +sparkfun_thingplusrp2350.menu.flash.16777216_15728640.build.eeprom_start=285204480 +sparkfun_thingplusrp2350.menu.flash.16777216_15728640.build.fs_start=269475840 +sparkfun_thingplusrp2350.menu.flash.16777216_15728640.build.fs_end=285204480 +sparkfun_thingplusrp2350.menu.arch.arm=ARM +sparkfun_thingplusrp2350.menu.arch.arm.build.chip=rp2350 +sparkfun_thingplusrp2350.menu.arch.arm.build.toolchain=arm-none-eabi +sparkfun_thingplusrp2350.menu.arch.arm.build.toolchainpkg=pqt-gcc +sparkfun_thingplusrp2350.menu.arch.arm.build.toolchainopts=-mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse +sparkfun_thingplusrp2350.menu.arch.arm.build.uf2family=--family rp2350-arm-s --abs-block +sparkfun_thingplusrp2350.menu.arch.riscv=RISC-V +sparkfun_thingplusrp2350.menu.arch.riscv.build.chip=rp2350-riscv +sparkfun_thingplusrp2350.menu.arch.riscv.build.toolchain=riscv32-unknown-elf +sparkfun_thingplusrp2350.menu.arch.riscv.build.toolchainpkg=pqt-gcc-riscv +sparkfun_thingplusrp2350.menu.arch.riscv.build.toolchainopts=-march=rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb -mabi=ilp32 +sparkfun_thingplusrp2350.menu.arch.riscv.build.uf2family=--family rp2350-riscv --abs-block +sparkfun_thingplusrp2350.menu.freq.150=150 MHz +sparkfun_thingplusrp2350.menu.freq.150.build.f_cpu=150000000L +sparkfun_thingplusrp2350.menu.freq.50=50 MHz +sparkfun_thingplusrp2350.menu.freq.50.build.f_cpu=50000000L +sparkfun_thingplusrp2350.menu.freq.100=100 MHz +sparkfun_thingplusrp2350.menu.freq.100.build.f_cpu=100000000L +sparkfun_thingplusrp2350.menu.freq.120=120 MHz +sparkfun_thingplusrp2350.menu.freq.120.build.f_cpu=120000000L +sparkfun_thingplusrp2350.menu.freq.125=125 MHz +sparkfun_thingplusrp2350.menu.freq.125.build.f_cpu=125000000L +sparkfun_thingplusrp2350.menu.freq.128=128 MHz +sparkfun_thingplusrp2350.menu.freq.128.build.f_cpu=128000000L +sparkfun_thingplusrp2350.menu.freq.133=133 MHz +sparkfun_thingplusrp2350.menu.freq.133.build.f_cpu=133000000L +sparkfun_thingplusrp2350.menu.freq.175=175 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.175.build.f_cpu=175000000L +sparkfun_thingplusrp2350.menu.freq.200=200 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.200.build.f_cpu=200000000L +sparkfun_thingplusrp2350.menu.freq.225=225 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.225.build.f_cpu=225000000L +sparkfun_thingplusrp2350.menu.freq.240=240 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.240.build.f_cpu=240000000L +sparkfun_thingplusrp2350.menu.freq.250=250 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.250.build.f_cpu=250000000L +sparkfun_thingplusrp2350.menu.freq.275=275 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.275.build.f_cpu=275000000L +sparkfun_thingplusrp2350.menu.freq.300=300 MHz (Overclock) +sparkfun_thingplusrp2350.menu.freq.300.build.f_cpu=300000000L +sparkfun_thingplusrp2350.menu.opt.Small=Small (-Os) (standard) +sparkfun_thingplusrp2350.menu.opt.Small.build.flags.optimize=-Os +sparkfun_thingplusrp2350.menu.opt.Optimize=Optimize (-O) +sparkfun_thingplusrp2350.menu.opt.Optimize.build.flags.optimize=-O +sparkfun_thingplusrp2350.menu.opt.Optimize2=Optimize More (-O2) +sparkfun_thingplusrp2350.menu.opt.Optimize2.build.flags.optimize=-O2 +sparkfun_thingplusrp2350.menu.opt.Optimize3=Optimize Even More (-O3) +sparkfun_thingplusrp2350.menu.opt.Optimize3.build.flags.optimize=-O3 +sparkfun_thingplusrp2350.menu.opt.Fast=Fast (-Ofast) (maybe slower) +sparkfun_thingplusrp2350.menu.opt.Fast.build.flags.optimize=-Ofast +sparkfun_thingplusrp2350.menu.opt.Debug=Debug (-Og) +sparkfun_thingplusrp2350.menu.opt.Debug.build.flags.optimize=-Og +sparkfun_thingplusrp2350.menu.rtti.Disabled=Disabled +sparkfun_thingplusrp2350.menu.rtti.Disabled.build.flags.rtti=-fno-rtti +sparkfun_thingplusrp2350.menu.rtti.Enabled=Enabled +sparkfun_thingplusrp2350.menu.rtti.Enabled.build.flags.rtti= +sparkfun_thingplusrp2350.menu.stackprotect.Disabled=Disabled +sparkfun_thingplusrp2350.menu.stackprotect.Disabled.build.flags.stackprotect= +sparkfun_thingplusrp2350.menu.stackprotect.Enabled=Enabled +sparkfun_thingplusrp2350.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector +sparkfun_thingplusrp2350.menu.exceptions.Disabled=Disabled +sparkfun_thingplusrp2350.menu.exceptions.Disabled.build.flags.exceptions=-fno-exceptions +sparkfun_thingplusrp2350.menu.exceptions.Disabled.build.flags.libstdcpp=-lstdc++ +sparkfun_thingplusrp2350.menu.exceptions.Enabled=Enabled +sparkfun_thingplusrp2350.menu.exceptions.Enabled.build.flags.exceptions=-fexceptions +sparkfun_thingplusrp2350.menu.exceptions.Enabled.build.flags.libstdcpp=-lstdc++-exc +sparkfun_thingplusrp2350.menu.dbgport.Disabled=Disabled +sparkfun_thingplusrp2350.menu.dbgport.Disabled.build.debug_port= +sparkfun_thingplusrp2350.menu.dbgport.Serial=Serial +sparkfun_thingplusrp2350.menu.dbgport.Serial.build.debug_port=-DDEBUG_RP2040_PORT=Serial +sparkfun_thingplusrp2350.menu.dbgport.Serial1=Serial1 +sparkfun_thingplusrp2350.menu.dbgport.Serial1.build.debug_port=-DDEBUG_RP2040_PORT=Serial1 +sparkfun_thingplusrp2350.menu.dbgport.Serial2=Serial2 +sparkfun_thingplusrp2350.menu.dbgport.Serial2.build.debug_port=-DDEBUG_RP2040_PORT=Serial2 +sparkfun_thingplusrp2350.menu.dbglvl.None=None +sparkfun_thingplusrp2350.menu.dbglvl.None.build.debug_level= +sparkfun_thingplusrp2350.menu.dbglvl.Core=Core +sparkfun_thingplusrp2350.menu.dbglvl.Core.build.debug_level=-DDEBUG_RP2040_CORE +sparkfun_thingplusrp2350.menu.dbglvl.SPI=SPI +sparkfun_thingplusrp2350.menu.dbglvl.SPI.build.debug_level=-DDEBUG_RP2040_SPI +sparkfun_thingplusrp2350.menu.dbglvl.Wire=Wire +sparkfun_thingplusrp2350.menu.dbglvl.Wire.build.debug_level=-DDEBUG_RP2040_WIRE +sparkfun_thingplusrp2350.menu.dbglvl.Bluetooth=Bluetooth +sparkfun_thingplusrp2350.menu.dbglvl.Bluetooth.build.debug_level=-DDEBUG_RP2040_BLUETOOTH +sparkfun_thingplusrp2350.menu.dbglvl.All=All +sparkfun_thingplusrp2350.menu.dbglvl.All.build.debug_level=-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE -DDEBUG_RP2040_BLUETOOTH +sparkfun_thingplusrp2350.menu.dbglvl.NDEBUG=NDEBUG +sparkfun_thingplusrp2350.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG +sparkfun_thingplusrp2350.menu.usbstack.picosdk=Pico SDK +sparkfun_thingplusrp2350.menu.usbstack.picosdk.build.usbstack_flags= +sparkfun_thingplusrp2350.menu.usbstack.tinyusb=Adafruit TinyUSB +sparkfun_thingplusrp2350.menu.usbstack.tinyusb.build.usbstack_flags=-DUSE_TINYUSB "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino" +sparkfun_thingplusrp2350.menu.usbstack.tinyusb_host=Adafruit TinyUSB Host (native) +sparkfun_thingplusrp2350.menu.usbstack.tinyusb_host.build.usbstack_flags=-DUSE_TINYUSB -DUSE_TINYUSB_HOST "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino" +sparkfun_thingplusrp2350.menu.usbstack.nousb=No USB +sparkfun_thingplusrp2350.menu.usbstack.nousb.build.usbstack_flags="-DNO_USB -DDISABLE_USB_SERIAL -I{runtime.platform.path}/tools/libpico" +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4only=IPv4 Only +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4only.build.libpicow=libipv4.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4only.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6=IPv4 + IPv6 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6.build.libpicow=libipv4-ipv6.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4btcble=IPv4 + Bluetooth +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4btcble.build.libpicow=libipv4-bt.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4btcble.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6btcble=IPv4 + IPv6 + Bluetooth +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6btcble.build.libpicow=libipv4-ipv6-bt.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6btcble.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4onlybig=IPv4 Only - 32K +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4onlybig.build.libpicow=libipv4-big.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4onlybig.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 -D__LWIP_MEMMULT=2 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6big=IPv4 + IPv6 - 32K +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6big.build.libpicow=libipv4-ipv6-big.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6big.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -D__LWIP_MEMMULT=2 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4btcblebig=IPv4 + Bluetooth - 32K +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4btcblebig.build.libpicow=libipv4-bt-big.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4btcblebig.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 -D__LWIP_MEMMULT=2 +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6btcblebig=IPv4 + IPv6 + Bluetooth - 32K +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6btcblebig.build.libpicow=libipv4-ipv6-bt-big.a +sparkfun_thingplusrp2350.menu.ipbtstack.ipv4ipv6btcblebig.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 -D__LWIP_MEMMULT=2 +sparkfun_thingplusrp2350.menu.uploadmethod.default=Default (UF2) +sparkfun_thingplusrp2350.menu.uploadmethod.default.build.ram_length=512k +sparkfun_thingplusrp2350.menu.uploadmethod.default.build.debugscript=picoprobe_cmsis_dap.tcl +sparkfun_thingplusrp2350.menu.uploadmethod.default.upload.maximum_data_size=524288 +sparkfun_thingplusrp2350.menu.uploadmethod.default.upload.tool=uf2conv +sparkfun_thingplusrp2350.menu.uploadmethod.default.upload.tool.default=uf2conv +sparkfun_thingplusrp2350.menu.uploadmethod.default.upload.tool.network=uf2conv-network +sparkfun_thingplusrp2350.menu.uploadmethod.picotool=Picotool +sparkfun_thingplusrp2350.menu.uploadmethod.picotool.build.ram_length=512k +sparkfun_thingplusrp2350.menu.uploadmethod.picotool.build.debugscript=picoprobe.tcl +sparkfun_thingplusrp2350.menu.uploadmethod.picotool.build.picodebugflags=-DENABLE_PICOTOOL_USB +sparkfun_thingplusrp2350.menu.uploadmethod.picotool.upload.maximum_data_size=524288 +sparkfun_thingplusrp2350.menu.uploadmethod.picotool.upload.tool=picotool +sparkfun_thingplusrp2350.menu.uploadmethod.picotool.upload.tool.default=picotool +sparkfun_thingplusrp2350.menu.uploadmethod.picoprobe_cmsis_dap=Picoprobe/Debugprobe (CMSIS-DAP) +sparkfun_thingplusrp2350.menu.uploadmethod.picoprobe_cmsis_dap.build.ram_length=512k +sparkfun_thingplusrp2350.menu.uploadmethod.picoprobe_cmsis_dap.build.debugscript=picoprobe_cmsis_dap.tcl +sparkfun_thingplusrp2350.menu.uploadmethod.picoprobe_cmsis_dap.upload.maximum_data_size=524288 +sparkfun_thingplusrp2350.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool=picoprobe_cmsis_dap +sparkfun_thingplusrp2350.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool.default=picoprobe_cmsis_dap + # ----------------------------------- # uPesy RP2040 DevKit # ----------------------------------- diff --git a/package/package_pico_index.template.json b/package/package_pico_index.template.json index f0a53e0b4..41284cb3b 100644 --- a/package/package_pico_index.template.json +++ b/package/package_pico_index.template.json @@ -281,6 +281,9 @@ { "name": "SparkFun Thing Plus RP2040" }, + { + "name": "SparkFun Thing Plus RP2350" + }, { "name": "uPesy RP2040 DevKit" }, diff --git a/tools/json/sparkfun_thingplusrp2350.json b/tools/json/sparkfun_thingplusrp2350.json new file mode 100644 index 000000000..0f9fdaf17 --- /dev/null +++ b/tools/json/sparkfun_thingplusrp2350.json @@ -0,0 +1,56 @@ +{ + "build": { + "arduino": { + "earlephilhower": { + "boot2_source": "none.S", + "usb_vid": "0x1B4F", + "usb_pid": "0x0038" + } + }, + "core": "earlephilhower", + "cpu": "cortex-m33", + "extra_flags": "-DARDUINO_SPARKFUN_THINGPLUS_RP2350 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 ", + "f_cpu": "150000000L", + "hwids": [ + [ + "0x2E8A", + "0x00C0" + ], + [ + "0x1B4F", + "0x0038" + ] + ], + "mcu": "rp2350", + "variant": "sparkfun_thingplusrp2350" + }, + "debug": { + "jlink_device": "RP2350_0", + "openocd_target": "rp2350.cfg", + "svd_path": "rp2350.svd" + }, + "frameworks": [ + "arduino" + ], + "name": "Thing Plus RP2350", + "upload": { + "maximum_ram_size": 524288, + "maximum_size": 16777216, + "require_upload_port": true, + "native_usb": true, + "use_1200bps_touch": true, + "wait_for_upload_port": false, + "protocol": "picotool", + "protocols": [ + "blackmagic", + "cmsis-dap", + "jlink", + "raspberrypi-swd", + "picotool", + "picoprobe" + ], + "psram_length": 8388608 + }, + "url": "https://www.raspberrypi.org/products/raspberry-pi-pico/", + "vendor": "SparkFun" +} \ No newline at end of file diff --git a/tools/makeboards.py b/tools/makeboards.py index c4f06c2b0..b4e68e9dc 100755 --- a/tools/makeboards.py +++ b/tools/makeboards.py @@ -630,6 +630,7 @@ def MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddef MakeBoard("sparkfun_promicrorp2040", "rp2040", "SparkFun", "ProMicro RP2040", "0x1b4f", "0x0026", 250, "SPARKFUN_PROMICRO_RP2040", 16, 0, "boot2_generic_03h_4_padded_checksum") MakeBoard("sparkfun_promicrorp2350", "rp2350", "SparkFun", "ProMicro RP2350", "0x1b4f", "0x0026", 250, "SPARKFUN_PROMICRO_RP2350", 16, 8, "none") MakeBoard("sparkfun_thingplusrp2040", "rp2040", "SparkFun", "Thing Plus RP2040", "0x1b4f", "0x0026", 250, "SPARKFUN_THINGPLUS_RP2040", 16, 0, "boot2_w25q080_2_padded_checksum") +MakeBoard("sparkfun_thingplusrp2350", "rp2350", "SparkFun", "Thing Plus RP2350", "0x1b4f", "0x0038", 250, "SPARKFUN_THINGPLUS_RP2350", 16, 8, "none") # Upesy MakeBoard("upesy_rp2040_devkit", "rp2040", "uPesy", "RP2040 DevKit", "0x2e8a", "0x1007", 250, "UPESY_RP2040_DEVKIT", 2, 0, "boot2_w25q080_2_padded_checksum") diff --git a/variants/sparkfun_thingplusrp2350/picow_digital.cpp b/variants/sparkfun_thingplusrp2350/picow_digital.cpp new file mode 100644 index 000000000..468791162 --- /dev/null +++ b/variants/sparkfun_thingplusrp2350/picow_digital.cpp @@ -0,0 +1,60 @@ +/* + pinMode and digitalRead/Write for the Raspberry Pi Pico W RP2040 + Copyright (c) 2022 Earle F. Philhower, III + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" +#include + +extern "C" void __pinMode(pin_size_t pin, PinMode mode); +extern "C" void __digitalWrite(pin_size_t pin, PinStatus val); +extern "C" PinStatus __digitalRead(pin_size_t pin); + +extern bool __isPicoW; + +extern "C" void pinMode(pin_size_t pin, PinMode mode) { + if (!__isPicoW && (pin == PIN_LED)) { + pin = 25; // Silently swap in the Pico's LED + } + if (pin < 32) { + __pinMode(pin, mode); + } else { + // TBD - There is no GPIO direction control in the driver + } +} + +extern "C" void digitalWrite(pin_size_t pin, PinStatus val) { + if (!__isPicoW && (pin == PIN_LED)) { + pin = 25; // Silently swap in the Pico's LED + } + if (pin < 32) { + __digitalWrite(pin, val); + } else { + cyw43_arch_gpio_put(pin - 32, val == HIGH ? 1 : 0); + } +} + +extern "C" PinStatus digitalRead(pin_size_t pin) { + if (!__isPicoW && (pin == PIN_LED)) { + pin = 25; // Silently swap in the Pico's LED + } + if (pin < 32) { + return __digitalRead(pin); + } else { + return cyw43_arch_gpio_get(pin - 32) ? HIGH : LOW; + } +} diff --git a/variants/sparkfun_thingplusrp2350/picow_init.cpp b/variants/sparkfun_thingplusrp2350/picow_init.cpp new file mode 100644 index 000000000..1a2e77d67 --- /dev/null +++ b/variants/sparkfun_thingplusrp2350/picow_init.cpp @@ -0,0 +1,75 @@ +/* + Initialize the Pico W WiFi driver + + Copyright (c) 2022 Earle F. Philhower, III + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include "hardware/resets.h" +#include "hardware/gpio.h" +#include "hardware/adc.h" + +#ifndef WIFICC +#define WIFICC CYW43_COUNTRY_WORLDWIDE +#endif + +// Taken from https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf +// also discussion in https://github.com/earlephilhower/arduino-pico/issues/849 +static bool CheckPicoW() { + adc_init(); + auto dir = gpio_get_dir(29); + auto fnc = gpio_get_function(29); + adc_gpio_init(29); + adc_select_input(3); + auto adc29 = adc_read(); + gpio_set_function(29, fnc); + gpio_set_dir(29, dir); + + dir = gpio_get_dir(25); + fnc = gpio_get_function(25); + gpio_init(25); + gpio_set_dir(25, GPIO_IN); + auto gp25 = gpio_get(25); + gpio_set_function(25, fnc); + gpio_set_dir(25, dir); + + if (gp25) { + return true; // Can't tell, so assume yes + } else if (adc29 < 200) { + return true; // PicoW + } else { + return false; + } +} + +bool __isPicoW = true; + +extern "C" void initVariant() { + __isPicoW = CheckPicoW(); + if (__isPicoW) { + cyw43_arch_init_with_country(WIFICC); + } +} + +extern "C" void __lockBluetooth() { + async_context_acquire_lock_blocking(cyw43_arch_async_context()); +} + +extern "C" void __unlockBluetooth() { + async_context_release_lock(cyw43_arch_async_context()); +} diff --git a/variants/sparkfun_thingplusrp2350/pins_arduino.h b/variants/sparkfun_thingplusrp2350/pins_arduino.h new file mode 100644 index 000000000..133314864 --- /dev/null +++ b/variants/sparkfun_thingplusrp2350/pins_arduino.h @@ -0,0 +1,57 @@ +#pragma once + +extern bool __isPicoW; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +extern void __lockBluetooth(); +extern void __unlockBluetooth(); +#ifdef __cplusplus +}; // extern "C" +#endif // __cplusplus + +// LEDs +#define PIN_LED (32u) + +#define PIN_NEOPIXEL (14) +#define NUM_NEOPIXEL (1) + +// Serial +#define PIN_SERIAL1_TX (0u) +#define PIN_SERIAL1_RX (1u) + +#define PIN_SERIAL2_TX (31u) +#define PIN_SERIAL2_RX (31u) + +// SPI +#define PIN_SPI0_MISO (4u) +#define PIN_SPI0_MOSI (3u) +#define PIN_SPI0_SCK (2u) +#define PIN_SPI0_SS (9u) // CS pin for SD card + +#define PIN_SPI1_MISO (31u) +#define PIN_SPI1_MOSI (31u) +#define PIN_SPI1_SCK (31u) +#define PIN_SPI1_SS (31u) + +// Wire +#define PIN_WIRE0_SDA (6u) +#define PIN_WIRE0_SCL (7u) + +#define PIN_WIRE1_SDA (31u) +#define PIN_WIRE1_SCL (31u) + +// Thing Plus uses I2C for Qwiic connector, make that the default +#ifndef __WIRE0_DEVICE +#define __WIRE0_DEVICE i2c1 +#endif +#ifndef __WIRE1_DEVICE +#define __WIRE1_DEVICE i2c0 +#endif + +#define SERIAL_HOWMANY (3u) +#define SPI_HOWMANY (1u) +#define WIRE_HOWMANY (1u) + +#include "../generic/common.h"