Add RP2350 support, new boards (#2337)

* Migrate RP2040-specific bits to separate dirs
* Add chip to boards.txt, isolate RP2040-specifics
* Add RP2350 boot2, bearssl, and libraries
* Platform.IO adjust to new paths
* Add RPIPICO2 JSON for P.IO
* Add RP2350 to Platform.io
* Update Picotool and OpenOCD for all hosts
* Use picotool to generate UF2s
* Build separate libpico blobs serially
Thanks for the review, @aarturo182 !
* Add RP2350 to CI
* Allow Ethernet/WiFi building for RP2350
* Update Adafruit TinyUSB to latest
* Test skip fix
* Make RP2350 Picotool work. update USB ID
* Fix EEPROM/FS flash locations
RP2350 adds a 4K header sector to the UF2, meaning we have 4K less total
flash to work with.  Adjust all constants appropriately on the RP2350.
* Adds ilabs board and PSRAM support. (#2342)
* Adds iLabs boards and basic PSRAM support.
* Make PSRAM come up as part of chip init
Uses SparkFun psram.cpp to set timings on clocks which are defined in the
variant file.  Prefix things with RP2350_PSRAM_xxx for sanity.
Users don't need to call anything, PSRAM "just appears".  Still need to
add in malloc-type allocation.
* Add board SparkFun ProMicro RP2350
Same pinout as the SparkFun ProMicro RP2040 with 8MB PSRAM and RP2350
* Add TLSF library for use w/PSRAM
Fork of upstream to include add'l C++ warning fixes.
* Add pmalloc/pcalloc to use PSRAM memory
free() and realloc() all look at the pointer passed in and jump to the
appropriate handler.  Also takes care of stopping IRQs and taking the
malloc mutex to support multicore and FreeRTOS (when that workd)
* Fix BOOTSEL for RP2350
* Add simple rp2040.idleOtherCore test
* Add Generic RP2350 and clean up PSRAM menus
Commercial boards now only have 1 size PSRAM, no need to have menu for them.
* Add Solder Party RP2350 Stamp boards (#2352)
* Add PSRAM heap info helpers, mutex lock mallinfo
* Add RP2350 docs
* FreeRTOS and OTA unsupported warnings for RP2350
This commit is contained in:
Earle F. Philhower, III 2024-08-25 11:21:46 -07:00 committed by GitHub
parent 815e17b35a
commit 33694a1fcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
213 changed files with 6790 additions and 1178 deletions

View file

@ -70,6 +70,37 @@ jobs:
cd ..
bash ./tests/build.sh
# Build all rp2350 examples on linux (core and Arduino IDE)
build-rp2350-linux:
name: Build RP2350 ${{ matrix.chunk }}
runs-on: ubuntu-latest
strategy:
matrix:
chunk: [0, 1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Cache Linux toolchain
id: cache-linux
uses: actions/cache@v4
with:
path: ./tools/dist
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
- name: Build Sketches
env:
BUILD_PARITY: custom
mod: 6
rem: ${{ matrix.chunk }}
run: |
cd pico-sdk
git submodule update --init
cd ..
bash ./tests/build-rp2350.sh
# Build TinyUSB examples, requires custom build command line
build-tinyusb:
name: Build TinyUSB Examples
@ -199,8 +230,9 @@ jobs:
pip install --upgrade platformio
pio pkg install --global --platform https://github.com/maxgerhardt/platform-raspberrypi.git
pio pkg install --global --tool symlink://.
cp -f /home/runner/work/arduino-pico/arduino-pico/tools/json/*.json /home/runner/.platformio/platforms/raspberrypi/boards/.
- name: Build Multicore Example
run: pio ci --board=rpipico --board=adafruit_feather -O "platform_packages=framework-arduinopico@symlink:///home/runner/work/arduino-pico/arduino-pico" libraries/rp2040/examples/Multicore/Multicore.ino
run: pio ci -v --board=rpipico --board=rpipico2 --board=adafruit_feather -O "platform_packages=framework-arduinopico@symlink:///home/runner/work/arduino-pico/arduino-pico" libraries/rp2040/examples/Multicore/Multicore.ino
- name: Build Fade Example
run: pio ci --board=rpipico --board=adafruit_feather -O "platform_packages=framework-arduinopico@symlink:///home/runner/work/arduino-pico/arduino-pico" libraries/rp2040/examples/Fade/Fade.ino
- name: Build TinyUSB Example

3
.gitmodules vendored
View file

@ -43,3 +43,6 @@
[submodule "libraries/AsyncUDP"]
path = libraries/AsyncUDP
url = https://github.com/earlephilhower/AsyncUDP.git
[submodule "cores/rp2040/tlsf"]
path = lib/tlsf
url = https://github.com/earlephilhower/tlsf.git

View file

@ -2,9 +2,9 @@
[![Release](https://img.shields.io/github/v/release/earlephilhower/arduino-pico?style=plastic)](https://github.com/earlephilhower/arduino-pico/releases)
[![Gitter](https://img.shields.io/gitter/room/earlephilhower/arduino-pico?style=plastic)](https://gitter.im/arduino-pico/community)
Raspberry Pi Pico Arduino core, for all RP2040 boards
Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
This is a port of the RP2040 (Raspberry Pi Pico processor) to the Arduino ecosystem. It uses the bare Raspberry Pi Pico SDK and a custom GCC 12.3/Newlib 4.0 toolchain.
This is a port of Arduino to the RP2040 (Raspberry Pi Pico processor) anr RP2350 (Raspberry Pi Pico 2 processor). It uses the bare Raspberry Pi Pico SDK and a custom GCC 12.3/Newlib 4.0 toolchain.
# Documentation
See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for more detailed usage information.
@ -15,6 +15,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
# Supported Boards
* Raspberry Pi Pico
* Raspberry Pi Pico W
* Raspberry Pi Pico 2
* 0xCB Helios
* Adafruit Feather RP2040
* Adafruit Feather RP2040 SCORPIO
@ -54,6 +55,8 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* Invector Labs Challenger RP2040 SubGHz
* Invector Labs Challenger RP2040 SD/RTC
* Invector Labs Challenger RP2040 UWB
* Invector Labs Challenger RP2350 BConnect
* Invector Labs Challenger RP2350 WiFi/BLE
* Invector Labs RPICO32
* Melopero Cookie RP2040
* Melopero Shake RP2040
@ -74,8 +77,11 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* Seeed XIAO RP2040
* Silicognition RP2040-Shim
* Solder Party RP2040 Stamp
* Solder Party RP2350 Stamp
* Solder Party RP2350 Stamp XL
* SparkFun MicroMod RP2040
* SparkFun ProMicro RP2040
* SparkFun ProMicro RP2350
* SparkFun Thing Plus RP2040
* uPesy RP2040 DevKit
* VCC-GND YD-RP2040
@ -90,15 +96,17 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* WIZnet W5100S-EVB-Pico
* WIZnet W5500-EVB-Pico
* WIZnet WizFi360-EVB-Pico
* Generic (configurable flash, I/O pins)
* Generic RP2040 (configurable flash, I/O pins)
* Generic RP2350 (configurable flash, I/O pins)
# Features
* Transparent use of PSRAM globals and heap (RP2350 only)
* Adafruit TinyUSB Arduino (USB mouse, keyboard, flash drive, generic HID, CDC Serial, MIDI, WebUSB, others)
* Bluetooth on the PicoW (Classic and BLE) with Keyboard, Mouse, Joystick, and Virtual Serial
* Bluetooth Classic and BLE HID master mode (connect to BT keyboard, mouse, or joystick)
* Generic Arduino USB Serial, Keyboard, Joystick, and Mouse emulation
* WiFi (Pico W, ESP32-based ESPHost, Atmel WINC1500)
* Ethernet (Wired W5500, W5100, ENC28J60)
* Ethernet (Wired WizNet W6100, WizNet W5500, WizNet W5100, ENC28J60)
* HTTP client and server (WebServer)
* SSL/TLS/HTTPS
* Over-the-Air (OTA) upgrades
@ -219,7 +227,9 @@ Under Windows a local admin user should be able to access the Picoprobe port aut
To set up user-level access to Picoprobes on Ubuntu (and other OSes which use `udev`):
````
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="0666"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="660", GROUP-"plugdev"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000a", MODE="660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000f", MODE="660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
sudo udevadm control --reload
sudo udevadm trigger -w -s usb
````
@ -271,7 +281,7 @@ The installed tools include a version of OpenOCD (in the pqt-openocd directory)
* WebServer code modified from the [ESP32 WebServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/WebServer) and is copyright (c) 2015 Ivan Grokhotkov and others.
* [Xoshiro-cpp](https://github.com/Reputeless/Xoshiro-cpp) is copyright (c) 2020 Ryo Suzuki and distributed under the MIT license.
* [FatFS low-level filesystem](http://elm-chan.org/fsw/ff/) code is Copyright (C) 2024, ChaN, all rights reserved.
* [TLSF memory manager for PSRAM from Espressif fork](https://github.com/espressif/tlsf) of [original](https://github.com/mattconte/tlsf) by Matthew Conte is copyright Matthew Conte and licensed under the MIT license.
-Earle F. Philhower, III
earlephilhower@yahoo.com

2505
boards.txt

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,25 @@
// Padded and checksummed version of: boot2_generic_03h.2.bin
.cpu cortex-m0plus
.thumb
.section .boot2, "ax"
.global __boot2_entry_point
__boot2_entry_point:
.byte 0x00, 0xb5, 0x05, 0x4b, 0x05, 0x48, 0xd8, 0x60, 0x4f, 0xf0, 0x03, 0x00, 0x58, 0x61, 0x4f, 0xf4
.byte 0x80, 0x50, 0x18, 0x61, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x40, 0x02, 0x01, 0x00, 0x40
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

View file

@ -0,0 +1,25 @@
// Padded and checksummed version of: boot2_generic_03h.4.bin
.cpu cortex-m0plus
.thumb
.section .boot2, "ax"
.global __boot2_entry_point
__boot2_entry_point:
.byte 0x00, 0xb5, 0x05, 0x4b, 0x05, 0x48, 0xd8, 0x60, 0x4f, 0xf0, 0x03, 0x00, 0x58, 0x61, 0x4f, 0xf4
.byte 0x80, 0x50, 0x18, 0x61, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x40, 0x04, 0x01, 0x00, 0x40
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

View file

@ -0,0 +1,25 @@
// Padded and checksummed version of: boot2_w25q080.2.bin
.cpu cortex-m0plus
.thumb
.section .boot2, "ax"
.global __boot2_entry_point
__boot2_entry_point:
.byte 0x00, 0xb5, 0x24, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x13, 0xf5, 0x40, 0x53, 0x02, 0x20, 0x98, 0x60
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x13, 0xf5, 0x0d, 0x23, 0x1f, 0x49, 0x19, 0x60, 0x18, 0x68
.byte 0x10, 0xf0, 0x02, 0x0f, 0xfb, 0xd1, 0x35, 0x20, 0x00, 0xf0, 0x2c, 0xf8, 0x02, 0x28, 0x14, 0xd0
.byte 0x06, 0x20, 0x58, 0x60, 0x00, 0xf0, 0x22, 0xf8, 0x98, 0x68, 0x01, 0x20, 0x58, 0x60, 0x00, 0x20
.byte 0x58, 0x60, 0x02, 0x20, 0x58, 0x60, 0x00, 0xf0, 0x19, 0xf8, 0x98, 0x68, 0x98, 0x68, 0x98, 0x68
.byte 0x05, 0x20, 0x00, 0xf0, 0x17, 0xf8, 0x40, 0x08, 0xfa, 0xd2, 0x31, 0xf0, 0x01, 0x01, 0x19, 0x60
.byte 0x0e, 0x48, 0xd8, 0x60, 0x4a, 0xf2, 0xeb, 0x00, 0x58, 0x61, 0x0d, 0x48, 0x18, 0x61, 0x4f, 0xf0
.byte 0xa0, 0x51, 0x09, 0x78, 0x20, 0xf4, 0x80, 0x50, 0x18, 0x61, 0x00, 0xbd, 0x18, 0x68, 0x80, 0x08
.byte 0xfc, 0xd2, 0x70, 0x47, 0x00, 0xb5, 0x58, 0x60, 0x58, 0x60, 0xff, 0xf7, 0xf7, 0xff, 0x98, 0x68
.byte 0x98, 0x68, 0x00, 0xbd, 0x00, 0x00, 0x04, 0x40, 0x41, 0x00, 0x80, 0x07, 0x02, 0x02, 0x00, 0x40
.byte 0xa8, 0x92, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

View file

@ -0,0 +1,25 @@
// Padded and checksummed version of: boot2_w25q080.4.bin
.cpu cortex-m0plus
.thumb
.section .boot2, "ax"
.global __boot2_entry_point
__boot2_entry_point:
.byte 0x00, 0xb5, 0x24, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x13, 0xf5, 0x40, 0x53, 0x02, 0x20, 0x98, 0x60
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x13, 0xf5, 0x0d, 0x23, 0x1f, 0x49, 0x19, 0x60, 0x18, 0x68
.byte 0x10, 0xf0, 0x02, 0x0f, 0xfb, 0xd1, 0x35, 0x20, 0x00, 0xf0, 0x2c, 0xf8, 0x02, 0x28, 0x14, 0xd0
.byte 0x06, 0x20, 0x58, 0x60, 0x00, 0xf0, 0x22, 0xf8, 0x98, 0x68, 0x01, 0x20, 0x58, 0x60, 0x00, 0x20
.byte 0x58, 0x60, 0x02, 0x20, 0x58, 0x60, 0x00, 0xf0, 0x19, 0xf8, 0x98, 0x68, 0x98, 0x68, 0x98, 0x68
.byte 0x05, 0x20, 0x00, 0xf0, 0x17, 0xf8, 0x40, 0x08, 0xfa, 0xd2, 0x31, 0xf0, 0x01, 0x01, 0x19, 0x60
.byte 0x0e, 0x48, 0xd8, 0x60, 0x4a, 0xf2, 0xeb, 0x00, 0x58, 0x61, 0x0d, 0x48, 0x18, 0x61, 0x4f, 0xf0
.byte 0xa0, 0x51, 0x09, 0x78, 0x20, 0xf4, 0x80, 0x50, 0x18, 0x61, 0x00, 0xbd, 0x18, 0x68, 0x80, 0x08
.byte 0xfc, 0xd2, 0x70, 0x47, 0x00, 0xb5, 0x58, 0x60, 0x58, 0x60, 0xff, 0xf7, 0xf7, 0xff, 0x98, 0x68
.byte 0x98, 0x68, 0x00, 0xbd, 0x00, 0x00, 0x04, 0x40, 0x41, 0x00, 0x80, 0x07, 0x04, 0x02, 0x00, 0x40
.byte 0xa8, 0x92, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

View file

@ -58,6 +58,12 @@ extern "C" {
void interrupts();
void noInterrupts();
#ifdef RP2350_PSRAM_CS
void *pmalloc(size_t size);
void *pcalloc(size_t count, size_t size);
#endif
// AVR compatibility macros...naughty and accesses the HW directly
#define digitalPinToPort(pin) (0)
#define digitalPinToBitMask(pin) (1UL << (pin))
@ -138,4 +144,5 @@ constexpr uint32_t __bitset(const int (&a)[N], size_t i = 0U) {
#undef stdio_usb_init
#define stdio_usb_init(...) static_assert(0, "stdio_usb_init is not supported or needed. Either use Serial.printf() or set the debug port in the IDE to Serial/1/2 and use printf(). See https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1540354673 and https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1546783109")
// PSRAM decorator
#define PSRAM __attribute__((section("\".psram\"")))

View file

@ -39,7 +39,12 @@ static bool __no_inline_not_in_flash_func(get_bootsel_button)() {
// The HI GPIO registers in SIO can observe and control the 6 QSPI pins.
// Note the button pulls the pin *low* when pressed.
bool button_state = !(sio_hw->gpio_hi_in & (1u << CS_PIN_INDEX));
#if PICO_RP2040
#define CS_BIT (1u << 1)
#else
#define CS_BIT SIO_GPIO_HI_IN_QSPI_CSN_BITS
#endif
bool button_state = !(sio_hw->gpio_hi_in & CS_BIT);
// Need to restore the state of chip select, else we are going to have a
// bad time when we return to code in flash!

View file

@ -22,9 +22,16 @@
#include "PIOProgram.h"
#include <map>
static std::map<const pio_program_t *, int> __pioMap[2];
auto_init_mutex(_pioMutex);
#if defined(PICO_RP2350)
#define PIOS pio0, pio1, pio2
#define PIOCNT 3
#elif defined(PICO_RP2040)
#define PIOS pio0, pio1
#define PIOCNT 2
#endif
static std::map<const pio_program_t *, int> __pioMap[PIOCNT];
auto_init_mutex(_pioMutex);
PIOProgram::PIOProgram(const pio_program_t *pgm) {
_pgm = pgm;
@ -42,10 +49,10 @@ PIOProgram::~PIOProgram() {
// Possibly load into a PIO and allocate a SM
bool PIOProgram::prepare(PIO *pio, int *sm, int *offset) {
CoreMutex m(&_pioMutex);
PIO pi[2] = { pio0, pio1 };
PIO pi[PIOCNT] = { PIOS };
// If it's already loaded into PIO IRAM, try and allocate in that specific PIO
for (int o = 0; o < 2; o++) {
for (int o = 0; o < PIOCNT; o++) {
auto p = __pioMap[o].find(_pgm);
if (p != __pioMap[o].end()) {
int idx = pio_claim_unused_sm(pi[o], false);
@ -61,7 +68,7 @@ bool PIOProgram::prepare(PIO *pio, int *sm, int *offset) {
}
// Not in any PIO IRAM, so try and add
for (int o = 0; o < 2; o++) {
for (int o = 0; o < PIOCNT; o++) {
if (pio_can_add_program(pi[o], _pgm)) {
int idx = pio_claim_unused_sm(pi[o], false);
if (idx >= 0) {

View file

@ -60,8 +60,13 @@ public:
void registerCore() {
if (!__isFreeRTOS) {
multicore_fifo_clear_irq();
#ifdef PICO_RP2350
irq_set_exclusive_handler(SIO_IRQ_FIFO, _irq);
irq_set_enabled(SIO_IRQ_FIFO, true);
#else
irq_set_exclusive_handler(SIO_IRQ_PROC0 + get_core_num(), _irq);
irq_set_enabled(SIO_IRQ_PROC0 + get_core_num(), true);
#endif
}
// FreeRTOS port.c will handle the IRQ hooking
}
@ -243,6 +248,28 @@ public:
return &__StackLimit - &__bss_end__;
}
inline int getFreePSRAMHeap() {
return getTotalPSRAMHeap() - getUsedPSRAMHeap();
}
inline int getUsedPSRAMHeap() {
#if defined(PICO_RP2350)
extern size_t __psram_total_used();
return __psram_total_used();
#else
return 0;
#endif
}
inline int getTotalPSRAMHeap() {
#if defined(PICO_RP2350)
extern size_t __psram_total_space();
return __psram_total_space();
#else
return 0;
#endif
}
inline uint32_t getStackPointer() {
uint32_t *sp;
asm volatile("mov %0, sp" : "=r"(sp));
@ -262,6 +289,15 @@ public:
return sp - ref;
}
inline size_t getPSRAMSize() {
#if defined(PICO_RP2350)
extern size_t __psram_size;
return __psram_size;
#else
return 0;
#endif
}
void idleOtherCore() {
fifo.idleOtherCore();
}

View file

@ -26,7 +26,9 @@
#include <lwip/dns.h>
#include <lwip/raw.h>
#include <lwip/timeouts.h>
#ifdef PICO_RP2040
#include <pico/cyw43_arch.h>
#endif
#include <pico/mutex.h>
#include <sys/lock.h>
#include "_xoshiro.h"

View file

@ -19,11 +19,25 @@
*/
#include <Arduino.h>
#include <malloc.h>
#include <reent.h>
#include "psram.h"
extern "C" void *__real_malloc(size_t size);
extern "C" void *__real_calloc(size_t count, size_t size);
extern "C" void *__real_realloc(void *mem, size_t size);
extern "C" void __real_free(void *mem);
extern "C" struct mallinfo __real_mallinfo();
#ifdef RP2350_PSRAM_CS
extern "C" {
extern uint8_t __psram_start__;
extern uint8_t __psram_heap_start__;
void __malloc_lock(struct _reent *ptr);
void __malloc_unlock(struct _reent *ptr);
static void *__ram_start = (void *)0x20000000; // TODO - Is there a SDK exposed variable/macro?
}
#endif
extern "C" void *__wrap_malloc(size_t size) {
noInterrupts();
@ -39,15 +53,63 @@ extern "C" void *__wrap_calloc(size_t count, size_t size) {
return rc;
}
extern "C" void *__wrap_realloc(void *mem, size_t size) {
#ifdef RP2350_PSRAM_CS
// Utilize the existing malloc lock infrastructure and interrupt blocking
// to work with multicore and FreeRTOS
extern "C" void *pmalloc(size_t size) {
noInterrupts();
void *rc = __real_realloc(mem, size);
__malloc_lock(__getreent());
auto rc = __psram_malloc(size);
__malloc_unlock(__getreent());
interrupts();
return rc;
}
extern "C" void *pcalloc(size_t count, size_t size) {
noInterrupts();
__malloc_lock(__getreent());
auto rc = __psram_calloc(count, size);
__malloc_unlock(__getreent());
interrupts();
return rc;
}
#endif
extern "C" void *__wrap_realloc(void *mem, size_t size) {
void *rc;
noInterrupts();
#ifdef RP2350_PSRAM_CS
if (mem < __ram_start) {
rc = __psram_realloc(mem, size);
} else {
rc = __real_realloc(mem, size);
}
#else
rc = __real_realloc(mem, size);
#endif
interrupts();
return rc;
}
extern "C" void __wrap_free(void *mem) {
noInterrupts();
#ifdef RP2350_PSRAM_CS
if (mem < __ram_start) {
__psram_free(mem);
} else {
__real_free(mem);
}
#else
__real_free(mem);
#endif
interrupts();
}
extern "C" struct mallinfo __wrap_mallinfo() {
noInterrupts();
__malloc_lock(__getreent());
auto ret = __real_mallinfo();
__malloc_unlock(__getreent());
interrupts();
return ret;
}

434
cores/rp2040/psram.cpp Normal file
View file

@ -0,0 +1,434 @@
// Originally from https://github.com/sparkfun/sparkfun-pico
/**
@file sfe_psram.c
@brief This file contains a function that is used to detect and initialize PSRAM on
SparkFun rp2350 boards.
*/
/*
The MIT License (MIT)
Copyright (c) 2024 SparkFun Electronics
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions: The
above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Hacked by Earle Philhower to work with the Arduino-Pico core
#include <Arduino.h>
#ifdef RP2350_PSRAM_CS
#include <hardware/address_mapped.h>
#include <hardware/clocks.h>
#include <hardware/gpio.h>
#include <hardware/regs/addressmap.h>
#include <hardware/spi.h>
#include <hardware/structs/qmi.h>
#include <hardware/structs/xip_ctrl.h>
#include <pico/runtime_init.h>
// Include TLSF in this compilation unit
#include "../../lib/tlsf/tlsf.c"
static tlsf_t _mem_heap = nullptr;
static pool_t _mem_psram_pool = nullptr;
// PSRAM heap minus PSRAM global/static variables from the linker
extern "C" {
extern uint8_t __psram_start__;
extern uint8_t __psram_heap_start__;
}
static bool _bInitalized = false;
size_t __psram_size = 0;
size_t __psram_heap_size = 0;
#define PICO_RUNTIME_INIT_PSRAM "11001" // Towards the end, after alarms
#ifndef RP2350_PSRAM_MAX_SELECT_FS64
#define RP2350_PSRAM_MAX_SELECT_FS64 (125'000'000)
#endif
#ifndef RP2350_PSRAM_MIN_DESELECT_FS
#define RP2350_PSRAM_MIN_DESELECT_FS (50'000'000)
#endif
#ifndef RP2350_PSRAM_MAX_SCK_HZ
#define RP2350_PSRAM_MAX_SCK_HZ (109'000'000)
#endif
#ifndef RP2350_PSRAM_ID
#define RP2350_PSRAM_ID (0x5D)
#endif
// DETAILS/
//
// SparkFun RP2350 boards use the following PSRAM IC:
//
// apmemory APS6404L-3SQR-ZR
// https://www.mouser.com/ProductDetail/AP-Memory/APS6404L-3SQR-ZR?qs=IS%252B4QmGtzzpDOdsCIglviw%3D%3D
//
// The origin of this logic is from the Circuit Python code that was downloaded from:
// https://github.com/raspberrypi/pico-sdk-rp2350/issues/12#issuecomment-2055274428
//
// Details on the PSRAM IC that are used during setup/configuration of PSRAM on SparkFun RP2350 boards.
// For PSRAM timing calculations - to use int math, we work in femto seconds (fs) (1e-15),
// NOTE: This idea is from micro python work on psram..
#define SFE_SEC_TO_FS 1000000000000000ll
// max select pulse width = 8us => 8e6 ns => 8000 ns => 8000 * 1e6 fs => 8000e6 fs
// Additionally, the MAX select is in units of 64 clock cycles - will use a constant that
// takes this into account - so 8000e6 fs / 64 = 125e6 fs
const uint32_t SFE_PSRAM_MAX_SELECT_FS64 = RP2350_PSRAM_MAX_SELECT_FS64;
// min deselect pulse width = 50ns => 50 * 1e6 fs => 50e7 fs
const uint32_t SFE_PSRAM_MIN_DESELECT_FS = RP2350_PSRAM_MIN_DESELECT_FS;
// from psram datasheet - max Freq with VDDat 3.3v - SparkFun RP2350 boards run at 3.3v.
// If VDD = 3.0 Max Freq is 133 Mhz
const uint32_t SFE_PSRAM_MAX_SCK_HZ = RP2350_PSRAM_MAX_SCK_HZ;
// PSRAM SPI command codes
const uint8_t PSRAM_CMD_QUAD_END = 0xF5;
const uint8_t PSRAM_CMD_QUAD_ENABLE = 0x35;
const uint8_t PSRAM_CMD_READ_ID = 0x9F;
const uint8_t PSRAM_CMD_RSTEN = 0x66;
const uint8_t PSRAM_CMD_RST = 0x99;
const uint8_t PSRAM_CMD_QUAD_READ = 0xEB;
const uint8_t PSRAM_CMD_QUAD_WRITE = 0x38;
const uint8_t PSRAM_CMD_NOOP = 0xFF;
const uint8_t PSRAM_ID = RP2350_PSRAM_ID;
//-----------------------------------------------------------------------------
/// @brief Communicate directly with the PSRAM IC - validate it is present and return the size
///
/// @return size_t The size of the PSRAM
///
/// @note This function expects the CS pin set
static size_t __no_inline_not_in_flash_func(get_psram_size)(void) {
size_t psram_size = 0;
uint32_t intr_stash = save_and_disable_interrupts();
// Try and read the PSRAM ID via direct_csr.
qmi_hw->direct_csr = 30 << QMI_DIRECT_CSR_CLKDIV_LSB | QMI_DIRECT_CSR_EN_BITS;
// Need to poll for the cooldown on the last XIP transfer to expire
// (via direct-mode BUSY flag) before it is safe to perform the first
// direct-mode operation
while ((qmi_hw->direct_csr & QMI_DIRECT_CSR_BUSY_BITS) != 0) {
}
// Exit out of QMI in case we've inited already
qmi_hw->direct_csr |= QMI_DIRECT_CSR_ASSERT_CS1N_BITS;
// Transmit the command to exit QPI quad mode - read ID as standard SPI
qmi_hw->direct_tx =
QMI_DIRECT_TX_OE_BITS | QMI_DIRECT_TX_IWIDTH_VALUE_Q << QMI_DIRECT_TX_IWIDTH_LSB | PSRAM_CMD_QUAD_END;
while ((qmi_hw->direct_csr & QMI_DIRECT_CSR_BUSY_BITS) != 0) {
}
(void)qmi_hw->direct_rx;
qmi_hw->direct_csr &= ~(QMI_DIRECT_CSR_ASSERT_CS1N_BITS);
// Read the id
qmi_hw->direct_csr |= QMI_DIRECT_CSR_ASSERT_CS1N_BITS;
uint8_t kgd = 0;
uint8_t eid = 0;
for (size_t i = 0; i < 7; i++) {
qmi_hw->direct_tx = (i == 0 ? PSRAM_CMD_READ_ID : PSRAM_CMD_NOOP);
while ((qmi_hw->direct_csr & QMI_DIRECT_CSR_TXEMPTY_BITS) == 0) {
}
while ((qmi_hw->direct_csr & QMI_DIRECT_CSR_BUSY_BITS) != 0) {
}
if (i == 5) {
kgd = qmi_hw->direct_rx;
} else if (i == 6) {
eid = qmi_hw->direct_rx;
} else {
(void)qmi_hw->direct_rx; // just read and discard
}
}
// Disable direct csr.
qmi_hw->direct_csr &= ~(QMI_DIRECT_CSR_ASSERT_CS1N_BITS | QMI_DIRECT_CSR_EN_BITS);
// is this the PSRAM we're looking for obi-wan?
if (kgd == PSRAM_ID) {
// PSRAM size
psram_size = 1024 * 1024; // 1 MiB
uint8_t size_id = eid >> 5;
if (eid == 0x26 || size_id == 2) {
psram_size *= 8;
} else if (size_id == 0) {
psram_size *= 2;
} else if (size_id == 1) {
psram_size *= 4;
}
}
restore_interrupts(intr_stash);
return psram_size;
}
//-----------------------------------------------------------------------------
/// @brief Update the PSRAM timing configuration based on system clock
///
/// @note This function expects interrupts to be enabled on entry
static void __no_inline_not_in_flash_func(set_psram_timing)(void) {
// Get secs / cycle for the system clock - get before disabling interrupts.
uint32_t sysHz = (uint32_t)clock_get_hz(clk_sys);
// Calculate the clock divider - goal to get clock used for PSRAM <= what
// the PSRAM IC can handle - which is defined in SFE_PSRAM_MAX_SCK_HZ
volatile uint8_t clockDivider = (sysHz + SFE_PSRAM_MAX_SCK_HZ - 1) / SFE_PSRAM_MAX_SCK_HZ;
uint32_t intr_stash = save_and_disable_interrupts();
// Get the clock femto seconds per cycle.
uint32_t fsPerCycle = SFE_SEC_TO_FS / sysHz;
// the maxSelect value is defined in units of 64 clock cycles
// So maxFS / (64 * fsPerCycle) = maxSelect = SFE_PSRAM_MAX_SELECT_FS64/fsPerCycle
volatile uint8_t maxSelect = SFE_PSRAM_MAX_SELECT_FS64 / fsPerCycle;
// minDeselect time - in system clock cycle
// Must be higher than 50ns (min deselect time for PSRAM) so add a fsPerCycle - 1 to round up
// So minFS/fsPerCycle = minDeselect = SFE_PSRAM_MIN_DESELECT_FS/fsPerCycle
volatile uint8_t minDeselect = (SFE_PSRAM_MIN_DESELECT_FS + fsPerCycle - 1) / fsPerCycle;
// printf("Max Select: %d, Min Deselect: %d, clock divider: %d\n", maxSelect, minDeselect, clockDivider);
qmi_hw->m[1].timing = QMI_M1_TIMING_PAGEBREAK_VALUE_1024 << QMI_M1_TIMING_PAGEBREAK_LSB | // Break between pages.
3 << QMI_M1_TIMING_SELECT_HOLD_LSB | // Delay releasing CS for 3 extra system cycles.
1 << QMI_M1_TIMING_COOLDOWN_LSB | 1 << QMI_M1_TIMING_RXDELAY_LSB |
maxSelect << QMI_M1_TIMING_MAX_SELECT_LSB | minDeselect << QMI_M1_TIMING_MIN_DESELECT_LSB |
clockDivider << QMI_M1_TIMING_CLKDIV_LSB;
restore_interrupts(intr_stash);
}
//-----------------------------------------------------------------------------
/// @brief The setup_psram function - note that this is not in flash
///
///
static void __no_inline_not_in_flash_func(runtime_init_setup_psram)(/*uint32_t psram_cs_pin*/) {
// Set the PSRAM CS pin in the SDK
gpio_set_function(RP2350_PSRAM_CS, GPIO_FUNC_XIP_CS1);
// start with zero size
size_t psram_size = get_psram_size();
// No PSRAM - no dice
if (psram_size == 0) {
return;
}
uint32_t intr_stash = save_and_disable_interrupts();
// Enable quad mode.
qmi_hw->direct_csr = 30 << QMI_DIRECT_CSR_CLKDIV_LSB | QMI_DIRECT_CSR_EN_BITS;
// Need to poll for the cooldown on the last XIP transfer to expire
// (via direct-mode BUSY flag) before it is safe to perform the first
// direct-mode operation
while ((qmi_hw->direct_csr & QMI_DIRECT_CSR_BUSY_BITS) != 0) {
}
// RESETEN, RESET and quad enable
for (uint8_t i = 0; i < 3; i++) {
qmi_hw->direct_csr |= QMI_DIRECT_CSR_ASSERT_CS1N_BITS;
if (i == 0) {
qmi_hw->direct_tx = PSRAM_CMD_RSTEN;
} else if (i == 1) {
qmi_hw->direct_tx = PSRAM_CMD_RST;
} else {
qmi_hw->direct_tx = PSRAM_CMD_QUAD_ENABLE;
}
while ((qmi_hw->direct_csr & QMI_DIRECT_CSR_BUSY_BITS) != 0) {
}
qmi_hw->direct_csr &= ~(QMI_DIRECT_CSR_ASSERT_CS1N_BITS);
for (size_t j = 0; j < 20; j++) {
asm("nop");
}
(void)qmi_hw->direct_rx;
}
// Disable direct csr.
qmi_hw->direct_csr &= ~(QMI_DIRECT_CSR_ASSERT_CS1N_BITS | QMI_DIRECT_CSR_EN_BITS);
// check our interrupts and setup the timing
restore_interrupts(intr_stash);
set_psram_timing();
// and now stash interrupts again
intr_stash = save_and_disable_interrupts();
qmi_hw->m[1].rfmt = (QMI_M1_RFMT_PREFIX_WIDTH_VALUE_Q << QMI_M1_RFMT_PREFIX_WIDTH_LSB |
QMI_M1_RFMT_ADDR_WIDTH_VALUE_Q << QMI_M1_RFMT_ADDR_WIDTH_LSB |
QMI_M1_RFMT_SUFFIX_WIDTH_VALUE_Q << QMI_M1_RFMT_SUFFIX_WIDTH_LSB |
QMI_M1_RFMT_DUMMY_WIDTH_VALUE_Q << QMI_M1_RFMT_DUMMY_WIDTH_LSB |
QMI_M1_RFMT_DUMMY_LEN_VALUE_24 << QMI_M1_RFMT_DUMMY_LEN_LSB |
QMI_M1_RFMT_DATA_WIDTH_VALUE_Q << QMI_M1_RFMT_DATA_WIDTH_LSB |
QMI_M1_RFMT_PREFIX_LEN_VALUE_8 << QMI_M1_RFMT_PREFIX_LEN_LSB |
QMI_M1_RFMT_SUFFIX_LEN_VALUE_NONE << QMI_M1_RFMT_SUFFIX_LEN_LSB);
qmi_hw->m[1].rcmd = PSRAM_CMD_QUAD_READ << QMI_M1_RCMD_PREFIX_LSB | 0 << QMI_M1_RCMD_SUFFIX_LSB;
qmi_hw->m[1].wfmt = (QMI_M1_WFMT_PREFIX_WIDTH_VALUE_Q << QMI_M1_WFMT_PREFIX_WIDTH_LSB |
QMI_M1_WFMT_ADDR_WIDTH_VALUE_Q << QMI_M1_WFMT_ADDR_WIDTH_LSB |
QMI_M1_WFMT_SUFFIX_WIDTH_VALUE_Q << QMI_M1_WFMT_SUFFIX_WIDTH_LSB |
QMI_M1_WFMT_DUMMY_WIDTH_VALUE_Q << QMI_M1_WFMT_DUMMY_WIDTH_LSB |
QMI_M1_WFMT_DUMMY_LEN_VALUE_NONE << QMI_M1_WFMT_DUMMY_LEN_LSB |
QMI_M1_WFMT_DATA_WIDTH_VALUE_Q << QMI_M1_WFMT_DATA_WIDTH_LSB |
QMI_M1_WFMT_PREFIX_LEN_VALUE_8 << QMI_M1_WFMT_PREFIX_LEN_LSB |
QMI_M1_WFMT_SUFFIX_LEN_VALUE_NONE << QMI_M1_WFMT_SUFFIX_LEN_LSB);
qmi_hw->m[1].wcmd = PSRAM_CMD_QUAD_WRITE << QMI_M1_WCMD_PREFIX_LSB | 0 << QMI_M1_WCMD_SUFFIX_LSB;
// Mark that we can write to PSRAM.
xip_ctrl_hw->ctrl |= XIP_CTRL_WRITABLE_M1_BITS;
restore_interrupts(intr_stash);
__psram_size = psram_size;
uint32_t used_psram_size = &__psram_heap_start__ - &__psram_start__;
__psram_heap_size = __psram_size - used_psram_size;
}
PICO_RUNTIME_INIT_FUNC_RUNTIME(runtime_init_setup_psram, PICO_RUNTIME_INIT_PSRAM);
// update timing -- used if the system clock/timing was changed.
void psram_reinit_timing() {
set_psram_timing();
}
static bool __psram_heap_init() {
if (_bInitalized) {
return true;
}
_mem_heap = NULL;
_mem_psram_pool = NULL;
_mem_heap = tlsf_create_with_pool((void *)&__psram_heap_start__, __psram_heap_size, 16 * 1024 * 1024);
if (!_mem_heap) {
return false;
}
_mem_psram_pool = tlsf_get_pool(_mem_heap);
if (!_mem_psram_pool) {
return false;
}
_bInitalized = true;
return true;
}
void *__psram_malloc(size_t size) {
if (!__psram_heap_init() || !_mem_heap) {
return NULL;
}
return tlsf_malloc(_mem_heap, size);
}
void __psram_free(void *ptr) {
if (!__psram_heap_init() || !_mem_heap) {
return;
}
tlsf_free(_mem_heap, ptr);
}
void *__psram_realloc(void *ptr, size_t size) {
if (!__psram_heap_init() || !_mem_heap) {
return NULL;
}
return tlsf_realloc(_mem_heap, ptr, size);
}
void *__psram_calloc(size_t num, size_t size) {
if (!__psram_heap_init() || !_mem_heap) {
return NULL;
}
void *ptr = tlsf_malloc(_mem_heap, num * size);
if (ptr) {
bzero(ptr, num * size);
}
return ptr;
}
static bool max_free_walker(void *ptr, size_t size, int used, void *user) {
size_t *max_size = (size_t *)user;
if (!used && *max_size < size) {
*max_size = size;
}
return true;
}
size_t __psram_largest_free_block() {
if (!__psram_heap_init() || !_mem_heap) {
return 0;
}
size_t max_free = 0;
if (_mem_psram_pool) {
tlsf_walk_pool(_mem_psram_pool, max_free_walker, &max_free);
}
return max_free;
}
static bool memory_size_walker(void *ptr, size_t size, int used, void *user) {
*((size_t *)user) += size;
return true;
}
size_t __psram_total_space() {
if (!__psram_heap_init() || !_mem_heap) {
return 0;
}
size_t total_size = 0;
if (_mem_psram_pool) {
tlsf_walk_pool(_mem_psram_pool, memory_size_walker, &total_size);
}
return total_size;
}
static bool memory_used_walker(void *ptr, size_t size, int used, void *user) {
if (used) {
*((size_t *)user) += size;
}
return true;
}
size_t __psram_total_used() {
if (!__psram_heap_init() || !_mem_heap) {
return 0;
}
size_t total_size = 0;
if (_mem_psram_pool) {
tlsf_walk_pool(_mem_psram_pool, memory_used_walker, &total_size);
}
return total_size;
}
#endif // RP2350_PSRAM_CS

41
cores/rp2040/psram.h Normal file
View file

@ -0,0 +1,41 @@
/**
@file sfe_psram.c
@brief This file contains a function that is used to detect and initialize PSRAM on
SparkFun rp2350 boards.
*/
/*
The MIT License (MIT)
Copyright (c) 2024 SparkFun Electronics
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions: The
above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <Arduino.h>
void psram_reinit_timing();
void *__psram_malloc(size_t size);
void __psram_free(void *ptr);
void *__psram_realloc(void *ptr, size_t size);
void *__psram_calloc(size_t num, size_t size);
size_t __psram_largest_free_block();
size_t __psram_total_space();
size_t __psram_total_used();

View file

@ -1,6 +1,8 @@
FreeRTOS SMP
============
**NOTE:** FreeRTOS is not yet supported on the RP2350. PRs gladly accepted!
The SMP (multicore) port of FreeRTOS is included with the core. This allows complex
task operations and real preemptive multithreading in your sketches. While the
``setup1`` and ``loop1`` way of multitasking is simplest for most folks, FreeRTOS

View file

@ -2,12 +2,12 @@ Arduino-Pico
============
This is the documentation for the Raspberry Pi Pico Arduino core,
Arduino-Pico. Arduino-Pico is a community port of the RP2040
(Raspberry Pi Pico processor) to the Arduino ecosystem, intended
to make it easier and more fun to use and program the Raspberry Pi
Pico / RP2040 based boards.
Arduino-Pico. Arduino-Pico is a community port of Arduino to the
RP2040 (Raspberry Pi Pico processor) and RP2350 (Raspberry Pi Pico 2
processor), intended to make it easier and more fun to use and
program the Raspberry Pi Pico / RP2040 / RP2350 based boards.
This Arduino core uses a custom toolset with GCC 10.3 and Newlib 4.0.0
This Arduino core uses a custom toolset with GCC 12.3 and Newlib 4.0.0
and doesn't require any system-installed prerequisites.
For the latest version, always check https://github.com/earlephilhower/arduino-pico
@ -26,7 +26,7 @@ For the latest version, always check https://github.com/earlephilhower/arduino-p
Pin (Re)Assignment <pins>
RP2040 Helper <rp2040>
RP2040/RP2350 Helper <rp2040>
Analog I/O <analog>
Digital I/O <digital>
@ -44,6 +44,8 @@ For the latest version, always check https://github.com/earlephilhower/arduino-p
USB (Arduino and Adafruit_TinyUSB) <usb>
Multicore Processing <multicore>
RP2350 PSRAM <psram>
Bluetooth <bluetooth>
Bluetooth HID Master <hidmaster>
Bluetooth Audio (A2DP) <a2dp>

View file

@ -1,6 +1,7 @@
OTA Updates
===========
**NOTE:** OTA is not yet supported on the RP2350. PRs gladly accepted!
Introduction
------------

View file

@ -263,7 +263,7 @@ Note that the special "No USB" setting is also supported, through the
shortcut-define ``PIO_FRAMEWORK_ARDUINO_NO_USB``.
IP Stack
---------
--------
The lwIP stack can be configured to support only IPv4 (default) or additionally IPv6. To activate IPv6 support, add

118
docs/psram.rst Normal file
View file

@ -0,0 +1,118 @@
RP2350 PSRAM Support
====================
The RP2350 chip in the Raspberry Pi Pico 2, and other RP2350 boards,
supports an external interface to PSRAM. When a PSRAM chip is attached
to the processor (please note that there is none on the Pico 2 board, but
iLabs and SparkFun boards, among others, do have it), up to 16 megabytes
of additional memory can be used by the chip.
While this external RAM is slower than the built-in SRAM, it is still
able to be used in any place where normal RAM would be used (other than
for memory-mapped functions and statically initialized variables).
When present, PSRAM can be used in two ways: for specific instantiated
variables, or through a ``malloc``-like access method. Both can be used
in any single application.
Using PSRAM for regular variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Similar to ``PROGMEM`` in the original Arduino AVR devices, the variable
decorator ``PSRAM`` can be added to map a variable into PSRAM. Simply add
``PSRAM`` to an array and it will be mapped into PSRAM:
.. code:: cpp
...
float weights[4000] PSRAM; // Place an array of 4000 floats in PSRAM
char samplefile[1'000'000] PSRAM; // Allocate 1M for WAV samples in PSRAM
...
These variables can be used just like normal ones, no special handling is
required. For example:
.. code:: cpp
char buff[4 *1024 * 1024]; // 4MB array
void initBuff() {
bzero(buff, sizeof(buff));
for (int i = 0; i < 4 *1024 * 1024; i += 4096) {
buff[i] = rand();
}
}
The only restriction is that these variables may not be initialized statically.
The following example will **NOT** work:
.. code:: cpp
char buff[] = "This is illegal and will not function";
Using PSRAM for dynamic allocations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSRAM can also be used as a heap for dynamica allocations using ``pmalloc`` and
``pcalloc``. These calls function exactly like normal ``malloc`` and ``calloc``
except they allocate space from PSRAM.
Simply replace a ``malloc`` or ``calloc`` with ``pmalloc`` or ``pcalloc`` to use
the PSRAM heap. Other calls, such as ``free`` and ``realloc`` "just work" and do
not need to be modified (they check where the passed-in pointer resides and
do the right thing automatically).
For example, to create and modify large buffer in PSRAM:
.. code:: cpp
void ex() {
int *buff;
// Ignoring OOM error conditions in example for brevity
buff = (int *)pmalloc(10000 * sizeof(*buff));
// Something happened and we need more space, so...
buff = (int *)realloc(buff, 20000 * sizeof(*buff)); // buff now has 20K elements
for (int i = 0; i < 20000; i++) {
buff[i] = i;
}
// Do some work, now we're done
free(buff);
}
C++ objects can be allocated in PSRAM using "placement new" constructors. Note that
this will only place immediate object data in PSRAM: if the object creates any other
objects via ``new`` *those* objects will be placed in normal RAM unless the object
also uses placement new constructors.
Checking on PSRAM space
~~~~~~~~~~~~~~~~~~~~~~~
The ``rp2040`` helper object has the following calls to return the state of the
PSRAM heap with the following calls, similar to the normal RAM heap:
int rp2040.getPSRAMSize()
-------------------------
Return the total size of the attached PSRAM chip. This is the **RAW** space and
does not take into account any allocations for static variables or dynamic
allocations. (i.e. it will return 1, 2, 4, 8, or 16MV depending on the chip).
int rp2040.getTotalPSRAMHeap()
------------------------------
Returns the total PSRAM heap (free and used) available or used for ``pmalloc``
allocations.
int rp2040.getUsedPSRAMHeap()
-----------------------------
Returns the total used bytes (including any overhead) of the PSRAM heap.
int getFreePSRAMHeap()
----------------------
Returns the total free bytes in the PSRAM heap. (Note that this may include
multiple non-contiguous chunks, so this is not always the maximum block size
that can be allocated.)

View file

@ -4,6 +4,7 @@
// based on PICO_CONFIG_HEADER_FILES:
#include "../../pico-sdk/src/boards/include/boards/pico.h"
#include "../../pico-sdk/src/boards/include/boards/pico_w.h"
#include "../../pico-sdk/src/rp2_common/cmsis/include/cmsis/rename_exceptions.h"
// based on PICO_RP2040_CONFIG_HEADER_FILES:

View file

@ -0,0 +1,75 @@
#pragma once
// BTstack features that can be enabled
#define ENABLE_LOG_INFO
#define ENABLE_LOG_DEBUG
#define ENABLE_LOG_ERROR
#define ENABLE_PRINTF_HEXDUMP
#define ENABLE_SCO_OVER_HCI
#ifdef ENABLE_CLASSIC
#define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
#endif
#ifdef ENABLE_BLE
#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE
#define ENABLE_LE_PERIPHERAL
#define ENABLE_LE_CENTRAL
#endif
// BTstack configuration. buffers, sizes, ...
#define HCI_OUTGOING_PRE_BUFFER_SIZE 4
#define HCI_ACL_PAYLOAD_SIZE (1691 + 4)
#define HCI_ACL_CHUNK_SIZE_ALIGNMENT 4
#define MAX_NR_AVDTP_CONNECTIONS 1
#define MAX_NR_AVDTP_STREAM_ENDPOINTS 1
#define MAX_NR_AVRCP_CONNECTIONS 2
#define MAX_NR_BNEP_CHANNELS 1
#define MAX_NR_BNEP_SERVICES 1
#define MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES 2
#define MAX_NR_GATT_CLIENTS 1
#define MAX_NR_HCI_CONNECTIONS 2
#define MAX_NR_HID_HOST_CONNECTIONS 1
#define MAX_NR_HIDS_CLIENTS 1
#define MAX_NR_HFP_CONNECTIONS 1
#define MAX_NR_L2CAP_CHANNELS 4
#define MAX_NR_L2CAP_SERVICES 3
#define MAX_NR_RFCOMM_CHANNELS 1
#define MAX_NR_RFCOMM_MULTIPLEXERS 1
#define MAX_NR_RFCOMM_SERVICES 1
#define MAX_NR_SERVICE_RECORD_ITEMS 4
#define MAX_NR_SM_LOOKUP_ENTRIES 3
#define MAX_NR_WHITELIST_ENTRIES 16
#define MAX_NR_LE_DEVICE_DB_ENTRIES 16
// Limit number of ACL/SCO Buffer to use by stack to avoid cyw43 shared bus overrun
#define MAX_NR_CONTROLLER_ACL_BUFFERS 3
#define MAX_NR_CONTROLLER_SCO_PACKETS 3
// Enable and configure HCI Controller to Host Flow Control to avoid cyw43 shared bus overrun
#define ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL
#define HCI_HOST_ACL_PACKET_LEN 1024
#define HCI_HOST_ACL_PACKET_NUM 3
#define HCI_HOST_SCO_PACKET_LEN 120
#define HCI_HOST_SCO_PACKET_NUM 3
// Link Key DB and LE Device DB using TLV on top of Flash Sector interface
#define NVM_NUM_DEVICE_DB_ENTRIES 16
#define NVM_NUM_LINK_KEYS 16
// We don't give btstack a malloc, so use a fixed-size ATT DB.
#define MAX_ATT_DB_SIZE 512
// BTstack HAL configuration
#define HAVE_EMBEDDED_TIME_MS
// map btstack_assert onto Pico SDK assert()
#define HAVE_ASSERT
// Some USB dongles take longer to respond to HCI reset (e.g. BCM20702A).
#define HCI_RESET_RESEND_TIMEOUT_MS 1000
#define ENABLE_SOFTWARE_AES128
#define ENABLE_MICRO_ECC_FOR_LE_SECURE_CONNECTIONS
#undef HAVE_BTSTACK_STDIN

View file

@ -0,0 +1,10 @@
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
// DO NOT EDIT!
// based on PICO_CONFIG_HEADER_FILES:
#include "../../pico-sdk/src/boards/include/boards/pico2.h"
#include "../../pico-sdk/src/rp2_common/cmsis/include/cmsis/rename_exceptions.h"
// based on PICO_RP2350_ARM_S_CONFIG_HEADER_FILES:

View file

@ -0,0 +1,50 @@
/*
ota_command.h - OTA stub that copies from LittleFS to flash
Copyright (c) 2022 Earle F. Philhower, III. All rights reserved.
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
*/
#pragma once
#include <stdint.h>
#define _OTA_WRITE 1
#define _OTA_VERIFY 1
typedef struct {
uint32_t command;
union {
struct {
char filename[64];
uint32_t fileOffset;
uint32_t fileLength;
uint32_t flashAddress; // Normally XIP_BASE
} write;
};
} commandEntry;
// Must fit within 4K page
typedef struct {
uint8_t sign[8]; // "Pico OTA"
// List of operations
uint32_t count;
commandEntry cmd[8];
uint32_t crc32; // CRC32 over just the contents of this struct, up until just before this value
} OTACmdPage;
#define _OTA_COMMAND_FILE "otacommand.bin"

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// ---------------------------------------
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
// ---------------------------------------
#ifndef _PICO_VERSION_H
#define _PICO_VERSION_H
#define PICO_SDK_VERSION_MAJOR 2
#define PICO_SDK_VERSION_MINOR 0
#define PICO_SDK_VERSION_REVISION 0
#define PICO_SDK_VERSION_STRING "2.0.0"
#endif

View file

@ -0,0 +1,91 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef _TUSB_CONFIG_H_
#define _TUSB_CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
//--------------------------------------------------------------------
// COMMON CONFIGURATION
//--------------------------------------------------------------------
#ifndef CFG_TUSB_MCU
#define CFG_TUSB_MCU OPT_MCU_RP2040
#endif
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
#define CFG_TUSB_OS OPT_OS_PICO
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
#ifndef CFG_TUSB_DEBUG
#define CFG_TUSB_DEBUG 0
#endif
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
* into those specific section.
* e.g
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
*/
#ifndef CFG_TUSB_MEM_SECTION
#define CFG_TUSB_MEM_SECTION
#endif
#ifndef CFG_TUSB_MEM_ALIGN
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
#endif
//--------------------------------------------------------------------
// DEVICE CONFIGURATION
//--------------------------------------------------------------------
#ifndef CFG_TUD_ENDPOINT0_SIZE
#define CFG_TUD_ENDPOINT0_SIZE 64
#endif
//------------- CLASS -------------//
#define CFG_TUD_HID (2)
#define CFG_TUD_CDC (1)
#define CFG_TUD_MSC (1)
#define CFG_TUD_MIDI (0)
#define CFG_TUD_VENDOR (0)
#define CFG_TUD_CDC_RX_BUFSIZE (256)
#define CFG_TUD_CDC_TX_BUFSIZE (256)
#define CFG_TUD_MSC_EP_BUFSIZE (64)
// HID buffer size Should be sufficient to hold ID (if any) + Data
#define CFG_TUD_HID_EP_BUFSIZE (64)
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_CONFIG_H_ */

View file

@ -56,6 +56,14 @@ restart KEYWORD2
isPicoW KEYWORD2
pmalloc KEYWORD2
pcalloc KEYWORD2
getPSRAMSize KEYWORD2
getFreePSRAMHeap KEYWORD2
getUsedPSRAMHeap KEYWORD2
getTotalPSRAMHeap KEYWORD2
getTotalPSRAM KEYWORD2
getChipID KEYWORD2
hwrand32 KEYWORD2
@ -92,3 +100,5 @@ OUTPUT_8MA LITERAL1
OUTPUT_12MA LITERAL1
ARDUINO_ARCH_RP2040 LITERAL1
PRAM LITERAL1

View file

@ -1,5 +1,5 @@
-iwithprefixbefore/cores/rp2040/api/deprecated-avr-comp
-iwithprefixbefore/include/pico_base
-iwithprefixbefore/pico-sdk/lib/tinyusb/src
-iwithprefixbefore/pico-sdk/src/boards/include
-iwithprefixbefore/pico-sdk/src/common/pico_base/include
@ -14,16 +14,8 @@
-iwithprefixbefore/pico-sdk/src/common/pico_util/include
-iwithprefixbefore/pico-sdk/src/common/pico_stdlib_headers/include
-iwithprefixbefore/pico-sdk/src/common/pico_usb_reset_interface_headers/include
-iwithprefixbefore/pico-sdk/src/rp2040/hardware_regs/include
-iwithprefixbefore/pico-sdk/src/rp2040/hardware_structs/include
-iwithprefixbefore/pico-sdk/src/rp2040/pico_platform/include
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/include
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/stub/CMSIS/Core/Include
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/stub/CMSIS/Device/RaspberryPi/RP2040/Include
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/stub/CMSIS/Device/RP2040/Include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_adc/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_base/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_boot_lock/include
@ -52,10 +44,8 @@
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_xosc/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_async_context/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_bootrom/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_btstack/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_cyw43_arch/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_cyw43_driver/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_double/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_float/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_int64_ops/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_lwip/include
@ -71,9 +61,4 @@
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_stdio/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_stdio_uart/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_unique_id/include
-iwithprefixbefore/pico-sdk/lib/cyw43-driver/src
-iwithprefixbefore/pico-sdk/lib/lwip/src/include
-iwithprefixbefore/pico-sdk/lib/btstack/src
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/decoder/include
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/encoder/include
-iwithprefixbefore/pico-sdk/lib/btstack/platform/embedded

69
lib/core_wrap.txt Normal file
View file

@ -0,0 +1,69 @@
-Wl,--wrap=__getreent
-Wl,--wrap=malloc
-Wl,--wrap=calloc
-Wl,--wrap=realloc
-Wl,--wrap=free
-Wl,--wrap=mallinfo
-Wl,--wrap=lwip_init
-Wl,--wrap=pbuf_header
-Wl,--wrap=pbuf_free
-Wl,--wrap=pbuf_alloc
-Wl,--wrap=pbuf_take
-Wl,--wrap=pbuf_copy_partial
-Wl,--wrap=pbuf_ref
-Wl,--wrap=pbuf_get_at
-Wl,--wrap=pbuf_get_contiguous
-Wl,--wrap=pbuf_cat
-Wl,--wrap=tcp_arg
-Wl,--wrap=tcp_new
-Wl,--wrap=tcp_bind
-Wl,--wrap=tcp_listen
-Wl,--wrap=tcp_listen_with_backlog
-Wl,--wrap=tcp_accept
-Wl,--wrap=tcp_connect
-Wl,--wrap=tcp_write
-Wl,--wrap=tcp_sent
-Wl,--wrap=tcp_recv
-Wl,--wrap=tcp_recved
-Wl,--wrap=tcp_poll
-Wl,--wrap=tcp_close
-Wl,--wrap=tcp_abort
-Wl,--wrap=tcp_err
-Wl,--wrap=tcp_output
-Wl,--wrap=tcp_setprio
-Wl,--wrap=tcp_backlog_delayed
-Wl,--wrap=tcp_backlog_accepted
-Wl,--wrap=udp_new
-Wl,--wrap=udp_remove
-Wl,--wrap=udp_bind
-Wl,--wrap=udp_connect
-Wl,--wrap=udp_disconnect
-Wl,--wrap=udp_send
-Wl,--wrap=udp_recv
-Wl,--wrap=udp_sendto_if
-Wl,--wrap=sys_check_timeouts
-Wl,--wrap=dns_gethostbyname
-Wl,--wrap=dns_gethostbyname_addrtype
-Wl,--wrap=raw_new
-Wl,--wrap=raw_recv
-Wl,--wrap=raw_bind
-Wl,--wrap=raw_sendto
-Wl,--wrap=raw_remove
-Wl,--wrap=netif_add
-Wl,--wrap=netif_remove
-Wl,--wrap=cyw43_cb_process_ethernet
-Wl,--wrap=cyw43_cb_tcpip_set_link_up
-Wl,--wrap=cyw43_cb_tcpip_set_link_down
-Wl,--wrap=cyw43_tcpip_link_status
-Wl,--wrap=cyw43_cb_tcpip_init
-Wl,--wrap=cyw43_cb_tcpip_deinit

View file

@ -0,0 +1,7 @@
-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1
-DCYW43_LWIP=1
-DCFG_TUSB_MCU=OPT_MCU_RP2040
-DARM_MATH_CM0_FAMILY
-DARM_MATH_CM0_PLUS
-DTARGET_RP2040
-DPICO_RP2040=1

View file

@ -0,0 +1,14 @@
-iwithprefixbefore/include/rp2040
-iwithprefixbefore/include/rp2040/pico_base
-iwithprefixbefore/pico-sdk/src/rp2040/hardware_regs/include
-iwithprefixbefore/pico-sdk/src/rp2040/hardware_structs/include
-iwithprefixbefore/pico-sdk/src/rp2040/pico_platform/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_btstack/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_cyw43_arch/include
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_cyw43_driver/include
-iwithprefixbefore/pico-sdk/lib/cyw43-driver/src
-iwithprefixbefore/pico-sdk/lib/btstack/src
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/decoder/include
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/encoder/include
-iwithprefixbefore/pico-sdk/lib/btstack/platform/embedded
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/stub/CMSIS/Device/RP2040/Include

View file

@ -144,72 +144,3 @@
-Wl,--wrap=tanhf
-Wl,--wrap=trunc
-Wl,--wrap=truncf
-Wl,--wrap=__getreent
-Wl,--wrap=malloc
-Wl,--wrap=calloc
-Wl,--wrap=realloc
-Wl,--wrap=free
-Wl,--wrap=lwip_init
-Wl,--wrap=pbuf_header
-Wl,--wrap=pbuf_free
-Wl,--wrap=pbuf_alloc
-Wl,--wrap=pbuf_take
-Wl,--wrap=pbuf_copy_partial
-Wl,--wrap=pbuf_ref
-Wl,--wrap=pbuf_get_at
-Wl,--wrap=pbuf_get_contiguous
-Wl,--wrap=pbuf_cat
-Wl,--wrap=tcp_arg
-Wl,--wrap=tcp_new
-Wl,--wrap=tcp_bind
-Wl,--wrap=tcp_listen
-Wl,--wrap=tcp_listen_with_backlog
-Wl,--wrap=tcp_accept
-Wl,--wrap=tcp_connect
-Wl,--wrap=tcp_write
-Wl,--wrap=tcp_sent
-Wl,--wrap=tcp_recv
-Wl,--wrap=tcp_recved
-Wl,--wrap=tcp_poll
-Wl,--wrap=tcp_close
-Wl,--wrap=tcp_abort
-Wl,--wrap=tcp_err
-Wl,--wrap=tcp_output
-Wl,--wrap=tcp_setprio
-Wl,--wrap=tcp_backlog_delayed
-Wl,--wrap=tcp_backlog_accepted
-Wl,--wrap=udp_new
-Wl,--wrap=udp_remove
-Wl,--wrap=udp_bind
-Wl,--wrap=udp_connect
-Wl,--wrap=udp_disconnect
-Wl,--wrap=udp_send
-Wl,--wrap=udp_recv
-Wl,--wrap=udp_sendto_if
-Wl,--wrap=sys_check_timeouts
-Wl,--wrap=dns_gethostbyname
-Wl,--wrap=dns_gethostbyname_addrtype
-Wl,--wrap=raw_new
-Wl,--wrap=raw_recv
-Wl,--wrap=raw_bind
-Wl,--wrap=raw_sendto
-Wl,--wrap=raw_remove
-Wl,--wrap=netif_add
-Wl,--wrap=netif_remove
-Wl,--wrap=cyw43_cb_process_ethernet
-Wl,--wrap=cyw43_cb_tcpip_set_link_up
-Wl,--wrap=cyw43_cb_tcpip_set_link_down
-Wl,--wrap=cyw43_tcpip_link_status
-Wl,--wrap=cyw43_cb_tcpip_init
-Wl,--wrap=cyw43_cb_tcpip_deinit

BIN
lib/rp2350/libbearssl.a Normal file

Binary file not shown.

BIN
lib/rp2350/libipv4-big.a Normal file

Binary file not shown.

Binary file not shown.

BIN
lib/rp2350/libipv4-ipv6.a Normal file

Binary file not shown.

BIN
lib/rp2350/libipv4.a Normal file

Binary file not shown.

BIN
lib/rp2350/libpico.a Normal file

Binary file not shown.

View file

@ -0,0 +1,319 @@
/* Based on GCC ARM embedded samples.
Defines the following symbols for use by code:
__exidx_start
__exidx_end
__etext
__data_start__
__preinit_array_start
__preinit_array_end
__init_array_start
__init_array_end
__fini_array_start
__fini_array_end
__data_end__
__bss_start__
__bss_end__
__end__
end
__HeapLimit
__StackLimit
__StackTop
__stack (== StackTop)
*/
MEMORY
{
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = __FLASH_LENGTH__
PSRAM(rwx) : ORIGIN = 0x11000000, LENGTH = __PSRAM_LENGTH__
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = __RAM_LENGTH__
SCRATCH_X(rwx) : ORIGIN = 0x20080000, LENGTH = 4k
SCRATCH_Y(rwx) : ORIGIN = 0x20081000, LENGTH = 4k
}
PROVIDE ( _EEPROM_start = __EEPROM_START__ );
PROVIDE ( _FS_start = __FS_START__ );
PROVIDE ( _FS_end = __FS_END__ );
ENTRY(_entry_point)
SECTIONS
{
.flash_begin : {
__flash_binary_start = .;
} > FLASH
/* The bootrom will enter the image at the point indicated in your
IMAGE_DEF, which is usually the reset handler of your vector table.
The debugger will use the ELF entry point, which is the _entry_point
symbol, and in our case is *different from the bootrom's entry point.*
This is used to go back through the bootrom on debugger launches only,
to perform the same initial flash setup that would be performed on a
cold boot.
*/
.text : {
__logical_binary_start = .;
KEEP (*(.vectors))
KEEP (*(.binary_info_header))
__binary_info_header_end = .;
KEEP (*(.embedded_block))
__embedded_block_end = .;
KEEP (*(.reset))
/* TODO revisit this now memset/memcpy/float in ROM */
/* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from
* FLASH ... we will include any thing excluded here in .data below by default */
*(.init)
*libgcc.a:cmse_nonsecure_call.o
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .text*)
*(.fini)
/* Pull all c'tors into .text */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* Followed by destructors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(SORT(.preinit_array.*)))
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
*(SORT(.fini_array.*))
*(.fini_array)
PROVIDE_HIDDEN (__fini_array_end = .);
*(.eh_frame*)
. = ALIGN(4);
} > FLASH
/* Note the boot2 section is optional, and should be discarded if there is
no reference to it *inside* the binary, as it is not called by the
bootrom. (The bootrom performs a simple best-effort XIP setup and
leaves it to the binary to do anything more sophisticated.) However
there is still a size limit of 256 bytes, to ensure the boot2 can be
stored in boot RAM.
Really this is a "XIP setup function" -- the name boot2 is historic and
refers to its dual-purpose on RP2040, where it also handled vectoring
from the bootrom into the user image.
*/
.boot2 : {
__boot2_start__ = .;
*(.boot2)
__boot2_end__ = .;
} > FLASH
ASSERT(__boot2_end__ - __boot2_start__ <= 256,
"ERROR: Pico second stage bootloader must be no more than 256 bytes in size")
.rodata : {
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .rodata*)
*(.srodata*)
. = ALIGN(4);
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
. = ALIGN(4);
} > FLASH
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > FLASH
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;
/* Machine inspectable binary information */
. = ALIGN(4);
__binary_info_start = .;
.binary_info :
{
KEEP(*(.binary_info.keep.*))
*(.binary_info.*)
} > FLASH
__binary_info_end = .;
. = ALIGN(4);
.ram_vector_table (NOLOAD): {
*(.ram_vector_table)
} > RAM
.uninitialized_data (NOLOAD): {
. = ALIGN(4);
*(.uninitialized_data*)
} > RAM
.data : {
__data_start__ = .;
*(vtable)
*(.time_critical*)
/* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
*(.text*)
. = ALIGN(4);
*(.rodata*)
. = ALIGN(4);
*(.data*)
*(.sdata*)
. = ALIGN(4);
*(.after_data.*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__mutex_array_start = .);
KEEP(*(SORT(.mutex_array.*)))
KEEP(*(.mutex_array))
PROVIDE_HIDDEN (__mutex_array_end = .);
*(.jcr)
. = ALIGN(4);
} > RAM AT> FLASH
.tdata : {
. = ALIGN(4);
*(.tdata .tdata.* .gnu.linkonce.td.*)
/* All data end */
__tdata_end = .;
} > RAM AT> FLASH
PROVIDE(__data_end__ = .);
/* __etext is (for backwards compatibility) the name of the .data init source pointer (...) */
__etext = LOADADDR(.data);
.tbss (NOLOAD) : {
. = ALIGN(4);
__bss_start__ = .;
__tls_base = .;
*(.tbss .tbss.* .gnu.linkonce.tb.*)
*(.tcommon)
__tls_end = .;
} > RAM
.bss (NOLOAD) : {
. = ALIGN(4);
__tbss_end = .;
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*)))
*(COMMON)
PROVIDE(__global_pointer$ = . + 2K);
*(.sbss*)
. = ALIGN(4);
__bss_end__ = .;
} > RAM
.heap (NOLOAD):
{
__end__ = .;
end = __end__;
KEEP(*(.heap*))
/* historically on GCC sbrk was growing past __HeapLimit to __StackLimit, however
to be more compatible, we now set __HeapLimit explicitly to where the end of the heap is */
. = ORIGIN(RAM) + LENGTH(RAM);
__HeapLimit = .;
} > RAM
/* Start and end symbols must be word-aligned */
.scratch_x : {
__scratch_x_start__ = .;
*(.scratch_x.*)
. = ALIGN(4);
__scratch_x_end__ = .;
} > SCRATCH_X AT > FLASH
__scratch_x_source__ = LOADADDR(.scratch_x);
.scratch_y : {
__scratch_y_start__ = .;
*(.scratch_y.*)
. = ALIGN(4);
__scratch_y_end__ = .;
} > SCRATCH_Y AT > FLASH
__scratch_y_source__ = LOADADDR(.scratch_y);
/* .stack*_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later
*
* stack1 section may be empty/missing if platform_launch_core1 is not used */
/* by default we put core 0 stack at the end of scratch Y, so that if core 1
* stack is not used then all of SCRATCH_X is free.
*/
.stack1_dummy (NOLOAD):
{
*(.stack1*)
} > SCRATCH_X
.stack_dummy (NOLOAD):
{
KEEP(*(.stack*))
} > SCRATCH_Y
.flash_end : {
KEEP(*(.embedded_end_block*))
PROVIDE(__flash_binary_end = .);
} > FLASH =0xaa
.psram (NOLOAD) : {
__psram_start__ = .;
*(.psram*)
. = ALIGN(4096);
__psram_heap_start__ = .;
} > PSRAM
/* stack limit is poorly named, but historically is maximum heap ptr */
__StackLimit = ORIGIN(RAM) + LENGTH(RAM);
__StackOneTop = ORIGIN(SCRATCH_X) + LENGTH(SCRATCH_X);
__StackTop = ORIGIN(SCRATCH_Y) + LENGTH(SCRATCH_Y);
__StackOneBottom = __StackOneTop - SIZEOF(.stack1_dummy);
__StackBottom = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
/* picolibc and LLVM */
PROVIDE (__heap_start = __end__);
PROVIDE (__heap_end = __HeapLimit);
PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) );
PROVIDE( __tls_size_align = (__tls_size + __tls_align - 1) & ~(__tls_align - 1));
PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) );
/* TLSF */
PROVIDE (__psram_start = __psram_start__);
PROVIDE (__psram_heap_start = __psram_heap_start__);
/* llvm-libc */
PROVIDE (_end = __end__);
PROVIDE (__llvm_libc_heap_limit = __HeapLimit);
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed")
ASSERT( __binary_info_header_end - __logical_binary_start <= 1024, "Binary info must be in first 1024 bytes of the binary")
ASSERT( __embedded_block_end - __logical_binary_start <= 4096, "Embedded block must be in first 4096 bytes of the binary")
/* todo assert on extra code */
}

