Commit graph

27 commits

Author SHA1 Message Date
Joseph Duchesne
15eb459df9
Add variants_dir support to pio build, allowing local variants in project repos (#1911) 2023-12-26 09:59:45 -08:00
Earle F. Philhower, III
3950b94474
Avoid spurious GCC 7.x warning in platform.io builds (#1709) 2023-09-13 13:28:54 -07:00
Earle F. Philhower, III
2bd64b566c
GDB/Binutils release-gdb-13.2, GCC still 12.3 (#1706)
Fix #1681 due to breakage of GDB 12.3 in Platform.IO
Remove new Binutils linker warning
2023-09-13 13:09:37 -07:00
Maximilian Gerhardt
3cc5ac14ff
Fix PlatformIO intellisense (#1616)
The `_idedata` has been changed to `__idedata` in newer PlatformIO core versions per 158aabbdf2. This change has broken the logic to expand out the `-iprefix PATH @INCLUDEFILE` argument into its individual include paths, causing Intellisense breakages on some VSCode systems and other IDEs that didn't handle these arguments correctly or in which the path was corrupted.
2023-07-29 13:48:29 -07:00
Maximilian Gerhardt
e95248a787
Support and Document pico-debug in PlatformIO (#1427) 2023-05-05 07:32:41 -07:00
Maximilian Gerhardt
a916695155
Add PICO_FLASH_SIZE_BYTES to PIO (#1416) 2023-05-01 11:48:28 -07:00
Maximilian Gerhardt
437d03583a
Sync macros used in PlatformIO and platform.txt (#1386) 2023-04-21 09:57:50 -07:00
Sanjay Govind
f67bc43584
Add Bluetooth support to Platform.io (#1259) 2023-03-05 08:23:22 -08:00
Earle F. Philhower, III
d92c1025ba
Update to SDK 1.5, add alpha-level BT support, use Pico-SDK CYW43 infrastructure (#1167)
* 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
2023-02-27 20:09:02 -08: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
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
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
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
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
Maximilian Gerhardt
13f68fbc64
Make TinyUSB linking work automatically with PIO (#658) 2022-06-26 13:24:55 -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
Maximilian Gerhardt
1c85a1ca52
Activate default -Os optimization for Platform.IO (#619) 2022-06-10 09:28:26 -07:00
Maximilian Gerhardt
e3a1debc65
Fix IDE include paths / Intellisense (#615) 2022-06-09 15:30:22 -07:00
Maximilian Gerhardt
8deb47f2c3
Auto-ignore Adafruit TinyUSB Library if not active (#513)
Originally from https://github.com/episource/platform-raspberrypi/blob/my-platform-pico/builder/frameworks/arduino-pico/arduino-pico.py#L104-L115
2022-03-14 09:01:41 -07:00
Earle F. Philhower, III
d24c8442c4
Make pio build script executable by default (#446)
In order to be consistent the other tools in the directory.
2022-01-28 12:46:51 -08:00
Maximilian Gerhardt
4a955b2a28
Correctly use earlephilhower.varant if variant not given, ensure USB power macro is always there (#444)
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.
2022-01-28 04:15:31 -08:00
Maximilian Gerhardt
00c0bc1e6e
Fix libraries and RAM size in PlatformIO build (#440) 2022-01-26 16:56:36 -08:00
Maximilian Gerhardt
6591da9acf
Fix PlatformIO build (#395)
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)
2021-12-29 09:19:47 -08:00
Maximilian Gerhardt
3df3f0741a
Add PlatformIO support (#250)
* 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
2021-09-13 21:28:07 -07:00