Moves to just released GCC 14.3
Moves to full-fat printf/scanf because Newlib no longer supports all the
calls libstdc++ requires with the older, smaller, nano-formatted-io option.
Moves to latest SDK develop branch with important float acceleration fixes
for the RP2350, among other updates.
Moves to latest pioasm, picotool develop branches
* SDK was refactored, update the includes
* Rebuild PicoSDK and BearSSL libs
* Update certs in BSSL validation example
* Don't spell check the certs!
* Updated tools with full fat++ newlib printf/scanf
* Remove Pico-SDK C++ exception-override new/delete
We support exceptions on and off, but the cxx_options file in the
SDK implemented a single override to new/delete.
Remove it so we will use GCC's build-in operator new/delete
which will be correct for either option (2 different libstdc++
versions are shipped as part of the toolchain).
* Remove duplicated SDK files
The SDK will link in the same compilation unit in the LWIP builds.
Remove them to shrink the repo size by ~28MB.
Pico-SDK changed the output extension of their compilation from "x.c.obj"
to "x.c.o" meaning the removed Newlib and STDIO SDK wrappers were still
being linked in certain situations. Update make-libpico Cmakefile to
remove the new names.
Fixes debug `printf` output.
Using pico-sdk develop branch, add in support for CYW43-based
WiFi/BT/BLE boards on the RP2350 such as the
SparkFun Thing Plus RP2350 or the Pimoroni Pico Plus 2W.
Fixes#2608
Rolls in dynamic SPI divider #2600
* Support LED digitalWrite on RP2350+CYW
Also move "special GPIO" to 64 since the Pimoroni Pico 2W uses the
RP2350B with 48 GPIOs.
* Enable CYW43_PIN_WL_DYNAMIC in IDE and P.IO
Allows calling `cyw43_set_pins_wl(cyw43_pin_array);` to redefine the
CYW43 hookup in the variant initialization.
* Enable LWIP IGMP, MDNS internal server
* Enable MDNS lookup from LWIP DNS
* Add SimpleMDNS responder, small code and no malloc
* Ensure we copy out lwipopts in make-libpico
Adds a small wrapper around the LWIP-provided MDNS responder application.
Drop-in replacement in many basic cases for LEAmDNS.
For FreeRTOS it is important to not allocate memory on an LWIP callback.
LEAmDNS needs to do this to create response objects, leading to crashes.
Increase LWIP timers by bumping the LWIP_ARP number (as done before).
Replace ArduinoOTA LEAmDNS with SimpleMDNS and update a
HTTPUpdateServer example.
* Adds RISC-V compilation option to the IDE and Platform.IO.
* Build RP2350-RISCV libpico, libbearssl
* Fix RP2350 BearSSL library (was copied from RP2040, now built for M33)
* New GCC 14.2 toolchain is required (12.4 RISC-V support is borked)
* Newlib locking fixed prototypes
* Manually force all runtime init code into RP2350 binaries
* Add RISC-V to CI
* Remove RP2350 BOOT2.S files, binaries (not used)
* Clean up minor GCC 14.x warnings
* Add RP2350-RISCV OTA build, link
* Add RISC-V FreeRTOS files (configuration still not running, but builds)
* Add basic documentation
Split the 1300+ char define-setting line into a multi-line value.
Makes it more maintainable and easier to see when changes needed.
No settings should have been modified.
* Add support for the extra 16 GPIO pins in the menus and core.
* Clean up Generic RP2350 PSRAM ("none" is valid) and flash (other than 16MB) options.
* Add extra GPIO<->peripheral connections
* Add Pimoroni PGA2350 RP2350B-based board
* Pins 32-47 can be used for PIOPrograms
* Avoid hang when PSRAM fails to initialize
* Move libpico to an RP2350B board for SDK (otherwise the SDK drops all GPIOHI support)
* 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
* Update to 2.0.0 SDK
* Board type needs to be set before earliest SDK setup
* Platform includes update
* Boot2 files
* Simple compilation issues
* Build and link
* PIO rebuild with version
* Newlib wrapper update
* Force inclusion of runtime_init_* fcns
The linker was dropping all references to the library's included
runtime_init_xxx functions and hence things like the IRQ vector
table and mutexes and alarms weren't properly set up leading to
instant crashes on start up..
Explicitly call out one function from the object file stored in
the .A to force the inclusion of all the functions. May be a better
way, heppy to hear any ideas.
* Fix SPI GPIO calls
* Fix Ethernet GPIO
* Remove SDK warnings
Remove the skipped error messages once the following PR merged:
https://github.com/raspberrypi/pico-sdk/pull/1786
* BTStack moved SBC encode/decode paths
* Platform.IO fixes
* BT No longer has special absolute mouse
* Rebuild and update OTA
* Rebuild BearSSL, too
* Update liker file to latest SDK
* Clean up libpicocmake
* Clean up LWIP/BT library names
Add a "-32K" option to all the IP stack options that doubles the PCB and memory
pools from default. For most use cases this is not necessary, but it could be
helpful in cases where large numbers of TCP clients are connected or high
bandwidth applications.
Fixes#2050
Adds a library to run classic Bluetooth A2DP source (output) audio from
the PicoW. Simple example showing operation and callbacks.
Factor out multiple BT lock/unlock and place in the PicoW variant files.
Use -O2 only on the LWIP checksum routine, resulting in a speedup of
around 13% (checksumming only, not entire LWIP stack) for 72 add'l bytes
of flash.
Avoid issues with interrupts and priority inversions and other deadlocks
and use a SW based random generator for LWIP when under FreeRTOS.
This means removing any overrides for sleep_until and the two
get_rand_xx calls from the SDK, making things much saner.
Related to #1883, #1872, and other random FreeRTOS lockups.
* Update to Pico-SDK v1.5
* Hook in pico_rand, use ioctl to set ipv6 allmulti
* Move into PicoSDK LWIP mutex, hack timer sizes
* Utilize much of the PicoSDK infrastructure for WiFi
* Add WiFi::begin(ssid, pass, bssid)
* WiFiMulti to use BSSID, make more robust
WiFiMulti will now be more aggressive and try all matching SSIDs, in order
of RSSI, using the BSSID to identify individual APs in a mesh.
Before, if the highest RSSI AP didn't connect, it would fail immediately.
Now, it will go down the list, ordered by RSSI, to attempt to get a link.
* Add Bluetooth support from Pico-SDK
Able to build and run the HID Keyboard Demo from the Arduino IDE, almost
as-is.
Will probably need to make BT configurable. Enabling BT on a plain WiFi
sketch uses 50KB of flash and 16KB of RAM even if no BT is used.
* Separate picow libs, BT through menus, example
Build normal Pico.a and 4 different options for PicoW IP/BT configuration.
Use IP=>IP/Bluetooth menu to select between options.
* CMakefile rationalization
* Move BT TLV(pairing) out of last 2 flash sectors
The pairing keys for BT are stored at the end of flash by default, but
we use the last sector of flash for EPROM and the penultimate one for
the filesystem. Overwriting those in BT could cause some real exciting
crashes down the line.
Move the store to an app-build specific address using a dummy const
array to allocate space in the application image itself.
* PicoBluetoothHID with BT Mouse, Joystick, Keyboard
Add simple Bluetooth Classic HID helper function and port the existing
USB HID devices to it. Port their examples.
* Protect BT key storage from multicore
* Add short-n-sweet Bluetooth documents
* Add Bluetooth Serial port library
* Turn off BT when the BT libraries exit
SingleFileDisk allows for exporting a file from the onboard LittleFS
filesystem to a PC through an emulated FAT drive when connected. The
PC can open and copy the file, as well as delete it, but the PC has no
access to the main onboard LittleFS and no actual on-flash FAT
structures are used.
This is handy for things like data loggers. They can run connected to
USB power for some time, and then connected to a PC to dowmload the CSV
log recorded.
It's almost 2023, allow LFN (long file names) on the emulated USB disk.
Reduce the disk buffer size to 64 bytes. The buffer is statically
allocated so it's always present, even in non-USB disk mode, meaning
all apps will pay the RAM price for it. 64 bytes is slower to read
but works and saves ~1/2KB of heap for all apps.
Random crashes, infinite loops, and other lockups were happening to the PicoW
while under high load from multiple clients.
This seems to have been due to two issues:
* The periodic sys_check_timeouts() call from an alarm/IRQ was happening while
the core was in LWIP code. LWIP is not re-entrant or multi-core/thread safe
so this is a bad thing. Some calls may not have been locked with a manual
addition of the LWIPMutex object to hit this.
* The WiFi driver supplies packet data during an interrupt. PBUF work is
legal in an interrupt, but actually calling netif->input() from an IRQ to
queue up the Ethernet packet for processing is illegal if LWIP is already
in progress.
Rearchitect the LWIP interface to fix these problems:
* Disable interrupts during malloc/etc. to avoid the possibility of the
periodic LWIP timeout check interrupting and potentially calling user
code which did a memory operation
* Wrap all used LWIP calls to note LWIP code will be executing, instead of
manually eyeballing and adding in protection in user code.
* Remove all user code LWIPMutex blocking, the wrapping takes care of it.
* When an Ethernet packet is received by interrupt and we're in LWIP code,
just throw the packet away for now. The upper layers can handle retransmit.
(A possible optimization would be to set the packet aside and add a
housekeeping portion to the LWIP wrappers to netif->input() them when safe).
* Ignore callbacks during TCP connection teardown when the ClientContext
passed from LWIP == nullptr
Because OTA has changed the flash map from standard, picotool ends up
crashing or hanging while trying to operate on the current built files.
Remove the binary_info calls and structures completely to avoid any
issue.
Fixes#803
* Apply @oddstr13 multicast patch to cyw43 driver
* Initial work for enabling IPv6
* Allow accessing CYW43 stats when LWIP_SYS_CHECK_MS is not set
* Use cyw43_set_allmulti to allow receiving multicast
* Add tools/libpico/build to gitignore
Co-authored-by: Odd Stråbø <oddstr13@openshell.no>
The send buffers are set to 8 * MSS = ~11.5K. MEM_SIZE is now set to
be larger than that, 16K, in order to help avoid having tcp_write fail
with ENOMEM. The attempt to use a smaller size is still included, which
will allow a tcp_write of up to 16 * 16K = 256K, i.e. all of memory.
Fixes#725
Increases the MEM_SIZE outstanding write buffer to 8K
Allows the ClientContext to attempt to send smaller buffer chunks in the
case where MEM_SIZE won't allow the full tcp_sndbuf() transfer.
Fixes#725
IPv4-only mode saves 20KB+ of flash memory.
Add some backwards compatibility with the global Arduino Ethernet
class when running in IPv4 only mode.
Fixes#687
* Speed P.IO build by not cloning 2GB of sources
* Document P.IO new option
* Add support for the WiFi chip on the Pico W board.
* USB interrupt now no longer hard coded (conflicted with the WiFi IRQ).
* Add in Pico W board to makeboards.py
* Add in GPIO and variant support
* Initialize WiFi in the Variant
* Use manual LWIP, fix size accounting
* Remove the SDK WiFi overrides
* Pulling in work done in the ESP8266 core.
* Make IPAddress support IPv6
* Build LWIP with IPv4 and IPv6 support
* Use proper MAC
* Avoid cyw_warn crash. Make macro to a comment while building
* Add WiFiServer
* Add WiFiUdp
* Move LWIP-specific support files to LWIP_Ethernet
* Add WiFi::ping (ICMP ping)
* Move ICMP echo (ping) to LWIPIntfDev
* Move hostByName to LwipIntfDev
* Add AP mode with simple DHCP server
* Add some examples and basic ESP8266 compat hacks
* Update Adafruit TinyUSB to fix crash
* Set DHCP hostname
* Make Wifi.begin() return CONNECTED with link + IP
* Return connected() on WiFi::begin
* Fix spurious TCP retransmission
* Protect LWIP from reentrancy
The Pico SDK calls "sys_check_timeouts() from inside a periodic interrupt.
This appears unsafe, as the interrupt could happen while already in the
(non-reentrant) LWIP code.
Block the interrupt from calling sys_check_timeouts by using a global flag
manually set via an RAII recursive lock.
Add interrupt protection macros around critical sections inside LWIP via
the standard defines.
These two changes should make LWIP significantly more stable and long
running.
* Support disconnecting and reconnecting WiFi
* Add WiFiServer simple example
* Update documentation
Fixes#666Fixed#665
Remove MIDI support from the core's main TinyUSB. MIDI is still supported
using the Adafruit TinyUSB library, just like before (the core never
did use it).
Compile the Pico-SDK using `-Os`
Remove unneeded warning in UF2 upload
Blink.ino shows a savings of 3.5KB flash and 400 bytes of RAM.
For comparison, with this PR blink.ino reports:
````
Sketch uses 49908 bytes (3%) of program storage space. Maximum is 1568768 bytes.
Global variables use 7024 bytes (2%) of dynamic memory, leaving 255120 bytes for local variables. Maximum is 262144 bytes.
````
As comparison, using the MBED core blink.ino reports:
````
Sketch uses 78882 bytes (0%) of program storage space. Maximum is 16777216 bytes.
Global variables use 42780 bytes (15%) of dynamic memory, leaving 227556 bytes for local variables. Maximum is 270336 bytes.
````
So, with this PR we use **37% less flash** and and **87% less RAM**
for simple sketches.
Fixes#348
Add the RTC header path in the SDK to the Arduino build path. Also add
pico_utils to the libpico.a for the datetime_to_str call.
Note that the pico_sdk has a bug in the datetime.h header so you need to
manually bracket the include file as "C":
extern "C" {
#include "pico/util/datetime.h"
}
Use the 24-bit SYSTICK peripheral, wrapped in logic to extend it to a
full 32 or 64bits. W/o the wrapper, SYSTICK will wrap around in ~100ms.
Adds rp2040.getCycleCount() and rp2040.getCycleCount64()
Clean up the libpico build process as crt0.S from the pico-sdk should
be directly used.
Clean up the keywords file.