BIN
lib/rp2350/ota.o Normal file

Binary file not shown.

View file

@ -0,0 +1,3 @@
source [find interface/cmsis-dap.cfg]
adapter speed 5000
source [find target/rp2350.cfg]

View file

@ -0,0 +1,53 @@
-DCFG_TUSB_DEBUG=0
-DCFG_TUSB_MCU=OPT_MCU_RP2040
-DCFG_TUSB_OS=OPT_OS_PICO
-DLIB_BOOT_STAGE2_HEADERS=1
-DLIB_PICO_ATOMIC=1
-DLIB_PICO_BIT_OPS=1
-DLIB_PICO_BIT_OPS_PICO=1
-DLIB_PICO_CLIB_INTERFACE=1
-DLIB_PICO_CRT0=1
-DLIB_PICO_CXX_OPTIONS=1
-DLIB_PICO_DIVIDER=1
-DLIB_PICO_DIVIDER_COMPILER=1
-DLIB_PICO_DOUBLE=1
-DLIB_PICO_DOUBLE_PICO=1
-DLIB_PICO_FIX_RP2040_USB_DEVICE_ENUMERATION=1
-DLIB_PICO_FLOAT=1
-DLIB_PICO_FLOAT_PICO=1
-DLIB_PICO_FLOAT_PICO_VFP=1
-DLIB_PICO_INT64_OPS=1
-DLIB_PICO_INT64_OPS_COMPILER=1
-DLIB_PICO_MEM_OPS=1
-DLIB_PICO_MEM_OPS_COMPILER=1
-DLIB_PICO_NEWLIB_INTERFACE=1
-DLIB_PICO_PLATFORM=1
-DLIB_PICO_PLATFORM_COMPILER=1
-DLIB_PICO_PLATFORM_PANIC=1
-DLIB_PICO_PLATFORM_SECTIONS=1
-DLIB_PICO_RUNTIME=1
-DLIB_PICO_RUNTIME_INIT=1
-DLIB_PICO_STANDARD_BINARY_INFO=1
-DLIB_PICO_STANDARD_LINK=1
-DLIB_PICO_SYNC=1
-DLIB_PICO_SYNC_CRITICAL_SECTION=1
-DLIB_PICO_SYNC_MUTEX=1
-DLIB_PICO_SYNC_SEM=1
-DLIB_PICO_TIME=1
-DLIB_PICO_TIME_ADAPTER=1
-DLIB_PICO_UNIQUE_ID=1
-DLIB_PICO_UTIL=1
-DLIB_TINYUSB_BOARD=1
-DLIB_TINYUSB_DEVICE=1
-DPICO_32BIT=1
-DPICO_BOARD=\"pico2\"
-DPICO_BUILD=1
-DPICO_COPY_TO_RAM=0
-DPICO_CXX_ENABLE_EXCEPTIONS=0
-DPICO_NO_FLASH=0
-DPICO_NO_HARDWARE=0
-DPICO_ON_DEVICE=1
-DPICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1
-DPICO_RP2040_USB_DEVICE_UFRAME_FIX=1
-DPICO_RP2350=1
-DPICO_USE_BLOCKED_RAM=0

