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
* Add HTTP-parser lib to support ESP32 WebServer
* Add WebServer from ESP32. Only supports HTTP
* Separate HTTP server from the network server
Instead of managing the WiFiServer/WiFiServerSecure in the same object
as the HTTP handling, split them into separate objects. This lets
HTTP and HTTPS servers work without templates or duplicating code.
The HTTP block just gets a `WiFiClient*` and works with that to only
do HTTP processing, while the upper object handles the appropriate
server and client types.
* Add HTTPS server
* Clean up some THandlerFunction refs
* Refactor into a template-ized WebServer/WebServerSecure
* Add DNSServer examples which need WebServer
* Fix CoreMutex infinite recursion crash
Core could crash while Serial debugging was going on and prints were
happening from LWIP/IRQ land and the main app.
* Add HTTPUpdateServer(Secure)
* Add MIME include, optimize WebServer::send(size,len)
When send()ing a large buffer, the WebServer::send() call would
actually convert that buffer into a String (i.e. duplicate it, and
potential issues with embedded \0s in binary data).
Make a simple override to send(size, len) to allow writing from the
source buffer instead.
* Fix WiFiClient::send(Stream), add FSBrowser example
Adds a 12K OTA stub 3rd stage bootloader, which reads new firmware
from the LittleFS filesystem and flashes on reboot.
By storing the OTA commands in a file in flash, it is possible to
recover from a power failure during OTA programming. On power
resume, the OTA block will simply re-program from the beginning.
Support cryptographic signed OTA updates, if desired. Includes
host-side signing logic via openssl.
Add PicoOTA library which encapsulates the file format for
the updater, including CRC32 checking.
Add LEAmDNS support to allow Arduino IDE discovery
Add ArduinoOTA class for IDE uploads
Add MD5Builder class
Add Updater class which supports writing and validating
cryptographically signed binaries from any source (http,
Ethernet, WiFi, Serial, etc.)
Add documentation and readmes.
* 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
Minor change to keep the core all CPP. Patch just made it into pico-sdk
develop branch allowing recursive mutexes to be auto_init in C++.
Update and rebuild libpico.a.
Instead of wrapping the memory functions in the link stage, rebuild
Newlib and enable retargetable locks. Override the weak definitions
in the libc.a with our own, SDK based ones.
The wrapping utilized before catches app-level memory allocations
but misses allocations inside Newlib libc (like printf/etc.).
Each core needs its own _impure_ptr or else crashes like the one seen
in parallel printf_floats can happen. Enable it in the toolchain
build and implement a simple swapper here.
FreeRTOS SMP doesn't support Newlib's dynamic reent which is needed
to allow save MT support. Minor patch to FreeRTOS and update the
FreeRTOS variant.cpp and setup to support it.
The realloc() wrapper was included in the develop branch of pico-sdk, so
use it instead of a local, unreproducible version of the SDK.
Should have no effect on code.
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.
This PR includes a pico-sdk built using the fix in
https://github.com/raspberrypi/pico-sdk/pull/864
To properly fix it requires a new pico-sdk release. but until then I am
building against my own fork of pico-sdk and including the binary.
When 1.3.2 is out (and assuming my PR is approved) I'll update the pico-sdk
link.
Fixes#614
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"
}
* update included tinyusb to 1.2.0
move tusb_config.h from core to library for more portability
* pump tinyusb
* update tinyusb to 1.3.0
* try to fix ci warning
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.
GCC 10.2 has a bug which causes Windows to rebuild every library on every
compile, instead of caching the first results.
Upgrade to GCC 10.3 which has this fixed.
Add proper OpenOCD executables for non-Linux x86_64 archs.
Update pico-sdk to 1.1.2
Add methods to block the opposite core while doing flash updates.
Ensure opposite core is stopped in LittleFS and EEPROM while doing
flash updates.
Update documentation with new calls.
The SDK would assert if a flash write/erase happened past the end of the
flash space it was built with. So, 8MB chips would crash when accessing
offset 3MB, for example.
Avoid this by specifying the maximum flash available so the SDK won't
trip.
Fixes#76
Build all 4 different boot_stage2 objects with SPI/2 and SPI/4 options.
Add a menu to the generic board to allow selecting between them.
Use the potato/4 boot2 for the Adafruit Feather until we have a better
version verified.
Fixes#42
Add support for Adafruit Feather RP2040 (8MB). Identified with a unique
USB PID so it displays properly once programmed one time. Moved LED to
pin 13 (per the website docs), but have no board to test.
Add over/underclocking menus, applied at boot. Use at your own risk, as
usual.
Add shims to allocate flash space for a filesystem (but not implemented
yet).
Add a "generic" RP2040 board