Instead of listing each board three times (normal upload, picoprobe,
and pico-debug uploads), list each board once and use a menu to select
the actual upload method.
Also add in picotool as an upload method for those folks who have trouble
with automounting.
Fix#1111
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.
When receiving a `QUIT` message, the main thread was trying to tell
the scanner thread to quit - however, what it was actually doing was
creating a local variable that shadowed the global flag used by the
scanner thread. Fix that by ensuring that the main thread uses the
global variable instead.
Fixes#1028
* add rough for scorpio
* Add SCORPIO items from ladyada
* Change PID in makeboards.py instead of boards.txt
* Fix PID in scorpio JSON
* README: Add Feather SCORPIO to supported boards
* Fix PIDs using values from MBAdafruitBoards
Still unsure about pid.[1-7] but let's see what happens
* boards.txt fixed by running makeboards.py
Co-authored-by: lady ada <limor@ladyada.net>
A new flexible and powerful "pluggable discovery" system was added to the Arduino boards platform framework. This system
makes it easy for Arduino boards platform authors to use any arbitrary communication channel between the board and
development tools.
Boards platform configurations that use the old property syntax are automatically translated to the new syntax by
Arduino CLI:
https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-upload-configuration
> For backward compatibility with IDE 1.8.15 and older the previous syntax is still supported
This translation is only done in platforms that use the old syntax exclusively. If `pluggable_discovery` properties are
defined for the platform then the new pluggable discovery-style `upload.tool.<protocol_name>` properties must be defined
for each board as well.
This platform includes a "UF2 Devices" discovery tool for `uf2conv` protocol ports. This tool now uses the modern
Arduino pluggable discovery system. `pluggable_discovery` properties were added to `platform.txt` in order to configure
the Arduino development tools to use this pluggable discovery tool. The `upload.tool.<protocol_name>` properties in
`boards.txt` were not updated at that time.
Global properties of that name were added to platform.txt, but this approach is not provided for by the Arduino Platform
specification:
https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-upload-configuration
> A specific upload.tool.<protocol_name> property should be defined for every board in boards.txt:
Those missing properties caused uploads to fail for users of the recent versions of Arduino IDE and Arduino CLI with an
error of the form:
Error during Upload: Property 'upload.tool.<protocol_name>' is undefined
(where `<protocol_name>` is the protocol of the selected port, if any)
It is also important to provide compatibility with versions of Arduino development tools from before the introduction of
the modern pluggable discovery system. For this reason, the old style `<board ID>.upload.tool` properties are retained.
Old versions of the development tools will treat the `<board ID>.upload.tool.<protocol_name>` properties as an unused
arbitrary user defined property with no special significance and the new versions of the development tools will do the
same for the `upload.tool` properties.
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
Allow the IDE to detect UF2 volumes (i.e. when you hold BOOTDEL and
plug in the board).
Allows the IDE2 to properly upload using OTA and serial.
Fixes#890 and others
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
* Add HTTPUpdate class to pull updates from HTTP(S)
* Increase GH runners for pulls
WiFi builds and examples are taking some serious time now
* HTTPUpdate tests build on Pico W
Remove the need to have a separate WiFiClient that's destroyed after
the HTTPClient. Let the object handle its own client, and pass through
any SSL requests.
Also supports the original ::begin methods which need a
WiFiClient(Secure) to be passed in and managed by the app.
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
* Adds support for Challenger RP2040 WiFi boards
* Added Challenger board to makeboards build script
* Adds new challenger board with LTE modem.
* Updated after getting approved PID from Raspberry Pi
* Add support for reverse numbering of analog pins.
* Added minimal HW support for onboard WiFi modem.
* Added challenger-nb-rp2040-wifi and RPICO32 module.
* Updated PID for RPICO32
* Added a simple support class for challenger LTE boards
* Update ChallengerLTE.cpp
Fixed spelling error
* Adds option for setting USB max power in makeboards.py
* Added new board Challenger RP2040 LoRa
* Added new lora board to readme.
* Added missing SERIAL2 and LoRa module GIO pins.
* Added support for enabling UART CTS and RTS pins.
* Updated boards.txt after merge conflict of makeboards.py
* Fixed incorrect indention
* Fixed PR comments
* Add new Challenger RP2040 WiFi/BLE board (https://ilabs.se/challenger-rp2040-wifi-ble-datasheet)
* * Updated PID for WiFi/BLE board
* Added abstraction pins for both versions of wifi modules
* Added support for replacing support class serial port.
* Added support for retrieving support class serial port.
* Fixed spelling errors.
* Updated helper class for Challenger NB board.
* Added Challenger sdrtc and subghz boards.
* Updated readme.
* Re ran makeboards to generate new index.
* Added to possibility to have extra compiler directives for a board.
* Added extra compiler options to JSON generation.
* Allows having a list of extra macros to define
* Fixed incorrect USB PID for Challenger NB board.
* Added board initialization for all wifi boards.
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
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
* Shift arduino attribute higher in JSON file
* Try out PlatformIO CI
* Trigger CI
* Clone recursively, actually use own repo
* Fix YAML
* Build Verbose
* Revert to checkout@v2 version, add TinyUSB to examples
* Try fix TInyUSB example
* Pull repo recursively
* Use v3 after all, correct path to example
* Only do CI on PR
* Update board generation, use renamed function
* Update documentation with new platform integration state
* Remove accidentally pushed file
* Use correct update command
* Use correct highlighting
* Use correct language
* Add section on debugging
* Add docs on filesystem, minor corrections
* Use -iprefix in compilation, but still expose all include paths to IDE
* Add exception and RTTI support, document them
* Fix typo
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.
When get.py is run in a script the percent-update printouts shown while
downloading the toolchain end up as 100s to 1000s of lines in log files.
When stdout is not a terminal, avoid printing these percentages and
shrink logfiles significantly. Errors/etc. are still reported as normal.
Fixes#609 and a niggling slowness in uploads. Try to find the drive
in a loop for 10 seconds, instead of only checking once after 10 seconds.
Avoid 100% CPU usage while waiting for Pico drive
The chip supports 133MHz and the other Pico core already defaults to
the higher speed, so make 133 the default.
It can still be changed through the menus and will stay at 125 unless
pre-existing users change it so they will see no difference.
Microsoft is deprecating WMIC, so fall back to a Powershell call in
case of failure to ruin WMIC.
Belt and suspenders, set PowerShell non-interactive mode and null STDIN.
Fixes a crash of the builder script, `board.get("build.variant", None)` will throw an exception if the `build.variant` was not found (and not return `None` as the fallback value), but an empty string works, so check against that.
USB power defines moved directly into the board files, but still ensure that the macro always exists (with a default fallback value) to not fail the build.
Defines USBD_MAX_POWER_MA as a static 250mA, which is correct for all the boards supported in platform-raspberrypi (aka, RaspberryPi Pico and Nano RP2040 Connect)
* Remove redundant/wrong second board.mcu in boards.txt
Fixes#380
Boards.txt had the setting board.mcu twice. The first one was correct,
while the second one wasn't and shouldn't have been there. Remove it.
* Include fix from @rei-vilo in #381
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"
}
By default RTTI (Run-Time Type Information) is disabled because most apps
don't need run time type info enabled. However, certain libraries expect
to be able to query types of objects at runtime, so add a menu to enable it.
* Add package.json
To make package easily integratable with PlatformIO
* Correct name back to original one
* Format package.json
* Add first shot at builder script
* Add USB stack flags, fix compile flags
* Formatting
* Add more link & USB flags
* Build Boot2 bootloader
* Formatting
* Generate linkerscript, linker fixes
* Fix linkflags, make firmware runnable
* Update USB flags and RAM size
* Correct USB flags, add dynamic sketch partitioning
* Restructure filesystem size and flash size logic into platform code
* Move C++ only flags to CXXFLAGS
* Add PlatformIO documentation
* Link to new platform.io document in the docs TOC
* Fix typos in platformio docs
* Fix one additional typo in platformio.rst
* Update docs
* Remove wrongly commited build folder
* Adds support for Challenger RP2040 WiFi boards
* Added Challenger board to makeboards build script
* Adds new challenger board with LTE modem.
* Updated after getting approved PID from Raspberry Pi
* 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.
* add two variant files
* add trinkey and stemma friend
* add fast SPI transfer using pico-sdk blocks
* update makeboards.py for new variants
- STEMMA Friend RP2040
- Trinkey RP2040 QT
* run astyle on SPI library
* fix auto -> ssize type
* astyled
* woops ssizet != sizet!
* a nice day for a new board definition! this is a macropad with 12 keys, oled and rotary encoder
Co-authored-by: hathach <thach@tinyusb.org>
Fixes#27
As @vslinuxdotnet discovered, sometimes the Pico firmware update emulated USB
stick does not get automounted under Linux. Add logic to attempt to use
standard tools to mount it to the uploader, only tried if no drives are
detected normally.
* add missing character for debug level "Wire"
if Debug Level "Wire" is chosen, the compiler posts error
> arm-none-eabi-g++: error: DDEBUG_RP2040_WIRE: No such file or directory
Add the missing '-' to correct the issue.
* change must be made via makeboards.py
The generator script needs to be fixed and rerun. If we just update the boards.txt, changes will be lost on a rebuild.
* Update boards.txt
boards.txt as generated by revised makeboards.py
* correct spelling issue for CI tool
* initial tinyusb lib port
* add Adafruit_TinyUSB_Arduino as submodules
* add yield() to main loop
* sync with tinyusb lib latest
* add USB manufacturer and product
* fix typo in tinyusb lib
* sync with master
updating implementation
* Rationalize link stage command line
Make the build process less insane.
* clean up delay
* clean up platform and board
* update makeboards.py for generating usbstack menu
* update tinyusb lib to 1.0.0
Heise.de seems to have been confused by the menu options for the
filesystem/sketch selection. Explicitly list the Sketch and FS sizes in
each menu tem to avoid future confusion.
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
Sketch upload to serial port fails on macos because the Arduino IDE uses the callout device "/dev/cu". Adding recognition of "/dev/cu" to uf2conv.py makes the sketch upload work.
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