View file

@ -0,0 +1,6 @@
-iwithprefixbefore/include/rp2350
-iwithprefixbefore/include/rp2350/pico_base
-iwithprefixbefore/pico-sdk/src/rp2350/hardware_regs/include
-iwithprefixbefore/pico-sdk/src/rp2350/hardware_structs/include
-iwithprefixbefore/pico-sdk/src/rp2350/pico_platform/include
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/stub/CMSIS/Device/RP2350/Include

View file

@ -0,0 +1,99 @@
-Wl,--wrap=acos
-Wl,--wrap=acosf
-Wl,--wrap=acosh
-Wl,--wrap=acoshf
-Wl,--wrap=__aeabi_cdcmpeq
-Wl,--wrap=__aeabi_cdcmple
-Wl,--wrap=__aeabi_cdrcmple
-Wl,--wrap=__aeabi_d2f
-Wl,--wrap=__aeabi_d2iz
-Wl,--wrap=__aeabi_d2lz
-Wl,--wrap=__aeabi_d2uiz
-Wl,--wrap=__aeabi_d2ulz
-Wl,--wrap=__aeabi_dadd
-Wl,--wrap=__aeabi_dcmpeq
-Wl,--wrap=__aeabi_dcmpge
-Wl,--wrap=__aeabi_dcmpgt
-Wl,--wrap=__aeabi_dcmple
-Wl,--wrap=__aeabi_dcmplt
-Wl,--wrap=__aeabi_dcmpun
-Wl,--wrap=__aeabi_ddiv
-Wl,--wrap=__aeabi_dmul
-Wl,--wrap=__aeabi_drsub
-Wl,--wrap=__aeabi_dsub
-Wl,--wrap=__aeabi_i2d
-Wl,--wrap=__aeabi_l2d
-Wl,--wrap=__aeabi_ui2d
-Wl,--wrap=__aeabi_ul2d
-Wl,--wrap=asin
-Wl,--wrap=asinf
-Wl,--wrap=asinh
-Wl,--wrap=asinhf
-Wl,--wrap=atan
-Wl,--wrap=atan2
-Wl,--wrap=atan2f
-Wl,--wrap=atanf
-Wl,--wrap=atanh
-Wl,--wrap=atanhf
-Wl,--wrap=cbrt
-Wl,--wrap=cbrtf
-Wl,--wrap=ceil
-Wl,--wrap=ceilf
-Wl,--wrap=copysign
-Wl,--wrap=copysignf
-Wl,--wrap=cos
-Wl,--wrap=cosf
-Wl,--wrap=cosh
-Wl,--wrap=coshf
-Wl,--wrap=__ctzdi2
-Wl,--wrap=drem
-Wl,--wrap=dremf
-Wl,--wrap=exp
-Wl,--wrap=exp10
-Wl,--wrap=exp10f
-Wl,--wrap=exp2
-Wl,--wrap=exp2f
-Wl,--wrap=expf
-Wl,--wrap=expm1
-Wl,--wrap=expm1f
-Wl,--wrap=floor
-Wl,--wrap=floorf
-Wl,--wrap=fma
-Wl,--wrap=fmaf
-Wl,--wrap=fmod
-Wl,--wrap=fmodf
-Wl,--wrap=hypot
-Wl,--wrap=hypotf
-Wl,--wrap=ldexp
-Wl,--wrap=ldexpf
-Wl,--wrap=log
-Wl,--wrap=log10
-Wl,--wrap=log10f
-Wl,--wrap=log1p
-Wl,--wrap=log1pf
-Wl,--wrap=log2
-Wl,--wrap=log2f
-Wl,--wrap=logf
-Wl,--wrap=pow
-Wl,--wrap=powf
-Wl,--wrap=powint
-Wl,--wrap=powintf
-Wl,--wrap=remainder
-Wl,--wrap=remainderf
-Wl,--wrap=remquo
-Wl,--wrap=remquof
-Wl,--wrap=round
-Wl,--wrap=roundf
-Wl,--wrap=sin
-Wl,--wrap=sincos
-Wl,--wrap=sincosf
-Wl,--wrap=sinf
-Wl,--wrap=sinh
-Wl,--wrap=sinhf
-Wl,--wrap=sqrt
-Wl,--wrap=tan
-Wl,--wrap=tanf
-Wl,--wrap=tanh
-Wl,--wrap=tanhf
-Wl,--wrap=trunc
-Wl,--wrap=truncf

