Commit graph

130 commits

Author SHA1 Message Date
lady ada
3d0ebc0528 thinkink board 2022-11-29 22:34:41 -05:00
Phillip Burgess
f45b2ae730 Fix PIDs using values from MBAdafruitBoards
Still unsure about pid.[1-7] but let's see what happens
2022-11-17 18:16:12 -08:00
Phillip Burgess
6264c407ca Fix PID in scorpio JSON 2022-11-14 18:03:41 -08:00
Phillip Burgess
aea6241939 Change PID in makeboards.py instead of boards.txt 2022-11-14 17:51:33 -08:00
lady ada
3f602d4147 add rough for scorpio 2022-10-30 20:05:33 -04:00
per1234
0446b732fa
Add protocol-explicit upload.tool properties required for pluggable discovery compatibility (#933)
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.
2022-10-24 08:50:13 -07:00
Earle F. Philhower, III
c3da4ada61
Add basic Pimoroni PGA2040 board definition (#930)
Because the board needs a unique BOOT2.S, add a definition to make it
easier to use.
2022-10-22 10:19:30 -07:00
Maximilian Gerhardt
b82336c8d9
Add W25Q64JV QSPI /4 Boot2 file (#929)
Fixes #927
2022-10-20 04:25:37 -07:00
Earle F. Philhower, III
10090b60a9
Rewrite PicoW LWIP interface for stability (#916)
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
2022-10-15 12:00:35 -07:00
brtchip-tuannguyen
62ed93f12a
Add board BridgeTek IDM2040-7A (#912) 2022-10-13 08:26:11 -07:00
Sabas
86765cebb2
Update VID&PID HunterCatNFC 2040 (#907) 2022-10-11 09:12:56 -07:00
Mücahid Kamber
205983e206
Adds Degz Mizu board (#904) 2022-10-07 15:52:18 -07:00
Earle F. Philhower, III
1e7098c1cb
Add OpenOCD/GDB support for IDE 2.0 (#900)
Add (undocumented) support for the debugger in the IDE 2.0.
2022-10-05 12:19:18 -07:00
Melopero
a9356ceca5
Add Melopero Cookie RP2040 (#899) 2022-10-05 07:10:07 -07:00
Earle F. Philhower, III
b249811e28
Support IDE2, detect UF2 volumes (#897)
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
2022-10-04 16:52:36 -07:00
Earle F. Philhower, III
7a85c3917f
Allow setting the WiFi region for PicoW (#875)
Fixes #874
2022-09-23 12:22:22 -07:00
Pontus Oldberg
91b4bdb58f
Adds Challenger RP2040 NFC board (#846) 2022-09-09 07:41:33 -07:00
Earle F. Philhower, III
36d5cebde6
Remove binary info header, was crashing picotool (#831)
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
2022-09-02 23:17:03 -07:00
Earle F. Philhower, III
b4b1c39049 Add ExteremeElectric JSON 2022-08-28 12:38:14 -07:00
Earle F. Philhower, III
b233cb6e7f
Identify boards when in compound USB device mode (#806)
Allows the IDE to detect boards when using the Keyboard, Joystick,
or Mouse libraries.

Thanks @DaleMitchell for the idea!
2022-08-28 12:34:06 -07:00
Earle F. Philhower, III
9ff31b91f4
Add ExtremeElectronics RC2040 (#799)
Fixes #797
2022-08-25 12:47:39 -07:00
Earle F. Philhower, III
0edba2ee2a
Add WebServer, WebServerSecure, HTTPUpdateServer, HTTPUpdateServerSecure (#791)
* 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
2022-08-23 15:51:32 -07:00
Earle F. Philhower, III
0b390d7dc4
Add HTTPUpdate class to pull updates from HTTP(S) (#789)
* 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
2022-08-21 18:24:59 -07:00
Earle F. Philhower, III
0d15723444
Add HTTPClient, ported from the ESP8266 (#784)
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.
2022-08-21 12:49:06 -07:00
Earle F. Philhower, III
bb91d978b1
Add OTA.O to make p.io builds function (#755)
Partial #754
2022-08-12 06:09:29 -07:00
Earle F. Philhower, III
da86a8942b
Add OTA update support (#711)
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.
2022-08-12 00:26:51 -07:00
Earle F. Philhower, III
af2671d8eb
IPv6 initial support from @oddstr13 (#748)
* 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>
2022-08-09 18:05:43 -07:00
Maximilian Gerhardt
11cb82b058
Fix typo in XIAO board name (#745) 2022-08-09 09:57:51 -07:00
Sabas
a358f892d3
Add board ElectronicCats Hunter Cat NFC (#741)
* add board ElectronicCats Hunter Cat NFC

* update huntercat nfc
2022-08-07 21:36:04 -07:00
Earle F. Philhower, III
bb029cc287
Increase LWIP MEM_SIZE to > TCP_SND_BUF (#731)
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
2022-07-29 22:35:37 -07:00
Earle F. Philhower, III
8fd56ada8b
Adjust tcp_write size when memory is tight (#729)
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
2022-07-29 13:40:03 -07:00
Earle F. Philhower, III
82abc76e0c
Add CMSIS defines to Platform.io (#721)
Ref: https://github.com/earlephilhower/arduino-pico/pull/717#issuecomment-1197921851
2022-07-28 12:29:16 -07:00
Pontus Oldberg
e6e87fd307
Added to possibility to have extra compiler directives for a board. (#713)
* 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>
2022-07-27 08:36:50 -07:00
Earle F. Philhower, III
042c6af887
Add USB VID/PID to Platform.IO HWIDs (#698) 2022-07-21 12:08:21 -07:00
Earle F. Philhower, III
0e18f0986a
Enable IPv4 or IPv4/IPv6 stacks, Ethernet class (#695)
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
2022-07-21 11:57:21 -07:00
Maximilian Gerhardt
40f4fdf246
Fix PlatformIO linking for variant-specific overrides (#696) 2022-07-21 04:49:09 -07:00
Earle F. Philhower, III
b88ad3d143
Support original Pico with ROM B0 (#693)
The SDK disabled float/double support for some functions by default on the
original B0 ROMs.  Manually re-enable it.

Fixes #689
2022-07-20 12:07:34 -07:00
Maximilian Gerhardt
be9e25785c
Correct PlatformIO build for Pico W, add to CI (#686)
* Add LWIP defines from platform.txt

* Add WiFi example to PIO CI
2022-07-19 08:09:47 -07:00
Earle F. Philhower, III
c3a580ee89
Add WiFiClientSecure and WifiServerSecure (TLS) support, NTP (#683)
* Add TLS (https) support
* Add NTP server
* Clean up include path, add BearSSL headers
* Allow 2 NTP servers, add ESP8266 compat define
* Add MFLN SSL example, free/used/total heap getters
* Enable stack thunking
* Add tested SSL examples
* Add BSSL_validation demo
* Add Client Certificate example
* Add RP2040 helper docs
* Clean up doc errors, missing doc version info
* Add WiFiClientSecure documentation
* Add NTP docs

Fixes #679
2022-07-18 20:24:11 -07:00
Earle F. Philhower, III
61742c9357
Disable WiFi.begin on plain Pico, add JSON (#682) 2022-07-17 05:51:03 -07:00
Earle F. Philhower, III
abf2c586c7
Add Pico W WiFi support (#670)
* 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 #666
Fixed #665
2022-07-15 16:47:53 -07:00
Pontus Oldberg
5be405308e
Add support for new SD/RTC and SubGHz boards (#663) 2022-06-30 10:16:44 -07:00
Earle F. Philhower, III
af0c1c87f5
Automatically update the JSON file in makeboards (#664)
Keep the Arduino Board Manager list up-to-date from makeboards.py
2022-06-29 12:50:42 -07:00
Maximilian Gerhardt
13f68fbc64
Make TinyUSB linking work automatically with PIO (#658) 2022-06-26 13:24:55 -07:00
Maximilian Gerhardt
0a23dfeb42
Update PlatformIO board files, add PIO CI (#634)
* 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
2022-06-17 08:57:18 -07:00
Maximilian Gerhardt
4a94677ee5
Update PlatformIO builder script and docs (#633)
* 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
2022-06-16 18:59:46 -07:00
Ha Thach
26752f6f90
Aadd f_cpu 120, 240 mhz option (#628) 2022-06-15 09:12:43 -07:00
Earle F. Philhower, III
1d6f66f834
Shrink flash and RAM usage even more (#627)
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.
2022-06-13 11:54:38 -07:00
Maximilian Gerhardt
1c85a1ca52
Activate default -Os optimization for Platform.IO (#619) 2022-06-10 09:28:26 -07:00
Earle F. Philhower, III
fdf30febea
Hide get.py download percent when not interactive (#618)
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.
2022-06-09 18:00:45 -07:00