1
lib/tlsf Submodule

@ -0,0 +1 @@
Subproject commit 8653cec85de043454d0e9ddb0957711f6bd14fa1

@ -1 +1 @@
Subproject commit c953968c468218d8968138b5ed8482fa565373df
Subproject commit 446e0af7a90f5b8eefac626767607436522610e5

View file

@ -1 +1,5 @@
#ifdef PICO_RP2350
#error Sorry, FreeRTOS is not yet supported on the RP2350 in this core.
#else
#include "../lib/FreeRTOS-Kernel/include/FreeRTOS.h"
#endif

View file

@ -32,9 +32,9 @@
#include <string.h>
#include <errno.h>
#include "cyw43_config.h"
#include "dhcpserver.h"
#include "lwip/udp.h"
#include <lwip/udp.h>
#include <pico/time.h>
#define DHCPDISCOVER (1)
#define DHCPOFFER (2)
@ -87,6 +87,11 @@ typedef struct {
uint8_t options[312]; // optional parameters, variable, starts with magic
} dhcp_msg_t;
// Imported to avoid needing CYW43 internals
static inline uint32_t cyw43_hal_ticks_ms(void) {
return to_ms_since_boot(get_absolute_time());
}
static int dhcp_socket_new_dgram(struct udp_pcb **udp, void *cb_data, udp_recv_fn cb_udp_recv) {
// family is AF_INET
// type is SOCK_DGRAM

View file

@ -22,7 +22,9 @@
#include <lwip/timeouts.h>
#include <lwip/dns.h>
#include <pico/mutex.h>
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
#include <pico/cyw43_arch.h>
#endif
#include <pico/async_context_threadsafe_background.h>
#include <functional>
#include <map>

View file

@ -21,9 +21,10 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <Arduino.h>
#include <LwipIntf.h>
//#include <Schedule.h>
//#include <debug.h>
#include <debug_internal.h>
#define NETIF_STATUS_CB_SIZE 3

View file

@ -50,6 +50,21 @@
#define DEFAULT_MTU 1500
#endif
// Dup'd to avoid CYW43 dependency
// Generate a mac address if one is not set in otp
extern "C" {
static void cyw43_hal_generate_laa_mac(__unused int idx, uint8_t buf[6]) {
pico_unique_board_id_t board_id;
pico_get_unique_board_id(&board_id);
memcpy(buf, &board_id.id[2], 6);
buf[0] &= (uint8_t)~0x1; // unicast
buf[0] |= 0x2; // locally administered
}
};
enum EthernetLinkStatus {
Unknown,
LinkON,

View file

@ -0,0 +1,45 @@
// Simple test of core freezing. Applications should not have a reason to
// freeze a core, but LittleFS and EEPROM need to be able to do it to
// avoid crashes when the opposite core tries to read flash while it's
// being programmed.
// Public domain 2024, Earle F. Philhower
volatile int c0 = 0;
volatile int c1 = 0;
void setup() {
delay(5000);
for (int i = 0; i < 200; i++) {
c0++;
Serial.printf("%d %d\n", c0, c1);
delay(1);
}
int start = c1;
rp2040.idleOtherCore();
for (int i = 0; i < 2000; i++) {
c0++;
delay(1);
}
int end = c1;
rp2040.resumeOtherCore();
Serial.printf("Core0: %d, Core1 now %d, Core1 delta while stopped: %d\n", c0, c1, end - start);
for (int i = 0; i < 200; i++) {
c0++;
Serial.printf("%d %d\n", c0, c1);
delay(1);
}
}
void loop() {
}
void setup1() {
delay(5000);
while (1) {
c1++;
delay(1);
}
}
void loop1() {
}

View file

@ -0,0 +1 @@
/* Dummy header for Arduino */

View file

@ -0,0 +1,98 @@
/*
PSRAM Test
This section of code tests the onboard ram of RP2350 based boards with external
PSRAM.
This example code is in the public domain.
*/
#if !defined(RP2350_PSRAM_CS)
void setup() {
Serial.println("This example needs an RP2350 with PSRAM attached");
}
void loop() {
}
#else
#define CHUNK_SIZE 131072
#define PMALLOCSIZE (CHUNK_SIZE * 13)
uint8_t tmp[CHUNK_SIZE];
uint8_t mems[1024 * 1024 * 1] PSRAM;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
while (!Serial) {
delay(10);
}
Serial.begin(115200);
Serial.printf("PSRAM Size: %d\r\n", rp2040.getPSRAMSize());
}
// the loop function runs over and over again forever
void loop() {
int i;
static int cntr = 1;
uint8_t *mem = mems;
Serial.printf("%05d: Filling %d memory locations @%p with random values and verifying in %d byte chunks.\r\n", cntr++, sizeof(mems), mem, CHUNK_SIZE);
for (size_t m = 0; m < (sizeof(mems) / CHUNK_SIZE); m++) {
for (i = 0; i < CHUNK_SIZE; i++) {
tmp[i] = (char)random(0, 255);
mem[i] = tmp[i];
}
for (i = 0; i < CHUNK_SIZE; i++) {
if (mem[i] != tmp[i]) {
Serial.printf("Memory error @%p(%d), was 0x%02x, should be 0x%02x\r\n", mem, i, *mem, tmp[i]);
delay(10);
}
}
Serial.write('.');
Serial.flush();
mem += CHUNK_SIZE;
}
Serial.printf("\r\nDone, testing %d bytes\r\n", sizeof(mems));
Serial.printf("\r\nBefore pmalloc, total PSRAM heap: %d, available PSRAM heap: %d\r\n", rp2040.getTotalPSRAMHeap(), rp2040.getFreePSRAMHeap());
uint8_t *pmem = (uint8_t *)pmalloc(PMALLOCSIZE);
if (!pmem) {
Serial.printf("Error: Unable to allocate PSRAM chunk!\r\n");
return;
}
Serial.printf("After pmalloc, total PSRAM heap: %d, available PSRAM heap: %d\r\n", rp2040.getTotalPSRAMHeap(), rp2040.getFreePSRAMHeap());
Serial.printf("Allocated block @%p, size %d\r\n", pmem, PMALLOCSIZE);
delay(3000);
mem = pmem;
for (size_t m = 0; m < (PMALLOCSIZE / CHUNK_SIZE); m++) {
for (i = 0; i < CHUNK_SIZE; i++) {
tmp[i] = (char)random(0, 255);
mem[i] = tmp[i];
}
for (i = 0; i < CHUNK_SIZE; i++) {
if (mem[i] != tmp[i]) {
Serial.printf("Memory error @%p(%d), was 0x%02x, should be 0x%02x\r\n", mem, i, *mem, tmp[i]);
delay(10);
}
}
Serial.write('.');
Serial.flush();
mem += CHUNK_SIZE;
}
Serial.printf("\nDone, testing %d allocated bytes\r\n", sizeof(mems));
free(pmem); // Release allocation for next pass
Serial.printf("After free, total PSRAM heap: %d, available PSRAM heap: %d\r\n", rp2040.getTotalPSRAMHeap(), rp2040.getFreePSRAMHeap());
delay(1000);
}
#endif // RAM_CHIP_SELECT

View file

@ -0,0 +1 @@
gerPSRAMSize KEYWORD1

View file

@ -1,5 +1,21 @@
cmake_minimum_required(VERSION 3.12)
set(cpu $ENV{CPU})
message("Building for CPU ${cpu}")
if (${cpu} MATCHES "rp2040")
set(PICO_BOARD pico)
set(PICO_PLATFORM rp2040)
set(PICO_CYW43_SUPPORTED 0)
elseif(${cpu} MATCHES "rp2350")
set(PICO_BOARD pico2)
set(PICO_PLATFORM rp2350)
set(PICO_CYW43_SUPPORTED 0)
else()
message(FATAL_ERROR "Unknown CPU, '${cpu}'")
endif()
include(pico_sdk_import.cmake)
project(pico_lib C CXX ASM)
@ -7,7 +23,6 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(PICO_BOARD pico)
set(PICO_COPY_TO_RAM 1)
# Initialize the SDK
@ -66,7 +81,7 @@ target_link_options(ota PUBLIC
)
set_target_properties(ota PROPERTIES PICO_TARGET_LINKER_SCRIPT
${CMAKE_SOURCE_DIR}/memmap_ota.ld)
${CMAKE_SOURCE_DIR}/memmap_ota_${cpu}.ld)
target_link_libraries(ota
pico_platform
@ -83,6 +98,6 @@ target_link_libraries(ota
add_custom_command(TARGET ota POST_BUILD
COMMAND ../../system/arm-none-eabi/bin/arm-none-eabi-ld -r -A armv6-m -b binary -o ota.o ota.bin
COMMAND ../../system/arm-none-eabi/bin/arm-none-eabi-objcopy --rename-section .data=.OTA ota.o ../../lib/ota.o
COMMAND cp ../ota_command.h ../../include/pico_base/pico/.
COMMAND ../../system/arm-none-eabi/bin/arm-none-eabi-objcopy --rename-section .data=.OTA ota.o ../../lib/${cpu}/ota.o
COMMAND cp ../ota_command.h ../../include/${cpu}/pico_base/pico/.
)

View file

@ -8,5 +8,13 @@ export PATH="$(cd ../system/arm-none-eabi/bin; pwd):$PATH"
rm -rf build
mkdir build
cd build
cmake ..
make -j # VERBOSE=1
CPU=rp2040 cmake ..
CPU=rp2040 make -j # VERBOSE=1
cd ..
rm -rf build-rp2350
mkdir build-rp2350
cd build-rp2350
CPU=rp2350 cmake .. -DPICO_RUNTIME_SKIP_INIT_DEFAULT_ALARM_POOL=1
CPU=rp2350 make -j # VERBOSE=1
cd ..

246
ota/memmap_ota_rp2350.ld Normal file
View file

@ -0,0 +1,246 @@
/* Based on GCC ARM embedded samples.
Defines the following symbols for use by code:
__exidx_start
__exidx_end
__etext
__data_start__
__preinit_array_start
__preinit_array_end
__init_array_start
__init_array_end
__fini_array_start
__fini_array_end
__data_end__
__bss_start__
__bss_end__
__end__
end
__HeapLimit
__StackLimit
__StackTop
__stack (== StackTop)
*/
MEMORY
{
FLASH(rx) : ORIGIN = 0x10000100, LENGTH = 16384k
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 212k
/* We split RAM into main (where the flash->ram code will be copied) and GLOBALS which has all large arrays */
/* By placing those arrays at the end of RAM we can avoid overwriting uninitialize_ram from the main app as */
/* long as those vars are stored after 12K by using an alignment value in the main app linker file. */
GLOBALS(rwx) : ORIGIN = 0x20035000, LENGTH = 44k
SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
}
ENTRY(_entry_point)
SECTIONS {
/* Second stage bootloader is prepended to the image. It must be 256 bytes big
and checksummed. It is usually built by the boot_stage2 target
in the Raspberry Pi Pico SDK
*/
/* Make sure the globals are not copied/etc. They're empty RAM we will init ourselves */
.globals (NOLOAD) : {
} > GLOBALS
.flash_begin : {
__flash_binary_start = .;
} > FLASH
/*
.boot2 : {
__boot2_start__ = .;
KEEP (*(.boot2))
__boot2_end__ = .;
} > FLASH
ASSERT(__boot2_end__ - __boot2_start__ == 256,
"ERROR: Pico second stage bootloader must be 256 bytes in size")
*/
/* The second stage will always enter the image at the start of .text.
The debugger will use the ELF entry point, which is the _entry_point
symbol if present, otherwise defaults to start of .text.
This can be used to transfer control back to the bootrom on debugger
launches only, to perform proper flash setup.
*/
.flashtext : {
__logical_binary_start = .;
KEEP (*(.vectors))
KEEP (*(.binary_info_header))
__binary_info_header_end = .;
KEEP (*(.reset))
}
.rodata : {
/* segments not marked as .flashdata are instead pulled into .data (in RAM) to avoid accidental flash accesses */
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
. = ALIGN(4);
} > FLASH
.ARM.extab : {
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > FLASH
__exidx_start = .;
.ARM.exidx : {
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;
. = ALIGN(4);
/* Vector table goes first in RAM, to avoid large alignment hole */
.ram_vector_table (COPY): {
*(.ram_vector_table)
} > RAM
.text : {
__ram_text_start__ = .;
*(.init)
*(.text*)
*(.fini)
/* Pull all c'tors into .text */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* Followed by destructors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
*(.eh_frame*)
. = ALIGN(4);
__ram_text_end__ = .;
} > RAM AT> FLASH
__ram_text_source__ = LOADADDR(.text);
.data : {
__data_start__ = .;
*(vtable)
*(.time_critical*)
. = ALIGN(4);
*(.rodata*)
. = ALIGN(4);
*(.data*)
. = ALIGN(4);
*(.after_data.*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__mutex_array_start = .);
KEEP(*(SORT(.mutex_array.*)))
KEEP(*(.mutex_array))
PROVIDE_HIDDEN (__mutex_array_end = .);
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(SORT(.preinit_array.*)))
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
*(SORT(.fini_array.*))
*(.fini_array)
PROVIDE_HIDDEN (__fini_array_end = .);
*(.jcr)
. = ALIGN(4);
/* All data end */
__data_end__ = .;
} > RAM AT> FLASH
/* __etext is the name of the .data init source pointer (...) */
__etext = LOADADDR(.data);
.uninitialized_data (COPY): {
. = ALIGN(4);
*(.uninitialized_data*)
} > RAM
/* Start and end symbols must be word-aligned */
.scratch_x : {
__scratch_x_start__ = .;
*(.scratch_x.*)
. = ALIGN(4);
__scratch_x_end__ = .;
} > SCRATCH_X AT > FLASH
__scratch_x_source__ = LOADADDR(.scratch_x);
.scratch_y : {
__scratch_y_start__ = .;
*(.scratch_y.*)
. = ALIGN(4);
__scratch_y_end__ = .;
} > SCRATCH_Y AT > FLASH
__scratch_y_source__ = LOADADDR(.scratch_y);
.bss : {
. = ALIGN(4);
__bss_start__ = .;
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*)))
*(COMMON)
. = ALIGN(4);
__bss_end__ = .;
} > RAM
.heap (COPY): {
__end__ = .;
end = __end__;
*(.heap*)
__HeapLimit = .;
} > RAM
/* .stack*_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later
*
* stack1 section may be empty/missing if platform_launch_core1 is not used */
/* by default we put core 0 stack at the end of scratch Y, so that if core 1
* stack is not used then all of SCRATCH_X is free.
*/
.stack1_dummy (COPY): {
*(.stack1*)
} > SCRATCH_X
.stack_dummy (COPY): {
*(.stack*)
} > SCRATCH_Y
.flash_end : {
__flash_binary_end = .;
} > FLASH
/* stack limit is poorly named, but historically is maximum heap ptr */
__StackLimit = ORIGIN(RAM) + LENGTH(RAM);
__StackOneTop = ORIGIN(SCRATCH_X) + LENGTH(SCRATCH_X);
__StackTop = ORIGIN(SCRATCH_Y) + LENGTH(SCRATCH_Y);
__StackOneBottom = __StackOneTop - SIZEOF(.stack1_dummy);
__StackBottom = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed")
/* ASSERT( __binary_info_header_end - __logical_binary_start <= 256, "Binary info must be in first 256 bytes of the binary")*/
/* todo assert on extra code */
}

View file

@ -17,6 +17,7 @@
#include "hardware/irq.h"
#include "hardware/gpio.h"
#ifdef PICO_RP2040
// Clock muxing consists of two components:
// - A glitchless mux, which can be switched freely, but whose inputs must be
// free-running
@ -159,6 +160,7 @@ void __wrap_clocks_init(void) {
48 * MHZ,
1 << 8);
#ifdef PICO_RP2040
// CLK RTC = PLL USB (48MHz) / 1024 = 46875Hz
_clock_configure(clk_rtc,
0, // No GLMUX
@ -166,6 +168,7 @@ void __wrap_clocks_init(void) {
48 * MHZ,
46875,
32 << 8);
#endif
// CLK PERI = clk_sys. Used as reference clock for Peripherals. No dividers so just select and enable
// Normally choose clk_sys or clk_usb
@ -176,3 +179,5 @@ void __wrap_clocks_init(void) {
125 * MHZ,
1 << 8);
}
#endif

View file

@ -1,7 +1,7 @@
{
"name": "framework-arduinopico",
"version": "1.30905.0",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040, RP2350)",
"keywords": [
"framework",
"arduino",

View file

@ -11,7 +11,7 @@
"platforms": [
{
"category": "Raspberry Pi Pico",
"name": "Raspberry Pi Pico/RP2040",
"name": "Raspberry Pi Pico/RP2040/RP2350",
"url": "",
"version": "",
"architecture": "rp2040",
@ -23,6 +23,9 @@
{
"name": "Raspberry Pi Pico W"
},
{
"name": "Raspberry Pi Pico 2"
},
{
"name": "0xCB Helios"
},
@ -173,6 +176,12 @@
{
"name": "iLabs RPICO32"
},
{
"name": "iLabs Challenger 2350 WiFi/BLE"
},
{
"name": "iLabs Challenger 2350 BConnect"
},
{
"name": "Melopero Cookie RP2040"
},
@ -227,12 +236,21 @@
{
"name": "Solder Party RP2040 Stamp"
},
{
"name": "Solder Party RP2350 Stamp"
},
{
"name": "Solder Party RP2350 Stamp XL"
},
{
"name": "SparkFun MicroMod RP2040"
},
{
"name": "SparkFun ProMicro RP2040"
},
{
"name": "SparkFun ProMicro RP2350"
},
{
"name": "SparkFun Thing Plus RP2040"
},
@ -286,6 +304,9 @@
},
{
"name": "Generic RP2040"
},
{
"name": "Generic RP2350"
}
],
"toolsDependencies": [
@ -299,11 +320,6 @@
"version": "2.2.0-d04e724",
"name": "pqt-mklittlefs"
},
{
"packager": "rp2040",
"version": "2.2.0-d04e724",
"name": "pqt-elf2uf2"
},
{
"packager": "rp2040",
"version": "2.2.0-d04e724",
@ -337,59 +353,59 @@
"systems": [
{
"host": "arm64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/picotool.macosarm.tar.gz",
"archiveFileName": "picotool.macosarm.tar.gz",
"checksum": "SHA-256:6b9d28dee6f3c67ab705ff1bc9bd96de3fcb7f1d73753a0e802999b408d39011",
"size": "174728"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.picotool-8a9af99.240818.tar.gz",
"archiveFileName": "aarch64-apple-darwin20.4.picotool-8a9af99.240818.tar.gz",
"checksum": "SHA-256:5896d2e71c3a287a5c4d24e6fe8a3144e87bff1ff071d5a2095623f16da64dd7",
"size": "851010"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
"archiveFileName": "aarch64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
"checksum": "SHA-256:3d3aec025f74e146d9d27b3a64604fa271ac6a25dc8bf61855035c75829f55c0",
"size": "179609"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.picotool-8a9af99.240818.tar.gz",
"archiveFileName": "aarch64-linux-gnu.picotool-8a9af99.240818.tar.gz",
"checksum": "SHA-256:e13186190e58b8b71689e80caf7942cdbd4276dae3e9f6197a3ea0c006e1723f",
"size": "896500"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.picotool-f6fe6b7.240125.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.picotool-f6fe6b7.240125.tar.gz",
"checksum": "SHA-256:d2ea134a0dfea2a5d0ab4bc206f1a823e9bff632218e5476b56acbb3f4c99837",
"size": "168619"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.picotool-8a9af99.240818.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.picotool-8a9af99.240818.tar.gz",
"checksum": "SHA-256:1c45155bcd93adc63d740053b55b25310c317ba6a1f4d0ef0cbc8ce52fea565a",
"size": "840251"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
"archiveFileName": "i686-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
"checksum": "SHA-256:56ebf53f6ce0748faca2fc06c05bad9cb8bfcb429f5c4336e56738f344b99e38",
"size": "202882"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.picotool-8a9af99.240818.tar.gz",
"archiveFileName": "i686-linux-gnu.picotool-8a9af99.240818.tar.gz",
"checksum": "SHA-256:81c1492af8859be13f5a276831b566c18e8316d65b493ddc121637301cc37fc9",
"size": "984659"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.picotool-f6fe6b7.240125a.zip",
"archiveFileName": "i686-w64-mingw32.picotool-f6fe6b7.240125a.zip",
"checksum": "SHA-256:75a6672f56972bdc95cd6422a4709c372cd84e08ac07eefd8b1c2842b8617d99",
"size": "291095"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.picotool-8a9af99.240818.zip",
"archiveFileName": "i686-w64-mingw32.picotool-8a9af99.240818.zip",
"checksum": "SHA-256:a9e4d744a431ed4cca41752a5085f583afa3763be6877614061e7810433acb56",
"size": "1884014"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.picotool-f6fe6b7.240125.tar.gz",
"archiveFileName": "x86_64-apple-darwin20.4.picotool-f6fe6b7.240125.tar.gz",
"checksum": "SHA-256:b04fccd0416cfa753d1e2dd431b7bfc24a971819eab255eaec2a3e7d76c5966f",
"size": "167079"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.picotool-8a9af99.240818.tar.gz",
"archiveFileName": "x86_64-apple-darwin20.4.picotool-8a9af99.240818.tar.gz",
"checksum": "SHA-256:2c780bf95fcd5b6a5fc27db70f87a058f4209770febe7435943d153cc811d853",
"size": "826555"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
"archiveFileName": "x86_64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
"checksum": "SHA-256:ba7c3a168fe7813de9645f64f22fbdbf81841412550338df02c0e20701caee66",
"size": "192471"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.picotool-8a9af99.240818.tar.gz",
"archiveFileName": "x86_64-linux-gnu.picotool-8a9af99.240818.tar.gz",
"checksum": "SHA-256:7e1d95abece12a5a05e9c299d9e6f5cc2f944c6ccd16b140e257f4e7ac8edbfa",
"size": "926049"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.picotool-f6fe6b7.240125a.zip",
"archiveFileName": "x86_64-w64-mingw32.picotool-f6fe6b7.240125a.zip",
"checksum": "SHA-256:79a68e3d3d080cacfafc9c1546a3675ce5c7f858e6e85c690584251e63a2bee3",
"size": "276468"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.picotool-8a9af99.240818.zip",
"archiveFileName": "x86_64-w64-mingw32.picotool-8a9af99.240818.zip",
"checksum": "SHA-256:58e050af07a682805bec35a0f7a0df66d98c8e026126f469221326c11b7071aa",
"size": "1774494"
}
]
},
@ -399,59 +415,59 @@
"systems": [
{
"host": "arm64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/openocd.macosarm.tar.gz",
"archiveFileName": "openocd.macosarm.tar.gz",
"checksum": "SHA-256:585128f38286c0026f0c3d3d14aab098282ef0958882226907fefb1824ddd350",
"size": "1877283"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.openocd-ebec9504d.240818.tar.gz",
"archiveFileName": "aarch64-apple-darwin20.4.openocd-ebec9504d.240818.tar.gz",
"checksum": "SHA-256:7327a049b4abb6d944db31eebb72a71ca71beb999fa6cdc44e83fd1dabf253c8",
"size": "1967271"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
"archiveFileName": "aarch64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
"checksum": "SHA-256:470bedcfc7e26006e3789439b7c3806e0ee4e715e28330c4e3a48a19c6efbefa",
"size": "7439489"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.openocd-ebec9504d.240818.tar.gz",
"archiveFileName": "aarch64-linux-gnu.openocd-ebec9504d.240818.tar.gz",
"checksum": "SHA-256:608b3d5a04b36b7a5e85dd63a27dc1c531f19fa0d4410ea7617497c45f05401c",
"size": "7480356"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.openocd-4d87f6dca.240125.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.openocd-4d87f6dca.240125.tar.gz",
"checksum": "SHA-256:d086bfc425829984d9257e5629277ae8eb4dff780ef3e92d292b132764246ed2",
"size": "7256877"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.openocd-ebec9504d.240818.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.openocd-ebec9504d.240818.tar.gz",
"checksum": "SHA-256:08db61afd26571eef18a53b926b5ad617319383c01731d178fc2efc900bda124",
"size": "7335490"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
"archiveFileName": "i686-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
"checksum": "SHA-256:06e97a31d77ed690767eaf579f7be8e295dec4eecbbe504650726631d94379e6",
"size": "6978839"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.openocd-ebec9504d.240818.tar.gz",
"archiveFileName": "i686-linux-gnu.openocd-ebec9504d.240818.tar.gz",
"checksum": "SHA-256:9c54e61c9f7637eab8e3e1cbd2a6f5727759aa0224e1aeeb1a8e46a76ddaa78e",
"size": "7070681"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.openocd-4d87f6dca.240125.zip",
"archiveFileName": "i686-w64-mingw32.openocd-4d87f6dca.240125.zip",
"checksum": "SHA-256:0151d237bb7d4418130346d9296daee2a903bad93ca0fd676db2e0ecc3742b4c",
"size": "2468166"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.openocd-ebec9504d.240818.zip",
"archiveFileName": "i686-w64-mingw32.openocd-ebec9504d.240818.zip",
"checksum": "SHA-256:a103dbecfdaca5a6e582f832bd3a017769f14774f78a30e83097fe78987e8be8",
"size": "3577537"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.openocd-4d87f6dca.240125.tar.gz",
"archiveFileName": "x86_64-apple-darwin20.4.openocd-4d87f6dca.240125.tar.gz",
"checksum": "SHA-256:c37f3f1222b2b5614d09a08ed820a27f79be78daa699884abfa26da9f96b2126",
"size": "3083387"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.openocd-ebec9504d.240818.tar.gz",
"archiveFileName": "x86_64-apple-darwin20.4.openocd-ebec9504d.240818.tar.gz",
"checksum": "SHA-256:2be716a12ca7ea0c036e2a10f89c191426f7e1c71a9cca78fbb3f8911b1df35d",
"size": "3165595"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
"archiveFileName": "x86_64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
"checksum": "SHA-256:cf7163e0c3981cd1025a3eba64dda1ea02cc8042f340ae2740c89c1048b55f20",
"size": "7454235"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.openocd-ebec9504d.240818.tar.gz",
"archiveFileName": "x86_64-linux-gnu.openocd-ebec9504d.240818.tar.gz",
"checksum": "SHA-256:dbaeaa695359fcac00b6e5aa3b26e9c5880c66b14c110a98d931b4f29dd0de7a",
"size": "7501850"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.openocd-4d87f6dca.240125.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-4d87f6dca.240125.zip",
"checksum": "SHA-256:a15ba6f4a8054ca787c5ec47ce9a866b033667bbbf3dcbd0941a55539b2fbe37",
"size": "2412178"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.openocd-ebec9504d.240818.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-ebec9504d.240818.zip",
"checksum": "SHA-256:782d0e955990a03380fa681deaf4a5faf406f4a3fddecb27f71bd2be060d904d",
"size": "3456434"
}
]
},
@ -586,68 +602,6 @@
}
]
},
{
"version": "2.2.0-d04e724",
"name": "pqt-elf2uf2",
"systems": [
{
"host": "arm64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.elf2uf2-6a7db34.240127.tar.gz",
"archiveFileName": "aarch64-apple-darwin20.4.elf2uf2-6a7db34.240127.tar.gz",
"checksum": "SHA-256:3fb12aa0d39bb03520a46ff5e3d0dbd0eb0df31843056f5dcd8b6fffa1d7ff86",
"size": "30084"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
"archiveFileName": "aarch64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
"checksum": "SHA-256:b8ab83714f963dd42164ff1093a02822d63a2825fc04ac395f5ce9c98224fc6a",
"size": "85433"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.elf2uf2-6a7db34.240125.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-6a7db34.240125.tar.gz",
"checksum": "SHA-256:027de6742745bd27bb79e98563da95fc72f7aad28af19d2893e40b14602b3e99",
"size": "59530"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
"archiveFileName": "i686-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
"checksum": "SHA-256:b8ab8cf6fe09a6ce0c30861ded3e88c785cec06f1b3ccb888522ba6da8fc3220",
"size": "96835"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.elf2uf2-6a7db34.240125.zip",
"archiveFileName": "i686-w64-mingw32.elf2uf2-6a7db34.240125.zip",
"checksum": "SHA-256:80c2b269d50475f0bcc518b3cc08d3ee639470603912bc17fbcd695efb5ac825",
"size": "73951"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.elf2uf2-6a7db34.240125.tar.gz",
"archiveFileName": "x86_64-apple-darwin20.4.elf2uf2-6a7db34.240125.tar.gz",
"checksum": "SHA-256:3d3e47d70981b852e553e1250b90c5442320232952f18d4a74ca87ff14a55ea7",
"size": "106528"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
"archiveFileName": "x86_64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
"checksum": "SHA-256:ba9cbfa2b6a46ced939b7c02f2c21f923cfb98228468634618e4a1ea2e4f10a1",
"size": "86035"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.elf2uf2-6a7db34.240125.zip",
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-6a7db34.240125.zip",
"checksum": "SHA-256:8bd4440c8a0a5102235377ab3437d75324e7cfa58aa69bbce24c5dff29f5947d",
"size": "81681"
}
]
},
{
"version": "2.2.0-d04e724",
"name": "pqt-pioasm",

View file

@ -1,6 +1,6 @@
# Copyright (c) 2021 Earle F. Philhower, III
#
# Raspberry Pi RP2040 Core platform file
# Raspberry Pi RP2040/R2350 Core platform file
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -19,7 +19,7 @@
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Raspberry Pi RP2040 Boards
name=Raspberry Pi RP2040/RP2350 Boards
version=3.9.5
# Required discoveries and monitors
@ -48,33 +48,33 @@ compiler.warning_flags.default=-Werror=return-type -Wno-psabi
compiler.warning_flags.more=-Wall -Werror=return-type -Wno-ignored-qualifiers -Wno-psabi
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualifiers -Wno-psabi -Wno-unused-parameter -Wno-missing-field-initializers
compiler.netdefines=-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_LWIP=1 {build.libpicowdefs} -DLWIP_IGMP=1 -DLWIP_CHECKSUM_CTRL_PER_NETIF=1
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 {build.usbpid} {build.usbvid} {build.usbpwr} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' {compiler.netdefines} -DARDUINO_VARIANT="{build.variant}" -DTARGET_RP2040 -DPICO_FLASH_SIZE_BYTES={build.flash_total} -DPICO_RP2040=1
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt" "-I{runtime.platform.path}/include"
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect} {build.flags.cmsis} {build.picodebugflags}
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
compiler.libbearssl="{runtime.platform.path}/lib/libbearssl.a"
compiler.netdefines={build.libpicowdefs} -DLWIP_IGMP=1 -DLWIP_CHECKSUM_CTRL_PER_NETIF=1
compiler.defines={build.led} {build.usbstack_flags} {build.usbpid} {build.usbvid} {build.usbpwr} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' {compiler.netdefines} -DARDUINO_VARIANT="{build.variant}" -DPICO_FLASH_SIZE_BYTES={build.flash_total} "@{runtime.platform.path}/lib/{build.chip}/platform_def.txt"
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/{build.chip}/platform_inc.txt" "@{runtime.platform.path}/lib/core_inc.txt" "-I{runtime.platform.path}/include"
compiler.flags={build.toolchainopts} -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect} {build.picodebugflags}
compiler.wrap="@{runtime.platform.path}/lib/{build.chip}/platform_wrap.txt" "@{runtime.platform.path}/lib/core_wrap.txt"
compiler.libbearssl="{runtime.platform.path}/lib/{build.chip}/libbearssl.a"
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.cmd={build.toolchain}-gcc
compiler.c.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} -MMD {compiler.includes} -std=gnu17 -g -pipe
compiler.c.elf.cmd=arm-none-eabi-g++
compiler.c.elf.cmd={build.toolchain}-g++
compiler.c.elf.flags={compiler.warning_flags} {compiler.defines} {compiler.flags} {build.flags.optimize} -u _printf_float -u _scanf_float
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-c {compiler.warning_flags} -g -x assembler-with-cpp -MMD {compiler.includes} -g {build.flags.cmsis}
compiler.cpp.cmd=arm-none-eabi-g++
compiler.S.cmd={build.toolchain}-gcc
compiler.S.flags=-c {compiler.warning_flags} {compiler.defines} -g -x assembler-with-cpp -MMD {compiler.includes} -g
compiler.cpp.cmd={build.toolchain}-g++
compiler.cpp.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} -MMD {compiler.includes} {build.flags.rtti} -std=gnu++17 -g -pipe
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.cmd={build.toolchain}-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.objcopy.cmd={build.toolchain}-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.bin.flags=-O binary
compiler.elf2hex.hex.flags=-O ihex -R .eeprom
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.elf2hex.cmd={build.toolchain}-objcopy
compiler.ldflags={compiler.wrap} -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--undefined=runtime_init_install_ram_vector_table
compiler.size.cmd=arm-none-eabi-size
compiler.size.cmd={build.toolchain}-size
compiler.define=-DARDUINO=
compiler.readelf.cmd=arm-none-eabi-readelf
compiler.readelf.cmd={build.toolchain}-readelf
# this can be overridden in boards.txt
build.extra_flags=
@ -90,18 +90,18 @@ compiler.elf2hex.extra_flags=
# Board configuration, set in boards.txt. Present here to ensure substitution works
build.flash_total=
build.flash_length=
build.psram_length=0
build.eeprom_start=
build.flags.optimize=-Os
build.flags.rtti=-fno-rtti
build.fs_start=
build.fs_end=
build.usbstack_flags=
build.flags.cmsis=-DARM_MATH_CM0_FAMILY -DARM_MATH_CM0_PLUS
build.flags.libstdcpp=-lstdc++
build.flags.exceptions=-fno-exceptions
build.flags.stackprotect=
build.libpico=libpico.a
build.libpicow=libpicow-noipv6-nobtc-noble.a
build.libpicow=libpipv4.a
build.boot2=boot2_generic_03h_4_padded_checksum
build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1
build.wificc=-DWIFICC=CYW43_COUNTRY_WORLDWIDE
@ -136,16 +136,16 @@ archive_file_path={build.path}/{archive_file}
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Generate the linker map with specific flash sizes/locations
recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3" -I "{runtime.platform.path}/tools/simplesub.py" --input "{runtime.platform.path}/lib/memmap_default.ld" --out "{build.path}/memmap_default.ld" --sub __FLASH_LENGTH__ {build.flash_length} --sub __EEPROM_START__ {build.eeprom_start} --sub __FS_START__ {build.fs_start} --sub __FS_END__ {build.fs_end} --sub __RAM_LENGTH__ {build.ram_length}
recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3" -I "{runtime.platform.path}/tools/simplesub.py" --input "{runtime.platform.path}/lib/{build.chip}/memmap_default.ld" --out "{build.path}/memmap_default.ld" --sub __FLASH_LENGTH__ {build.flash_length} --sub __EEPROM_START__ {build.eeprom_start} --sub __FS_START__ {build.fs_start} --sub __FS_END__ {build.fs_end} --sub __RAM_LENGTH__ {build.ram_length} --sub __PSRAM_LENGTH__ {build.psram_length}
## Compile the boot stage 2 blob
recipe.hooks.linking.prelink.2.pattern="{compiler.path}{compiler.S.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -c "{runtime.platform.path}/boot2/{build.boot2}.S" "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" -o "{build.path}/boot2.o"
recipe.hooks.linking.prelink.2.pattern="{compiler.path}{compiler.S.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -c "{runtime.platform.path}/boot2/{build.chip}/{build.boot2}.S" "-I{runtime.platform.path}/pico-sdk/src/{build.chip}/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" -o "{build.path}/boot2.o"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.ldflags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" -Wl,--no-warn-rwx-segments -Wl,--start-group {object_files} "{build.path}/{archive_file}" "{build.path}/boot2.o" "{runtime.platform.path}/lib/ota.o" {compiler.libraries.ldflags} "{runtime.platform.path}/lib/{build.libpico}" "{runtime.platform.path}/lib/{build.libpicow}" {compiler.libbearssl} -lm -lc {build.flags.libstdcpp} -lc -Wl,--end-group
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.ldflags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" -Wl,--no-warn-rwx-segments -Wl,--start-group {object_files} "{build.path}/{archive_file}" "{build.path}/boot2.o" "{runtime.platform.path}/lib/{build.chip}/ota.o" {compiler.libraries.ldflags} "{runtime.platform.path}/lib/{build.chip}/{build.libpico}" "{runtime.platform.path}/lib/{build.chip}/{build.libpicow}" {compiler.libbearssl} -lm -lc {build.flags.libstdcpp} -lc -Wl,--end-group
## Create output (UF2 file)
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-picotool.path}/picotool" uf2 convert "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2" {build.uf2family}
## Create output BIN (for OTA)
recipe.objcopy.bin.1.pattern="{compiler.path}/{compiler.objcopy.cmd}" -Obinary "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
@ -168,11 +168,11 @@ recipe.size.regex.data=^(?:\.data|\.bss|\.ram_vector_table|\.uninitialized_ram|\
debug.executable={build.path}/{build.project_name}.elf
debug.toolchain=gcc
debug.toolchain.path={runtime.tools.pqt-gcc.path}/bin/
debug.toolchain.prefix=arm-none-eabi-
debug.toolchain.prefix={build.toolchain}-
debug.server=openocd
debug.server.openocd.path={runtime.tools.pqt-openocd.path}/bin/openocd
debug.server.openocd.scripts_dir={runtime.tools.pqt-openocd.path}/share/openocd/scripts/
debug.server.openocd.script={runtime.platform.path}/lib/{build.debugscript}
debug.server.openocd.script={runtime.platform.path}/lib/{build.chip}/{build.debugscript}
@ -202,14 +202,14 @@ tools.picotool.cmd={runtime.platform.path}/system/picotool
tools.picotool.upload.protocol=picotool
tools.picotool.upload.params.verbose=
tools.picotool.upload.params.quiet=
tools.picotool.upload.pattern="{cmd}/picotool" load "{build.path}/{build.project_name}.uf2" -f
tools.picotool.upload.pattern="{cmd}/picotool" load "{build.path}/{build.project_name}.uf2" -f -x
#tools.picoprobe_cmsis_dap.cmd={runtime.tools.pqt-openocd.path}
tools.picoprobe_cmsis_dap.cmd={runtime.platform.path}/system/openocd
tools.picoprobe_cmsis_dap.upload.protocol=picoprobe_cmsis_dap
tools.picoprobe_cmsis_dap.upload.params.verbose=
tools.picoprobe_cmsis_dap.upload.params.quiet=
tools.picoprobe_cmsis_dap.upload.pattern="{cmd}/bin/openocd" -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "adapter speed 5000" -c "program {{build.path}/{build.project_name}.elf} verify" -c "reset init" -c "resume" -c "exit"
tools.picoprobe_cmsis_dap.upload.pattern="{cmd}/bin/openocd" -f "interface/cmsis-dap.cfg" -f "target/{build.chip}.cfg" -s "{cmd}/share/openocd/scripts" -c "init; adapter speed 5000; program {{build.path}/{build.project_name}.elf} verify; reset; exit"
#tools.picodebug.cmd={runtime.tools.pqt-openocd.path}
tools.picodebug.cmd={runtime.platform.path}/system/openocd

24
tests/build-rp2350.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
cache_dir=$(mktemp -d)
source "$GITHUB_WORKSPACE"/tests/common.sh
if [ -z "$BUILD_PARITY" ]; then
mod=1
rem=0
elif [ "$BUILD_PARITY" = "even" ]; then
mod=2
rem=0
elif [ "$BUILD_PARITY" = "odd" ]; then
mod=2
rem=1
fi
export FQBN=pico:rp2040:rpipico2:flash=4194304_0,freq=150,opt=Small,rtti=Disabled,stackprotect=Disabled,exceptions=Disabled,dbgport=Disabled,dbglvl=None,usbstack=picosdk,ipbtstack=ipv4only,uploadmethod=default
export PICO_BOARD=rp2350
install_arduino nodebug
build_sketches_with_arduino "$mod" "$rem" ""
rm -rf "$cache_dir"

View file

@ -15,6 +15,8 @@ elif [ "$BUILD_PARITY" = "odd" ]; then
rem=1
fi
export PICO_BOARD=rp2040
install_arduino nodebug
build_sketches_with_arduino "$mod" "$rem" ""

View file

@ -5,6 +5,27 @@ function skip_ino()
{
local ino=$1
local skiplist=""
local skiplistrp2350=""
if [ "$PICO_BOARD" == "rp2350" ]; then
read -d '' skiplistrp2350 << EOL || true
/FreeRTOS/
/BTstackLib/
/JoystickBT/
/KeyboardBT/
/MouseBT/
/SerialBT/
/ArduinoBLE/
/JoystickBLE/
/KeyboardBLE/
/MouseBLE/
/BluetoothAudio/
/BluetoothHCI/
/BluetoothHIDMaster/
/HID_Bluetooth/
/lwIP_ESPHost/
/lwIP_WINC1500/
EOL
fi
# Add items to the following list with "\n" netween them to skip running. No spaces, tabs, etc. allowed
read -d '' skiplist << EOL || true
/#attic/
@ -26,6 +47,7 @@ function skip_ino()
/PDMSerialPlotter/
/debug/
/BackwardCompatibility/
$skiplistrp2350
EOL
echo $ino | grep -q -F "$skiplist"
echo $(( 1 - $? ))

View file

@ -17,7 +17,7 @@ for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S ./libraries/SingleF
./libraries/SPISlave ./libraries/lwIP_ESPHost ./libraries/FatFS\
./libraries/FatFSUSB ./libraries/BluetoothAudio ./libraries/BluetoothHCI \
./libraries/BluetoothHIDMaster ./libraries/NetBIOS ./libraries/Ticker \
./libraries/VFS; do
./libraries/VFS ./libraries/rp2350; do
find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" \) -a \! -path '*api*' -exec astyle --suffix=none --options=./tests/astyle_core.conf \{\} \;
find $dir -type f -name "*.ino" -exec astyle --suffix=none --options=./tests/astyle_examples.conf \{\} \;
done

View file

@ -58,6 +58,9 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args):
cmd += ['-hardware', hw_dir]
else:
cmd += ['-hardware', hardware_dir]
if os.environ.get('FQBN'):
fqbn = "-fqbn=" + str(os.environ.get('FQBN'))
else:
# Debug=Serial,DebugLevel=Core____
fqbn = '-fqbn=pico:rp2040:rpipico:' \
'flash=2097152_65536,' \

View file

@ -34,7 +34,7 @@
],
"name": "Helios",
"upload": {
"maximum_ram_size": 270336,
"maximum_ram_size": 262144,
"maximum_size": 16777216,
"require_upload_port": true,
"native_usb": true,

Some files were not shown because too many files have changed in this diff Show more