Compare commits

...
77 Commits
Author SHA1 Message Date
Earle F. Philhower, III 541e23d663 Update to major version 2.0.0 2022-04-27 12:10:55 -07:00
Earle F. Philhower, III 65fe176795 Make default CPU speed 133MHz (#557)
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.
2022-04-27 11:31:21 -07:00
Earle F. Philhower, III cfc91804c8 Fix memory corruption introducted in FreeRTOS port (#556)
To remove compiler warning the valid core macro was modified to only check
that the core passed in was < # of total cores.  Unfortunately there are
parts of the FreeRTOS code where the passed in core # is -1.  The upstream
catches this and returns FALSE, but my hacked version returned TRUE.  This
caused interesting memory corruption errors and crashes when the
current task block[-1] was updated.

Undo the change and fix the 1 spot where a warning happens instead.

Undo the forced compiler -O0 for port.c, it was only masking the fault.
2022-04-27 09:42:15 -07:00
Earle F. Philhower, III 88d213a30b Additional FreeRTOS adjustments (#555)
Use low power WFE when idle.

Set PORT.C to built `-O0` always because it seems to occasinally end
up with interrupts disabled in task code, causing the SYSTICK never to
fire and killing task switching.

No need for dynamic exceptions.  We don't move the execbase.
2022-04-27 03:53:07 -07:00
Earle F. Philhower, III 189b796499 More FreeRTOS ISR work 2022-04-25 19:11:38 -07:00
Earle F. Philhower, III af7f430227 Change the RTD theme (#554)
Alabaster is not my favorite, try something with colors...
2022-04-25 18:03:07 -07:00
Andy2No 797abb5a7f Update SimpleTone.ino (#552)
Adds code to define which pins are used, moving them from the defaults, which are the same as the only three analogue input pins, and adding comments to explain how to change them.

The original didn't give any clues about which pins were used, which isn't ideal for a beginner - it was necessary to look at the code for the library, to work that out.

The new code redundantly defines a pWS pin number (as pBCLK+1), which isn't used in the example, but is meant as a reminder to the person using it, of how to wire up WS.
2022-04-25 12:21:34 -07:00
Earle F. Philhower, III ffff21a936 Update FreeRTOS library to avoid random crashes (#553) 2022-04-25 12:10:48 -07:00
Earle F. Philhower, III 781fb3ab48 Update docs, increase max analogWriteFreq to 1MHz (#551) 2022-04-25 08:23:50 -07:00
Earle F. Philhower, III bda630e419 Add FreeRTOS support thanks to @hfellner (#533)
Using all the work from @hfellner and others, add FreeRTOS
SMP support.

Allow idling cores through the FreeRTOS FIFO queue to
allow for file system and EEPROM support.

Make delay a weak function so FreeRTOS can override.

Add cycle count support under FreeRTOS using a PIO SM.

Use a task-based approach for handling the USB periodic work
instead of the IRQ-based one in the main core.

Set 8 prio levels so it fits in 3 bits nicely (0..7).
2022-04-24 20:59:57 -07:00
Earle F. Philhower, III 9afdc48ddd Add SoftwareSerial wrapper around SerialPIO (#548)
I receive mails weekly asking how to use `SoftwareSerial` on this core.
Avoid the issue by including a simple wrapper class around `SerialPIO`
which gives the proper class name and constructor parameters.

Note that inverted mode is not supported.
2022-04-24 15:07:55 -07:00
Earle F. Philhower, III 3ee031abc9 Add ::overflow() return to SerialUART/SerialPIO (#547)
Matching the Arduino SoftwareSerial API
2022-04-24 14:44:23 -07:00
Earle F. Philhower, III d1f9bce083 Document the Generic RP2040 option (#546)
Fixes #522
2022-04-24 11:04:17 -07:00
Earle F. Philhower, III 670957487a Update version 2022-04-22 12:55:08 -07:00
Earle F. Philhower, III 1c0133704e Update to LittleFS 2.5 (#545) 2022-04-22 12:22:27 -07:00
Earle F. Philhower, III 5927d4ee2b Fix SerialPIO sampling, avoid reading random garbage (#544)
Adjust the 1/2 bit time to match the number of extra cycles in the actual
PIO loop.

Throw out the entire start bit, which results in sampling the data at the
midpoint and not the starting time of a bit (which was causing random
failures on read data).

Tested at 300bps all the way to 2,000,000bps using a loopback connection.

Fixes #360
2022-04-21 19:48:30 -07:00
Earle F. Philhower, III 5dee051a7a Update version 2022-04-17 14:40:27 -07:00
Earle F. Philhower, III 561110231d Add SparkFun Thing Plus RP2040 (#540) 2022-04-17 14:39:28 -07:00
Earle F. Philhower, III eff908385e Add Seeed XAIO RP2040 support (#538)
Fixes #537
2022-04-16 10:52:06 -07:00
Jean-Luc Béchennec 784a6ed5ad Added the ability to set pad current via pinMode: OUTPUT_2MA, OUTPUT_… (#532) 2022-04-10 13:33:19 -07:00
Earle F. Philhower, III da2d08a27b Update keywords.txt 2022-04-09 11:27:01 -07:00
Earle F. Philhower, III 061b38f0b8 Add RTS/CTS to Arduino Nano Connect Serial2(NINA) (#525)
Fixes #524
2022-03-30 14:12:24 -07:00
Arya11111 9971bda9cb Modify DFRobot pins_arduino.h file. (#521) 2022-03-29 07:17:00 -07:00
Earle F. Philhower, III 6cb2bf7009 Update version 2022-03-17 08:42:29 -07:00
randomllama 50befc42c3 udisks v2.9.0 dropped the trailing period for "udisksctl mount". (#516) 2022-03-16 14:25:44 -07:00
Earle F. Philhower, III 53043830e7 Avoid "chunkiness" of UART FIFO availability (#511)
* Avoid "chunkiness" of UART FIFO availability

The UART FIFO will generate an IRQ to transfer data into the SerialUART
FIFOs either every 4 received bytes, or every 4 idle byte times.  This
causes the ::available count to report "0" until either of those two
cases happen, causing a potentially delay in data becoming available to
the app.

Change the code to pull data from the HW FIFO on a read/available/peek.
Use a non-blocking mutex and IRQ disabling to safely empty the FIFO from
user space.  The mutex added to the IRQ is non-blocking and will be
a single CAS the vast majority of the time, so it should not impact the
Serial performance.

Fixes #464 and others where `setPollingMode()` was needed as a workaround.

Make sure we have all mutexes locked before we disable the port and free
the queue to avoid evil cases.

Only init the mutexes once, on object creation.

In polled mode, don't bother acquiring/releasing the fifo mutex.

When begin() is called on an already running port, call end() to clean
up the old data/etc. before making a new queue/config.  This avoids a
memory leak and potential write-after-free case.
2022-03-16 08:46:20 -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 01093482e7 Add script to update version number, new header (#506)
Define ARDUINO_PICO_MAJOR/_MINOR/_REVISION for app use and update the
Platform.IO and Arduino files for a new release version.

Fixes #309
Fixes #487
2022-03-06 11:04:19 -08:00
Earle F. Philhower, III da215aecd4 Fix QT Py serial (Serial2 pinned out, not Serial1) (#505) 2022-03-05 14:28:45 -08:00
Earle F. Philhower, III be21c31eab Update package_pico_index.template.json 2022-02-24 04:58:27 -08:00
Earle F. Philhower, III 6457cb7dd0 Update README.md 2022-02-24 04:57:35 -08:00
Arya11111 e444a7329c Add DFRobot Beetle RP2040 boards V1.0.0 (#502) 2022-02-24 04:56:59 -08:00
Earle F. Philhower, III 28d7818c2b Merge branch 'master' of https://github.com/earlephilhower/arduino-pico 2022-02-23 08:48:41 -08:00
Earle F. Philhower, III 6561310d25 Minor OOM check in PIO support routines 2022-02-23 08:48:16 -08:00
Pontus Oldberg f8e8a7b72e Updating LoRa board pins and UART hw flow. (#499)
* Added missing SERIAL2 and LoRa module GIO pins.
* Added support for enabling UART CTS and RTS pins.
2022-02-22 01:45:24 -08:00
Bodmer 5a0d67f1ac PDM library: Update PIO and interrupt use (#496)
The PIO and state machine were hard wired, so this caused problems if they were not free. The approach used by the Servo library has been adopted so a free PIO and SM are searched.

The DMA_IRQ_0 was grabbed exclusively, but this conflicts with SPI DMA use. The interrupt is now shared, but has been allocated the highest possible priority.

Since the PDM PIO use is receive only, the PIO state machine RX FIFO's can be joined to reduce DMA interrupt load.
2022-02-20 13:20:43 -08:00
Earle F. Philhower, III 03626e615b Alphabetize the boards menu (#495)
Reorder the boards menu to make it easier to find any specific
board.  Add a note to the script asking manufacturers to keep it
that way.
2022-02-20 09:21:01 -08:00
Earle F. Philhower, III bac6dae0ad Document new restartCore1 call 2022-02-20 08:46:25 -08:00
Magnus Nordlander 5c186d8467 Added ability to reset and relaunch core 1 (#493) 2022-02-20 08:43:30 -08:00
Earle F. Philhower, III 25b34913c6 Update package_pico_index.template.json 2022-02-19 09:57:56 -08:00
Pontus Oldberg 8dabe44693 Add support for Challenger RP2040 LoRa (#494) 2022-02-19 06:56:32 -08:00
Earle F. Philhower, III 8a7977fcb3 Fix SerialPIO receive interrupt on PIO1 (#490)
Fixes #489

Only the PIO0 IRQ handler was ever installed due to a hardcoding bug.
Attach the IRQ handler to the PIO being started instead.
2022-02-15 12:10:12 -08:00
Earle F. Philhower, III d689165a39 Update OpenOCD for Winx32 to be x64 compatible (#485) 2022-02-13 12:54:27 -08:00
Earle F. Philhower, III f2fd654b84 Bump to 1.11.0 2022-02-12 12:38:35 -08:00
Earle F. Philhower, III 1b61a86618 Update GDB and OpenOCD to work together, finally (#482)
GDB for non-Linux systems was built w/o expat which caused odd behavior
under Windows and other systems (i.e. breakpoints not working, etc.)
New toolchain manually builds cross-compiled libexpat and ensures it is
used, fixing the issue.

Windows OpenOCD binaries now come from manually built and tested copies
(using a real Windows system).

Fixes #478
Fixes #457
Fixes #456
and probably others...
2022-02-12 12:35:03 -08:00
Earle F. Philhower, III 44cd697b29 Add SerialUART::setPollingMode() (#473)
Fixes #472

Instead of using interrupts, explicitly call the IRQ handler dueing Serial
read/peek/available calls.

Add to keywords.txt for syntax hilighting.

Add poll calls in the SerialUART::write-like calls (write,
flush, etc.)

Really remove division from IRQ routines/
2022-02-10 12:22:27 -08:00
Earle F. Philhower, III d562b00c37 Use Powershell to find UF2 drive if WMIC fails (#476)
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.
2022-02-10 12:15:43 -08:00
Earle F. Philhower, III ba92377eba Decrease size of used FIFO in SerialUART (#471)
Fixes #468

The FIFO limit was set to 1/2, or 16 bytes on POR and not set by the core,
so for low baud this could result in a LONG time without data moving from
hardware FIFO to the SW ring buffer and timeouts/etc.

Now use the API call which sets it to 1/8, or 4 bytes of data to speed up
the transfer 4x.

Also avoid using the divider in the IRQ routine because it is not clear
from the docs of the Pico SDK IRQ callback routine preserves divider
state or not.  If not, doing division in an IRQ could result in random
data corruption in the main app.

Add memory barriers to ensure the order of data into RAM is preserved
and that GCC doesn't reorder writes.
2022-02-08 12:14:40 -08:00
gsexton acbe190a20 Fix OpenSUSE upload, make mount point fionding more robust (#467)
Change order of tests to favor /run/media over /media. Parse output of udiskctl mount to find mount path
2022-02-08 08:24:30 -08:00
Earle F. Philhower, III 4cd65d1512 Remove timeout for SerialUART/SerialPIO::read/peek (#466)
Fixes #464 and other incompatibilities

Remove the timeout check from ::read and ::peek on the SerialUART/PIO
classes  (SerialUSB already ignores it).  See documentation
https://www.arduino.cc/reference/en/language/functions/communication/serial/settimeout/
and thanks to @jandrassy's explanation
https://github.com/earlephilhower/arduino-pico/issues/464#issuecomment-1031657044
2022-02-07 12:33:49 -08:00
Earle F. Philhower, III bbae702e9f Add support for analogReadResolution, default 10b (#461)
Most other boards and the MBED RP2040 support analogReadResolution which
just shifts read data around as needed, with a default of only 10b of
resolution.  The Pico ADC technically supports 12b, but only has about
8b of real data after noise, so you're not really losing anything in the
general case.

Fixes #460
2022-02-05 10:10:45 -08:00
Earle F. Philhower, III c4046602f0 Allow changing I2C clock speed while running (#459)
Fixes #458
2022-02-04 18:08:35 -08:00
Earle F. Philhower, III baf925fefd Update to 1.10.0 release 2022-02-02 18:15:59 -08:00
Earle F. Philhower, III ec00479640 Update to 1.3.2-a toolchain, setjmp/longjmp fix (#454)
Fixes #453, a crash caused by Newlib having ARM instructions in
the Thumb-only Cortex-M0+.
2022-02-02 18:00:06 -08:00
Earle F. Philhower, III 66e4866091 Prepare for 1.9.15 2022-01-29 03:36:20 -08:00
Earle F. Philhower, III 5b47a61209 Update package_pico_index.template.json 2022-01-29 03:34:18 -08:00
Earle F. Philhower, III b0365cd9ad Update platform.txt 2022-01-29 03:32:08 -08:00
Spegs21 36bb604d38 Update tinyusb 1.9.2 (#445) 2022-01-29 03:22:14 -08:00
Earle F. Philhower, III d8835df9ab Fix pgm_read_ macros with inline functions (#449)
Fixes #447
2022-01-28 18:44:34 -08: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
Earle F. Philhower, III 4f27ec44eb Generate Platform.IO board definitions (#426)
As part of the boards.txt generation, also make necessary files for
Platform.IO.

Fixes #399
2022-01-28 04:08:59 -08:00
Earle F. Philhower, III 843630c3c7 Remove unused copy of std C++ library (#443) 2022-01-27 12:16:41 -08:00
Maximilian Gerhardt 00c0bc1e6e Fix libraries and RAM size in PlatformIO build (#440) 2022-01-26 16:56:36 -08:00
Kattni 5980993774 Add NeoPixel pins to Adafruit boards (#438) 2022-01-26 11:41:39 -08:00
Earle F. Philhower, III 72c875183a Update README.md 2022-01-26 08:46:51 -08:00
风飘雨 97f9afac0a Add board flyboard2040core (#437)
Thx!
2022-01-26 08:46:13 -08:00
Earle F. Philhower, III a7035ab61e Rename SDFat directory for Adafruit compatibility
Fixes #416
2022-01-24 12:38:35 -08:00
Earle F. Philhower, III ea4c0999d0 Add interpolater include path (#428)
Fixes #427.  The libpico.a build already includes the HW interpolator
sources, but the include was missing from the Arduino path.
2022-01-22 11:30:47 -08:00
Earle F. Philhower, III d51fa99b70 Update package.json 2022-01-20 08:54:58 -08:00
Earle F. Philhower, III 2c97bffc54 Update to latest upstream LittleFS (#425)
Also clean up output in SpeedTest, make more human friendly
2022-01-19 18:09:40 -08:00
Earle F. Philhower, III 626b62c413 Update to latest upstream Keyboard/Mouse (#424)
Keyboard class now has support for non-en_US layouts, and documentation has
been added to the Mouse class.

Thanks to @rico0260 for letting me know about the update, and for the initial PR!
2022-01-19 17:46:31 -08:00
Earle F. Philhower, III 25b9ca821e Only call Wire.onReceive if data is available (#423)
The Pico HW seems to generate an interrupt on the end of every I2C
write cycle, even if the slave address wasn't actually targeted.
This would cause the onReceive method to be called with a 0-len
parameter for every write on the I2C bus.

Now, only call onReceive if there is 1 or more bytes of data available.
2022-01-19 16:16:39 -08:00
Earle F. Philhower, III d5ddf4cd7f Move SdFat to master/head (#422)
SdFat used to point to unnamed commit in the ESP8266SdFat repo.
Master in that repo has now been moved to that commit, so make this
core use the master branch for sanity's sake.
2022-01-19 12:30:12 -08:00
Earle F. Philhower, III d43dcbcf8c Remove duplicate millis/micros definitions (#419)
Fixes #418
2022-01-15 09:40:31 -08:00
Juraj Andrássy 1fdc0ab7c1 Arduino Nano R2040 Connect Nina pins access with WiFiNINA lib (#404) 2022-01-09 09:11:27 -08:00
Khoi Hoang 9408b7e2c4 Fix WiFiNINA issue for Arduino Nano Connect (#403)
Fixes #373
2022-01-09 08:03:53 -08:00
132 changed files with 7253 additions and 1791 deletions
+6 -6
View File
@@ -20,7 +20,7 @@ jobs:
- name: Run codespell
uses: codespell-project/actions-codespell@master
with:
skip: ./pico-extras,./ArduinoCore-API,./libraries/SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst,./cores/rp2040/api
skip: ./pico-extras,./ArduinoCore-API,./libraries/ESP8266SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst,./cores/rp2040/api,./libraries/FreeRTOS
ignore_words_list: ser,DOUT
# Consistent style
@@ -36,7 +36,7 @@ jobs:
./tests/ci/pkgrefs_test.sh
- name: Check boards.txt was not edited after makeboards.py
run: |
./tools/makeboards.py > boards.txt
./tools/makeboards.py
# If anything changed, GIT should return an error and fail the test
git diff --exit-code
- name: Run astyle on all code/examples
@@ -46,10 +46,10 @@ jobs:
./tests/restyle.sh
# If anything changed, GIT should return an error and fail the test
git diff --exit-code
- name: Check Arduino API copy is clean
run: |
git submodule update --init ./ArduinoCore-API
diff -r ./cores/rp2040/api ./ArduinoCore-API/api
# - name: Check Arduino API copy is clean
# run: |
# git submodule update --init ./ArduinoCore-API
# diff -r ./cores/rp2040/api ./ArduinoCore-API/api
# Build all examples on linux (core and Arduino IDE)
build-linux:
+4 -1
View File
@@ -11,7 +11,7 @@
path = libraries/LittleFS/lib/littlefs
url = https://github.com/littlefs-project/littlefs.git
[submodule "libraries/SdFat"]
path = libraries/SdFat
path = libraries/ESP8266SdFat
url = https://github.com/earlephilhower/ESP8266SdFat.git
[submodule "pico-extras"]
path = pico-extras
@@ -25,3 +25,6 @@
[submodule "libraries/Adafruit_TinyUSB_Arduino"]
path = libraries/Adafruit_TinyUSB_Arduino
url = https://github.com/adafruit/Adafruit_TinyUSB_Arduino.git
[submodule "libraries/FreeRTOS/lib/FreeRTOS-Kernel"]
path = libraries/FreeRTOS/lib/FreeRTOS-Kernel
url = https://github.com/earlephilhower/FreeRTOS-Kernel.git
+11 -5
View File
@@ -18,16 +18,21 @@ See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for m
* Adafruit QTPy RP2040
* Adafruit STEMMA Friend RP2040
* Adafruit Trinkey RP2040 QT
* Arduino Nano RP2040 Connect (preliminary)
* Arduino Nano RP2040 Connect
* Cytron Maker Pi RP2040
* Cytron Maker Nano RP2040
* DeRuiLab FlyBoard2040 Core
* DFRobot Beetle RP2040
* Invector Labs Challenger RP2040 WiFi
* Invector Labs Challenger NB RP2040 WiFi
* Invector Labs Challenger RP2040 LTE
* Invector Labs Challenger RP2040 LoRa
* Invector Labs RPICO32
* Melopero Shake RP2040
* Seeed XIAO RP2040
* Solder Party RP2040 Stamp
* SparkFun ProMicro RP2040
* SparkFun Thing Plus RP2040
* uPesy RP2040 DevKit
* WIZnet W5100S-EVB-Pico
* Generic (configurable flash, I/O pins)
@@ -80,7 +85,7 @@ If you follow Les' step-by-step you will also have a fully functional `CMake`-ba
To upload your first sketch, you will need to hold the BOOTSEL button down while plugging in the Pico to your computer.
Then hit the upload button and the sketch should be transferred and start to run.
After the first upload, this should not be necessary as the `arduino-pico` core has auto-reset support.
After the first upload, this should not be necessary as the `arduino-pico` core has auto-reset support.
Select the appropriate serial port shown in the Arduino Tools->Port->Serial Port menu once (this setting will stick and does not need to be
touched for multiple uploads). This selection allows the auto-reset tool to identify the proper device to reset.
Them hit the upload button and your sketch should upload and run.
@@ -92,8 +97,8 @@ follow the initial procedure of holding the BOOTSEL button down while plugging i
The onboard flash filesystem for the Pico, LittleFS, lets you upload a filesystem image from the sketch directory for your sketch to use. Download the needed plugin from
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/releases
To install, follow the directions in
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/blob/master/README.md
To install, follow the directions in
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/blob/master/README.md
For detailed usage information, please check the ESP8266 repo documentation (ignore SPIFFS related notes) available at
* https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html
@@ -141,7 +146,7 @@ The installed tools include a version of OpenOCD (in the pqt-openocd directory)
* Overclocking and underclocking from the menus
* digitalWrite/Read, shiftIn/Out, tone, analogWrite(PWM)/Read, temperature
* Peripherals: SPI master, Wire(I2C) master/slave, dual UART, emulated EEPROM, I2S audio output, Servo
* printf (i.e. debug) output over USB serial
* printf (i.e. debug) output over USB serial
The RP2040 PIO state machines (SMs) are used to generate jitter-free:
* Servos
@@ -168,6 +173,7 @@ If you want to contribute or have bugfixes, drop me a note at <earlephilhower@ya
* [LittleFS](https://github.com/ARMmbed/littlefs) library written by ARM Limited and released under the [BSD 3-clause license](https://github.com/ARMmbed/littlefs/blob/master/LICENSE.md).
* [UF2CONV.PY](https://github.com/microsoft/uf2) is by Microsoft Corporation and licensed under the MIT license.
* Some filesystem code taken from the [ESP8266 Arduino Core](https://github.com/esp8266/Arduino) and licensed under the LGPL.
* [FreeRTOS](https://freertos.org) is Copyright Amazon.com, Inc. or its affiliates, and distributed under the MIT license.
-Earle F. Philhower, III
earlephilhower@yahoo.com
+3598 -1307
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include "stdlib_noniso.h" // Wacky deprecated AVR compatibility functions
#include "RP2040Version.h"
#include "api/ArduinoAPI.h"
#include "api/itoa.h" // ARM toolchain doesn't provide itoa etc, provide them
#include <pins_arduino.h>
@@ -70,6 +71,7 @@ void noInterrupts();
#define portModeRegister(port) ((volatile uint32_t*) sio_hw->gpio_oe)
// ADC RP2040-specific calls
void analogReadResolution(int bits);
float analogReadTemp(); // Returns core temp in Centigrade
// PWM RP2040-specific calls
@@ -77,6 +79,9 @@ void analogWriteFreq(uint32_t freq);
void analogWriteRange(uint32_t range);
void analogWriteResolution(int res);
// FreeRTOS potential calls
extern bool __isFreeRTOS;
#ifdef __cplusplus
} // extern "C"
#endif
+129 -82
View File
@@ -25,7 +25,11 @@
#include <hardware/structs/systick.h>
#include <pico/multicore.h>
#include <pico/util/queue.h>
#include <CoreMutex.h>
#include "CoreMutex.h"
#include "ccount.pio.h"
extern "C" volatile bool __otherCoreIdled;
class _MFIFO {
public:
@@ -45,9 +49,12 @@ public:
}
void registerCore() {
multicore_fifo_clear_irq();
irq_set_exclusive_handler(SIO_IRQ_PROC0 + get_core_num(), _irq);
irq_set_enabled(SIO_IRQ_PROC0 + get_core_num(), true);
if (!__isFreeRTOS) {
multicore_fifo_clear_irq();
irq_set_exclusive_handler(SIO_IRQ_PROC0 + get_core_num(), _irq);
irq_set_enabled(SIO_IRQ_PROC0 + get_core_num(), true);
}
// FreeRTOS port.c will handle the IRQ hooking
}
void push(uint32_t val) {
@@ -79,9 +86,9 @@ public:
return;
}
mutex_enter_blocking(&_idleMutex);
_otherIdled = false;
__otherCoreIdled = false;
multicore_fifo_push_blocking(_GOTOSLEEP);
while (!_otherIdled) { /* noop */ }
while (!__otherCoreIdled) { /* noop */ }
}
void resumeOtherCore() {
@@ -89,97 +96,50 @@ public:
return;
}
mutex_exit(&_idleMutex);
_otherIdled = false;
__otherCoreIdled = false;
// Other core will exit busy-loop and return to operation
// once otherIdled == false.
// once __otherCoreIdled == false.
}
void clear() {
uint32_t val;
while (queue_try_remove(&_queue[0], &val)) {
tight_loop_contents();
}
while (queue_try_remove(&_queue[1], &val)) {
tight_loop_contents();
}
}
private:
static void __no_inline_not_in_flash_func(_irq)() {
multicore_fifo_clear_irq();
noInterrupts(); // We need total control, can't run anything
while (multicore_fifo_rvalid()) {
if (_GOTOSLEEP == multicore_fifo_pop_blocking()) {
_otherIdled = true;
while (_otherIdled) { /* noop */ }
break;
if (!__isFreeRTOS) {
multicore_fifo_clear_irq();
noInterrupts(); // We need total control, can't run anything
while (multicore_fifo_rvalid()) {
if (_GOTOSLEEP == multicore_fifo_pop_blocking()) {
__otherCoreIdled = true;
while (__otherCoreIdled) { /* noop */ }
break;
}
}
interrupts();
}
interrupts();
}
bool _multicore = false;
mutex_t _idleMutex;
static volatile bool _otherIdled;
queue_t _queue[2];
static constexpr int _GOTOSLEEP = 0x66666666;
static constexpr uint32_t _GOTOSLEEP = 0xC0DED02E;
};
class RP2040;
extern RP2040 rp2040;
class RP2040 {
public:
RP2040() {
_epoch = 0;
// Enable SYSTICK exception
exception_set_exclusive_handler(SYSTICK_EXCEPTION, _SystickHandler);
systick_hw->csr = 0x7;
systick_hw->rvr = 0x00FFFFFF;
}
~RP2040() { /* noop */ }
// Convert from microseconds to PIO clock cycles
static int usToPIOCycles(int us) {
// Parenthesis needed to guarantee order of operations to avoid 32bit overflow
return (us * (clock_get_hz(clk_sys) / 1000000));
}
// Get current clock frequency
static int f_cpu() {
return clock_get_hz(clk_sys);
}
// Get CPU cycle count. Needs to do magic to extens 24b HW to something longer
volatile uint64_t _epoch = 0;
inline uint32_t getCycleCount() {
uint32_t epoch;
uint32_t ctr;
do {
epoch = (uint32_t)_epoch;
ctr = systick_hw->cvr;
} while (epoch != (uint32_t)_epoch);
return epoch + (1 << 24) - ctr; /* CTR counts down from 1<<24-1 */
}
inline uint64_t getCycleCount64() {
uint64_t epoch;
uint64_t ctr;
do {
epoch = _epoch;
ctr = systick_hw->cvr;
} while (epoch != _epoch);
return epoch + (1LL << 24) - ctr;
}
void idleOtherCore() {
fifo.idleOtherCore();
}
void resumeOtherCore() {
fifo.resumeOtherCore();
}
// Multicore comms FIFO
_MFIFO fifo;
private:
static void _SystickHandler() {
rp2040._epoch += 1LL << 24;
}
};
extern "C" void main1();
class PIOProgram;
// Wrapper class for PIO programs, abstracting common operations out
// TODO - Add unload/destructor
@@ -235,3 +195,90 @@ private:
const pio_program_t *_pgm;
};
class RP2040 {
public:
RP2040() { /* noop */ }
~RP2040() { /* noop */ }
void begin() {
_epoch = 0;
if (!__isFreeRTOS) {
// Enable SYSTICK exception
exception_set_exclusive_handler(SYSTICK_EXCEPTION, _SystickHandler);
systick_hw->csr = 0x7;
systick_hw->rvr = 0x00FFFFFF;
} else {
int off = 0;
_ccountPgm = new PIOProgram(&ccount_program);
_ccountPgm->prepare(&_pio, &_sm, &off);
ccount_program_init(_pio, _sm, off);
pio_sm_set_enabled(_pio, _sm, true);
}
}
// Convert from microseconds to PIO clock cycles
static int usToPIOCycles(int us) {
// Parenthesis needed to guarantee order of operations to avoid 32bit overflow
return (us * (clock_get_hz(clk_sys) / 1000000));
}
// Get current clock frequency
static int f_cpu() {
return clock_get_hz(clk_sys);
}
// Get CPU cycle count. Needs to do magic to extens 24b HW to something longer
volatile uint64_t _epoch = 0;
inline uint32_t getCycleCount() {
if (!__isFreeRTOS) {
uint32_t epoch;
uint32_t ctr;
do {
epoch = (uint32_t)_epoch;
ctr = systick_hw->cvr;
} while (epoch != (uint32_t)_epoch);
return epoch + (1 << 24) - ctr; /* CTR counts down from 1<<24-1 */
} else {
return ccount_read(_pio, _sm);
}
}
inline uint64_t getCycleCount64() {
if (!__isFreeRTOS) {
uint64_t epoch;
uint64_t ctr;
do {
epoch = _epoch;
ctr = systick_hw->cvr;
} while (epoch != _epoch);
return epoch + (1LL << 24) - ctr;
} else {
return ccount_read(_pio, _sm);
}
}
void idleOtherCore() {
fifo.idleOtherCore();
}
void resumeOtherCore() {
fifo.resumeOtherCore();
}
void restartCore1() {
multicore_reset_core1();
fifo.clear();
multicore_launch_core1(main1);
}
// Multicore comms FIFO
_MFIFO fifo;
private:
static void _SystickHandler() {
rp2040._epoch += 1LL << 24;
}
PIO _pio;
int _sm;
PIOProgram *_ccountPgm;
};
+2
View File
@@ -287,6 +287,8 @@ static int64_t timer_task(__unused alarm_id_t id, __unused void *user_data) {
return USB_TASK_INTERVAL;
}
void __USBStart() __attribute__((weak));
void __USBStart() {
if (tusb_inited()) {
// Already called
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#define ARDUINO_PICO_MAJOR 2
#define ARDUINO_PICO_MINOR 0
#define ARDUINO_PICO_REVISION 0
#define ARDUINO_PICO_VERSION_STR "2.0.0"
+43 -31
View File
@@ -36,6 +36,10 @@ static pio_program_t *pio_make_uart_prog(int repl, const pio_program_t *pg) {
p->length = pg->length;
p->origin = pg->origin;
uint16_t *insn = (uint16_t *)malloc(p->length * 2);
if (!insn) {
delete p;
return nullptr;
}
memcpy(insn, pg->instructions, p->length * 2);
insn[0] = pio_encode_set(pio_x, repl);
p->instructions = insn;
@@ -93,7 +97,7 @@ void __not_in_flash_func(SerialPIO::_handleIRQ)() {
}
while (!pio_sm_is_rx_fifo_empty(_rxPIO, _rxSM)) {
uint32_t decode = _rxPIO->rxf[_rxSM];
decode >>= 32 - _rxBits;
decode >>= 33 - _rxBits;
uint32_t val = 0;
for (int b = 0; b < _bits + 1; b++) {
val |= (decode & (1 << (b * 2))) ? 1 << b : 0;
@@ -114,21 +118,25 @@ void __not_in_flash_func(SerialPIO::_handleIRQ)() {
}
}
if ((_writer + 1) % _fifosize != _reader) {
auto next_writer = _writer + 1;
if (next_writer == _fifoSize) {
next_writer = 0;
}
if (next_writer != _reader) {
_queue[_writer] = val & ((1 << _bits) - 1);
asm volatile("" ::: "memory"); // Ensure the queue is written before the written count advances
_writer = (_writer + 1) % _fifosize;
_writer = next_writer;
} else {
// TODO: Overflow
_overflow = true;
}
}
}
SerialPIO::SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifosize) {
SerialPIO::SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifoSize) {
_tx = tx;
_rx = rx;
_fifosize = fifosize + 1; // Always one unused entry
_queue = new uint8_t[_fifosize];
_fifoSize = fifoSize + 1; // Always one unused entry
_queue = new uint8_t[_fifoSize];
mutex_init(&_mutex);
}
@@ -138,6 +146,7 @@ SerialPIO::~SerialPIO() {
}
void SerialPIO::begin(unsigned long baud, uint16_t config) {
_overflow = false;
_baud = baud;
switch (config & SERIAL_PARITY_MASK) {
case SERIAL_PARITY_EVEN:
@@ -221,7 +230,7 @@ void SerialPIO::begin(unsigned long baud, uint16_t config) {
pio_sm_clear_fifos(_rxPIO, _rxSM); // Remove any existing data
// Put phase divider into OSR w/o using add'l program memory
pio_sm_put_blocking(_rxPIO, _rxSM, clock_get_hz(clk_sys) / (_baud * 2) - 2);
pio_sm_put_blocking(_rxPIO, _rxSM, clock_get_hz(clk_sys) / (_baud * 2) - 5 /* insns in PIO halfbit loop */);
pio_sm_exec(_rxPIO, _rxSM, pio_encode_pull(false, false));
// Join the TX FIFO to the RX one now that we don't need it
@@ -234,8 +243,9 @@ void SerialPIO::begin(unsigned long baud, uint16_t config) {
case 2: pio_set_irq0_source_enabled(_rxPIO, pis_sm2_rx_fifo_not_empty, true); break;
case 3: pio_set_irq0_source_enabled(_rxPIO, pis_sm3_rx_fifo_not_empty, true); break;
}
irq_set_exclusive_handler(PIO0_IRQ_0, _fifoIRQ);
irq_set_enabled(PIO0_IRQ_0, true);
auto irqno = pio_get_index(_rxPIO) == 0 ? PIO0_IRQ_0 : PIO1_IRQ_0;
irq_set_exclusive_handler(irqno, _fifoIRQ);
irq_set_enabled(irqno, true);
pio_sm_set_enabled(_rxPIO, _rxSM, true);
}
@@ -258,16 +268,10 @@ int SerialPIO::peek() {
return -1;
}
// If there's something in the FIFO now, just peek at it
uint32_t start = millis();
uint32_t now = millis();
while ((now - start) < _timeout) {
if (_writer != _reader) {
return _queue[_reader];
}
delay(1);
now = millis();
if (_writer != _reader) {
return _queue[_reader];
}
return -1; // Nothing available before timeout
return -1;
}
int SerialPIO::read() {
@@ -275,18 +279,26 @@ int SerialPIO::read() {
if (!_running || !m || (_rx == NOPIN)) {
return -1;
}
uint32_t start = millis();
uint32_t now = millis();
while ((now - start) < _timeout) {
if (_writer != _reader) {
auto ret = _queue[_reader];
_reader = (_reader + 1) % _fifosize;
return ret;
}
delay(1);
now = millis();
if (_writer != _reader) {
auto ret = _queue[_reader];
asm volatile("" ::: "memory"); // Ensure the value is read before advancing
auto next_reader = (_reader + 1) % _fifoSize;
asm volatile("" ::: "memory"); // Ensure the reader value is only written once, correctly
_reader = next_reader;
return ret;
}
return -1; // Timeout
return -1;
}
bool SerialPIO::overflow() {
CoreMutex m(&_mutex);
if (!_running || !m || (_rx == NOPIN)) {
return false;
}
bool hold = _overflow;
_overflow = false;
return hold;
}
int SerialPIO::available() {
@@ -294,7 +306,7 @@ int SerialPIO::available() {
if (!_running || !m || (_rx == NOPIN)) {
return 0;
}
return (_writer - _reader) % _fifosize;
return (_writer - _reader) % _fifoSize;
}
int SerialPIO::availableForWrite() {
+4 -2
View File
@@ -32,7 +32,7 @@ extern "C" typedef struct uart_inst uart_inst_t;
class SerialPIO : public HardwareSerial {
public:
static const pin_size_t NOPIN = 0xff; // Use in constructor to disable RX or TX unit
SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifosize = 32);
SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifoSize = 32);
~SerialPIO();
void begin(unsigned long baud = 115200) override {
@@ -47,6 +47,7 @@ public:
virtual int availableForWrite() override;
virtual void flush() override;
virtual size_t write(uint8_t c) override;
bool overflow();
using Print::write;
operator bool() override;
@@ -60,6 +61,7 @@ private:
int _bits;
uart_parity_t _parity;
int _stop;
bool _overflow;
mutex_t _mutex;
PIOProgram *_txPgm;
@@ -73,7 +75,7 @@ private:
int _rxBits;
// Lockless, IRQ-handled circular queue
size_t _fifosize;
size_t _fifoSize;
uint32_t _writer;
uint32_t _reader;
uint8_t *_queue;
+174 -38
View File
@@ -65,6 +65,47 @@ bool SerialUART::setTX(pin_size_t pin) {
return false;
}
bool SerialUART::setRTS(pin_size_t pin) {
constexpr uint32_t valid[2] = { __bitset({3, 15, 19}) /* UART0 */,
__bitset({7, 11, 23, 27}) /* UART1 */
};
if ((!_running) && ((1 << pin) & valid[uart_get_index(_uart)])) {
_rts = pin;
return true;
}
if (_running) {
panic("FATAL: Attempting to set Serial%d.RTS while running", uart_get_index(_uart) + 1);
} else {
panic("FATAL: Attempting to set Serial%d.RTS to illegal pin %d", uart_get_index(_uart) + 1, pin);
}
return false;
}
bool SerialUART::setCTS(pin_size_t pin) {
constexpr uint32_t valid[2] = { __bitset({2, 14, 18}) /* UART0 */,
__bitset({6, 10, 22, 26}) /* UART1 */
};
if ((!_running) && ((1 << pin) & valid[uart_get_index(_uart)])) {
_cts = pin;
return true;
}
if (_running) {
panic("FATAL: Attempting to set Serial%d.CTS while running", uart_get_index(_uart) + 1);
} else {
panic("FATAL: Attempting to set Serial%d.CTS to illegal pin %d", uart_get_index(_uart) + 1, pin);
}
return false;
}
bool SerialUART::setPollingMode(bool mode) {
if (_running) {
return false;
}
_polling = mode;
return true;
}
bool SerialUART::setFIFOSize(size_t size) {
if (!size || _running) {
return false;
@@ -73,17 +114,24 @@ bool SerialUART::setFIFOSize(size_t size) {
return true;
}
SerialUART::SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx) {
SerialUART::SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx, pin_size_t rts, pin_size_t cts) {
_uart = uart;
_tx = tx;
_rx = rx;
_rts = rts;
_cts = cts;
mutex_init(&_mutex);
mutex_init(&_fifoMutex);
}
static void _uart0IRQ();
static void _uart1IRQ();
void SerialUART::begin(unsigned long baud, uint16_t config) {
if (_running) {
end();
}
_overflow = false;
_queue = new uint8_t[_fifoSize];
_baud = baud;
uart_init(_uart, baud);
@@ -125,17 +173,29 @@ void SerialUART::begin(unsigned long baud, uint16_t config) {
uart_set_format(_uart, bits, stop, parity);
gpio_set_function(_tx, GPIO_FUNC_UART);
gpio_set_function(_rx, GPIO_FUNC_UART);
if (_rts != UART_PIN_NOT_DEFINED) {
gpio_set_function(_rts, GPIO_FUNC_UART);
}
if (_cts != UART_PIN_NOT_DEFINED) {
gpio_set_function(_cts, GPIO_FUNC_UART);
}
uart_set_hw_flow(_uart, _rts != UART_PIN_NOT_DEFINED, _cts != UART_PIN_NOT_DEFINED);
_writer = 0;
_reader = 0;
if (_uart == uart0) {
irq_set_exclusive_handler(UART0_IRQ, _uart0IRQ);
irq_set_enabled(UART0_IRQ, true);
if (!_polling) {
if (_uart == uart0) {
irq_set_exclusive_handler(UART0_IRQ, _uart0IRQ);
irq_set_enabled(UART0_IRQ, true);
} else {
irq_set_exclusive_handler(UART1_IRQ, _uart1IRQ);
irq_set_enabled(UART1_IRQ, true);
}
// Set the IRQ enables and FIFO level to minimum
uart_set_irq_enables(_uart, true, false);
} else {
irq_set_exclusive_handler(UART1_IRQ, _uart1IRQ);
irq_set_enabled(UART1_IRQ, true);
// Polling mode has no IRQs used
}
uart_get_hw(_uart)->imsc |= UART_UARTIMSC_RXIM_BITS | UART_UARTIMSC_RTIM_BITS;
_running = true;
}
@@ -143,14 +203,36 @@ void SerialUART::end() {
if (!_running) {
return;
}
if (_uart == uart0) {
irq_set_enabled(UART0_IRQ, false);
} else {
irq_set_enabled(UART1_IRQ, false);
_running = false;
if (!_polling) {
if (_uart == uart0) {
irq_set_enabled(UART0_IRQ, false);
} else {
irq_set_enabled(UART1_IRQ, false);
}
}
// Paranoia - ensure nobody else is using anything here at the same time
mutex_enter_blocking(&_mutex);
mutex_enter_blocking(&_fifoMutex);
uart_deinit(_uart);
delete[] _queue;
_running = false;
// Reset the mutexes once all is off/cleaned up
mutex_exit(&_fifoMutex);
mutex_exit(&_mutex);
}
void SerialUART::_pumpFIFO() {
// Use the _fifoMutex to guard against the other core potentially
// running the IRQ (since we can't disable their IRQ handler).
// We guard against this core by disabling the IRQ handler and
// re-enabling if it was previously enabled at the end.
auto irqno = (_uart == uart0) ? UART0_IRQ : UART1_IRQ;
bool enabled = irq_is_enabled(irqno);
irq_set_enabled(irqno, false);
mutex_enter_blocking(&_fifoMutex);
_handleIRQ(false);
mutex_exit(&_fifoMutex);
irq_set_enabled(irqno, enabled);
}
int SerialUART::peek() {
@@ -158,16 +240,15 @@ int SerialUART::peek() {
if (!_running || !m) {
return -1;
}
uint32_t start = millis();
uint32_t now = millis();
while ((now - start) < _timeout) {
if (_writer != _reader) {
return _queue[_reader];
}
delay(1);
now = millis();
if (_polling) {
_handleIRQ(false);
} else {
_pumpFIFO();
}
return -1; // Nothing available before timeout
if (_writer != _reader) {
return _queue[_reader];
}
return -1;
}
int SerialUART::read() {
@@ -175,18 +256,30 @@ int SerialUART::read() {
if (!_running || !m) {
return -1;
}
uint32_t start = millis();
uint32_t now = millis();
while ((now - start) < _timeout) {
if (_writer != _reader) {
auto ret = _queue[_reader];
_reader = (_reader + 1) % _fifoSize;
return ret;
}
delay(1);
now = millis();
if (_polling) {
_handleIRQ(false);
} else {
_pumpFIFO();
}
return -1; // Timeout
if (_writer != _reader) {
auto ret = _queue[_reader];
asm volatile("" ::: "memory"); // Ensure the value is read before advancing
auto next_reader = (_reader + 1) % _fifoSize;
asm volatile("" ::: "memory"); // Ensure the reader value is only written once, correctly
_reader = next_reader;
return ret;
}
return -1;
}
bool SerialUART::overflow() {
CoreMutex m(&_mutex);
if (!_running || !m) {
return false;
}
bool hold = _overflow;
_overflow = false;
return hold;
}
int SerialUART::available() {
@@ -194,6 +287,11 @@ int SerialUART::available() {
if (!_running || !m) {
return 0;
}
if (_polling) {
_handleIRQ(false);
} else {
_pumpFIFO();
}
return (_writer - _reader) % _fifoSize;
}
@@ -202,6 +300,9 @@ int SerialUART::availableForWrite() {
if (!_running || !m) {
return 0;
}
if (_polling) {
_handleIRQ(false);
}
return (uart_is_writable(_uart)) ? 1 : 0;
}
@@ -210,6 +311,9 @@ void SerialUART::flush() {
if (!_running || !m) {
return;
}
if (_polling) {
_handleIRQ(false);
}
uart_tx_wait_blocking(_uart);
}
@@ -218,6 +322,9 @@ size_t SerialUART::write(uint8_t c) {
if (!_running || !m) {
return 0;
}
if (_polling) {
_handleIRQ(false);
}
uart_putc_raw(_uart, c);
return 1;
}
@@ -227,6 +334,9 @@ size_t SerialUART::write(const uint8_t *p, size_t len) {
if (!_running || !m) {
return 0;
}
if (_polling) {
_handleIRQ(false);
}
size_t cnt = len;
while (cnt) {
uart_putc_raw(_uart, *p);
@@ -240,8 +350,17 @@ SerialUART::operator bool() {
return _running;
}
#if defined(PIN_SERIAL1_RTS)
SerialUART Serial1(uart0, PIN_SERIAL1_TX, PIN_SERIAL1_RX, PIN_SERIAL1_RTS, PIN_SERIAL1_CTS);
#else
SerialUART Serial1(uart0, PIN_SERIAL1_TX, PIN_SERIAL1_RX);
#endif
#if defined(PIN_SERIAL2_RTS)
SerialUART Serial2(uart1, PIN_SERIAL2_TX, PIN_SERIAL2_RX, PIN_SERIAL2_RTS, PIN_SERIAL2_CTS);
#else
SerialUART Serial2(uart1, PIN_SERIAL2_TX, PIN_SERIAL2_RX);
#endif
void arduino::serialEvent1Run(void) {
if (serialEvent1 && Serial1.available()) {
@@ -255,19 +374,36 @@ void arduino::serialEvent2Run(void) {
}
}
// IRQ handler, called when FIFO > 1/4 full or when it had held unread data for >32 bit times
void __not_in_flash_func(SerialUART::_handleIRQ)() {
uart_get_hw(_uart)->icr |= UART_UARTICR_RTIC_BITS | UART_UARTICR_RXIC_BITS;
// IRQ handler, called when FIFO > 1/8 full or when it had held unread data for >32 bit times
void __not_in_flash_func(SerialUART::_handleIRQ)(bool inIRQ) {
if (inIRQ) {
uint32_t owner;
if (!mutex_try_enter(&_fifoMutex, &owner)) {
// Main app on the other core has the mutex so it is
// in the process of pulling data out of the HW FIFO
return;
}
}
// ICR is write-to-clear
uart_get_hw(_uart)->icr = UART_UARTICR_RTIC_BITS | UART_UARTICR_RXIC_BITS;
while (uart_is_readable(_uart)) {
auto val = uart_getc(_uart);
if ((_writer + 1) % _fifoSize != _reader) {
auto next_writer = _writer + 1;
if (next_writer == _fifoSize) {
next_writer = 0;
}
if (next_writer != _reader) {
_queue[_writer] = val;
asm volatile("" ::: "memory"); // Ensure the queue is written before the written count advances
_writer = (_writer + 1) % _fifoSize;
// Avoid using division or mod because the HW divider could be in use
_writer = next_writer;
} else {
// TODO: Overflow
_overflow = true;
}
}
if (inIRQ) {
mutex_exit(&_fifoMutex);
}
}
static void __not_in_flash_func(_uart0IRQ)() {
+13 -3
View File
@@ -28,19 +28,23 @@
extern "C" typedef struct uart_inst uart_inst_t;
#define UART_PIN_NOT_DEFINED (255u)
class SerialUART : public HardwareSerial {
public:
SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx);
SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx, pin_size_t rts = UART_PIN_NOT_DEFINED, pin_size_t cts = UART_PIN_NOT_DEFINED);
// Select the pinout. Call before .begin()
bool setRX(pin_size_t pin);
bool setTX(pin_size_t pin);
bool setRTS(pin_size_t pin);
bool setCTS(pin_size_t pin);
bool setPinout(pin_size_t tx, pin_size_t rx) {
bool ret = setRX(rx);
ret &= setTX(tx);
return ret;
}
bool setFIFOSize(size_t size);
bool setPollingMode(bool mode = true);
void begin(unsigned long baud = 115200) override {
begin(baud, SERIAL_8N1);
@@ -56,23 +60,29 @@ public:
virtual size_t write(uint8_t c) override;
virtual size_t write(const uint8_t *p, size_t len) override;
using Print::write;
bool overflow();
operator bool() override;
// Not to be called by users, only from the IRQ handler. In public so that the C-language IQR callback can access it
void _handleIRQ();
void _handleIRQ(bool inIRQ = true);
private:
bool _running = false;
uart_inst_t *_uart;
pin_size_t _tx, _rx;
pin_size_t _rts, _cts;
int _baud;
mutex_t _mutex;
bool _polling = false;
bool _overflow;
// Lockless, IRQ-handled circular queue
uint32_t _writer;
uint32_t _reader;
size_t _fifoSize = 32;
uint8_t *_queue;
uint8_t *_queue;
mutex_t _fifoMutex; // Only needed when non-IRQ updates _writer
void _pumpFIFO(); // User space FIFO transfer
};
extern SerialUART Serial1; // HW UART 0
@@ -1,7 +1,7 @@
/*
Millis() for the Raspberry Pi Pico RP2040
SoftwareSerial wrapper for SerialPIO
Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
Copyright (c) 2022 Earle F. Philhower, III <earlephilhower@yahoo.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,12 +18,20 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <pico/time.h>
#pragma once
extern "C" unsigned long millis() {
return to_ms_since_boot(get_absolute_time());
}
#include "SerialPIO.h"
extern "C" unsigned long micros() {
return time_us_32();
}
class SoftwareSerial : public SerialPIO {
public:
// Note the rx/tx pins are swapped in PIO vs SWSerial
SoftwareSerial(pin_size_t rx, pin_size_t tx, bool invert = true) : SerialPIO(tx, rx) {
if (invert) {
panic("SoftwareSerial inverted operation not supported\n");
}
}
void listen() { /* noop */ }
bool isListening() {
return true;
}
};
+4
View File
@@ -20,6 +20,10 @@ typedef enum {
OUTPUT = 0x1,
INPUT_PULLUP = 0x2,
INPUT_PULLDOWN = 0x3,
OUTPUT_2MA = 0x4,
OUTPUT_4MA = 0x5,
OUTPUT_8MA = 0x6,
OUTPUT_12MA = 0x7,
} PinMode;
typedef enum {
@@ -110,11 +110,23 @@ typedef const void* uint_farptr_t;
#define pgm_read_ptr(addr) (*(void *const *)(addr))
#else
// Supports misaligned addresses
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) ((unsigned short)(pgm_read_byte((intptr_t)addr) | (pgm_read_byte((intptr_t)addr + 1) << 8)))
#define pgm_read_dword(addr) ((unsigned long)(pgm_read_byte((intptr_t)addr) | (pgm_read_byte((intptr_t)addr + 1) << 8)) | \
(pgm_read_byte((intptr_t)addr + 2) << 16) | (pgm_read_byte((intptr_t)addr + 3) << 24))
#define pgm_read_ptr(addr) ((void *)pgm_read_dword(addr))
#ifdef __cplusplus
extern "C"{
#endif
static inline unsigned char pgm_read_byte(const void *addr) {
return *(const unsigned char *)(addr);
}
static inline unsigned short pgm_read_word(const void *addr) {
const unsigned char *a = (const unsigned char *)addr;
return pgm_read_byte(a) | ( pgm_read_byte(a + 1) << 8 );
}
static inline unsigned long pgm_read_dword(const void *addr) {
const unsigned char *a = (const unsigned char *)addr;
return pgm_read_byte(a) | ( pgm_read_byte(a + 1) << 8 ) | ( pgm_read_byte(a + 2) << 16 ) | ( pgm_read_byte(a + 3) << 24 );
}
static inline void *pgm_read_ptr(const void *addr) {
return (void*) pgm_read_dword(addr);
}
static inline float pgm_read_float(const void *addr) {
union {
void *p;
@@ -123,6 +135,10 @@ static inline float pgm_read_float(const void *addr) {
x.p = pgm_read_ptr(addr);
return x.f;
}
#ifdef __cplusplus
}
#endif
#endif
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
+62
View File
@@ -0,0 +1,62 @@
; Cycle Count for the Raspberry Pi Pico RP2040
;
; Copyright (c) 2022 Earle F. Philhower, III <earlephilhower@yahoo.com>
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2.1 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
; Cycle count is stored in {-y, -x}
.program ccount
cnt:
jmp x-- cnt
epoch:
jmp y-- cnt
% c-sdk {
static inline void ccount_program_init(PIO pio, uint sm, uint offset) {
pio_sm_config c = ccount_program_get_default_config(offset);
pio_sm_init(pio, sm, offset, &c);
pio_sm_exec(pio, sm, pio_encode_set(pio_x, 0));
pio_sm_exec(pio, sm, pio_encode_set(pio_y, 0));
}
static inline uint64_t ccount_read(PIO pio, uint sm) {
static uint64_t extra = 0;
// Guard against having the epoch rollover while we're reading the time.
// If epoch2 != epoch1, we looped in middle and get new LSW
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_y));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_x));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_y));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_x));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
extra += 8;
uint32_t y1 = -((int)pio_sm_get_blocking(pio, sm));
uint32_t x1 = -((int)pio_sm_get_blocking(pio, sm));
uint32_t y2 = -((int)pio_sm_get_blocking(pio, sm));
uint32_t x2 = -((int)pio_sm_get_blocking(pio, sm));
uint64_t val;
if (y2 != y1) {
val = ((((uint64_t)y2) << 32LL) | x2) + y2 /* adjust for missed cycle every epoch increment */;
} else {
val = ((((uint64_t)y1) << 32LL) | x1) + y1 /* adjust for missed cycle every epoch increment */;
}
return val + extra;
}
%}
+71
View File
@@ -0,0 +1,71 @@
// -------------------------------------------------- //
// This file is autogenerated by pioasm; do not edit! //
// -------------------------------------------------- //
#pragma once
#if !PICO_NO_HARDWARE
#include "hardware/pio.h"
#endif
// ------ //
// ccount //
// ------ //
#define ccount_wrap_target 0
#define ccount_wrap 1
static const uint16_t ccount_program_instructions[] = {
// .wrap_target
0x0040, // 0: jmp x--, 0
0x0080, // 1: jmp y--, 0
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program ccount_program = {
.instructions = ccount_program_instructions,
.length = 2,
.origin = -1,
};
static inline pio_sm_config ccount_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + ccount_wrap_target, offset + ccount_wrap);
return c;
}
static inline void ccount_program_init(PIO pio, uint sm, uint offset) {
pio_sm_config c = ccount_program_get_default_config(offset);
pio_sm_init(pio, sm, offset, &c);
pio_sm_exec(pio, sm, pio_encode_set(pio_x, 0));
pio_sm_exec(pio, sm, pio_encode_set(pio_y, 0));
}
static inline uint64_t ccount_read(PIO pio, uint sm) {
static uint64_t extra = 0;
// Guard against having the epoch rollover while we're reading the time.
// If epoch2 != epoch1, we looped in middle and get new LSW
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_y));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_x));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_y));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_isr, pio_x));
pio_sm_exec(pio, sm, pio_encode_push(false, false));
extra += 8;
uint32_t y1 = -((int)pio_sm_get_blocking(pio, sm));
uint32_t x1 = -((int)pio_sm_get_blocking(pio, sm));
uint32_t y2 = -((int)pio_sm_get_blocking(pio, sm));
uint32_t x2 = -((int)pio_sm_get_blocking(pio, sm));
uint64_t val;
if (y2 != y1) {
val = ((((uint64_t)y2) << 32LL) | x2) + y2 /* adjust for missed cycle every epoch increment */;
} else {
val = ((((uint64_t)y1) << 32LL) | x1) + y1 /* adjust for missed cycle every epoch increment */;
}
return val + extra;
}
#endif
+3
View File
@@ -25,6 +25,9 @@
#include "Adafruit_TinyUSB_API.h"
#endif
extern "C" void delay(unsigned long ms) __attribute__((weak));
extern "C" void yield() __attribute__((weak));
extern "C"
{
+62 -29
View File
@@ -24,24 +24,28 @@
#include <pico/multicore.h>
RP2040 rp2040;
extern "C" {
volatile bool __otherCoreIdled = false;
};
volatile bool _MFIFO::_otherIdled = false;
mutex_t _pioMutex;
extern void setup();
extern void loop();
// FreeRTOS potential includes
extern void initFreeRTOS() __attribute__((weak));
extern void startFreeRTOS() __attribute__((weak));
bool __isFreeRTOS;
// Weak empty variant initialization. May be redefined by variant files.
void initVariant() __attribute__((weak));
void initVariant() { }
// Optional 2nd core setup and loop
extern void setup1() __attribute__((weak));
extern void loop1() __attribute__((weak));
static void main1() {
extern "C" void main1() {
rp2040.fifo.registerCore();
if (setup1) {
setup1();
@@ -53,14 +57,40 @@ static void main1() {
}
}
extern void __loop() {
#ifdef USE_TINYUSB
yield();
#endif
if (arduino::serialEventRun) {
arduino::serialEventRun();
}
if (arduino::serialEvent1Run) {
arduino::serialEvent1Run();
}
if (arduino::serialEvent2Run) {
arduino::serialEvent2Run();
}
}
extern "C" int main() {
#if F_CPU != 125000000
set_sys_clock_khz(F_CPU / 1000, true);
#endif
// Let rest of core know if we're using FreeRTOS
__isFreeRTOS = initFreeRTOS ? true : false;
mutex_init(&_pioMutex);
rp2040.begin();
initVariant();
if (__isFreeRTOS) {
initFreeRTOS();
}
#ifndef NO_USB
#ifdef USE_TINYUSB
TinyUSB_Device_Init(0);
@@ -69,43 +99,46 @@ extern "C" int main() {
__USBStart();
#ifndef DISABLE_USB_SERIAL
// Enable serial port for reset/upload always
Serial.begin(115200);
if (!__isFreeRTOS) {
// Enable serial port for reset/upload always
Serial.begin(115200);
}
#endif
#endif
#endif
#if defined DEBUG_RP2040_PORT
DEBUG_RP2040_PORT.begin(115200);
if (!__isFreeRTOS) {
DEBUG_RP2040_PORT.begin(115200);
}
#endif
#ifndef NO_USB
if (setup1 || loop1) {
rp2040.fifo.begin(2);
multicore_launch_core1(main1);
} else {
rp2040.fifo.begin(1);
if (!__isFreeRTOS) {
if (setup1 || loop1) {
rp2040.fifo.begin(2);
multicore_launch_core1(main1);
} else {
rp2040.fifo.begin(1);
}
rp2040.fifo.registerCore();
}
rp2040.fifo.registerCore();
#endif
setup();
while (true) {
loop();
#ifdef USE_TINYUSB
yield();
#endif
if (arduino::serialEventRun) {
arduino::serialEventRun();
}
if (arduino::serialEvent1Run) {
arduino::serialEvent1Run();
}
if (arduino::serialEvent2Run) {
arduino::serialEvent2Run();
if (!__isFreeRTOS) {
setup();
while (true) {
loop();
__loop();
}
} else {
rp2040.fifo.begin(2);
startFreeRTOS();
}
return 0;
}
extern "C" unsigned long ulMainGetRunTimeCounterValue() {
return rp2040.getCycleCount64();
}
+12 -4
View File
@@ -27,7 +27,7 @@
#include <hardware/adc.h>
static uint32_t analogScale = 255;
static uint16_t analogFreq = 1000;
static uint32_t analogFreq = 1000;
static bool pwmInitted = false;
static bool adcInitted = false;
static uint16_t analogWritePseudoScale = 1;
@@ -42,9 +42,9 @@ extern "C" void analogWriteFreq(uint32_t freq) {
if (freq < 100) {
DEBUGCORE("ERROR: analogWriteFreq too low (%d)\n", freq);
analogFreq = 100;
} else if (freq > 60000) {
} else if (freq > 1000000) {
DEBUGCORE("ERROR: analogWriteFreq too high (%d)\n", freq);
analogFreq = 60000;
analogFreq = 1000000;
} else {
analogFreq = freq;
}
@@ -117,6 +117,7 @@ extern "C" void analogWrite(pin_size_t pin, int val) {
}
auto_init_mutex(_adcMutex);
static int _readBits = 10;
extern "C" int analogRead(pin_size_t pin) {
CoreMutex m(&_adcMutex);
@@ -133,7 +134,7 @@ extern "C" int analogRead(pin_size_t pin) {
}
adc_gpio_init(pin);
adc_select_input(pin - minPin);
return adc_read();
return (_readBits < 12) ? adc_read() >> (12 - _readBits) : adc_read() << (_readBits - 12);
}
extern "C" float analogReadTemp() {
@@ -153,3 +154,10 @@ extern "C" float analogReadTemp() {
float t = 27.0f - ((v * 3.3f / 4096.0f) - 0.706f) / 0.001721f; // From the datasheet
return t;
}
extern "C" void analogReadResolution(int bits) {
CoreMutex m(&_adcMutex);
if (m && ((bits > 0) && (bits < 32))) {
_readBits = bits;
}
}
+17
View File
@@ -43,7 +43,24 @@ extern "C" void pinMode(pin_size_t ulPin, PinMode ulMode) {
gpio_put(ulPin, 1);
break;
case OUTPUT:
case OUTPUT_4MA:
gpio_init(ulPin);
gpio_set_drive_strength(ulPin, GPIO_DRIVE_STRENGTH_4MA);
gpio_set_dir(ulPin, true);
break;
case OUTPUT_2MA:
gpio_init(ulPin);
gpio_set_drive_strength(ulPin, GPIO_DRIVE_STRENGTH_2MA);
gpio_set_dir(ulPin, true);
break;
case OUTPUT_8MA:
gpio_init(ulPin);
gpio_set_drive_strength(ulPin, GPIO_DRIVE_STRENGTH_8MA);
gpio_set_dir(ulPin, true);
break;
case OUTPUT_12MA:
gpio_init(ulPin);
gpio_set_drive_strength(ulPin, GPIO_DRIVE_STRENGTH_12MA);
gpio_set_dir(ulPin, true);
break;
default:
+12 -1
View File
@@ -30,10 +30,21 @@ While up to 16 PWM channels can be generated, they are not independent
and there are significant restrictions as to allowed pins in parallel.
See the `RP2040 datasheet <https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf>`_ for full details.
Analog Output Restrictions
--------------------------
The PWM generator source clock restricts the legal combinations of
frequency and ranges. For example, at 1MHz only about 6 bits of range
are possible. When you define an ``analogWriteFreq`` and ``analogWriteRange``
that can't be fulfilled by the hardware, the frequency will be preserved
but the accuracy (range) will be reduced automatically. Your code will
still send in the range you specify, but the core itself will transparently
map it into the allowable PWN range.
void analogWriteFreq(uint32_t freq)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the master PWM frequency used (i.e. how often the PWM output cycles).
From 100Hz to 60KHz are supported.
From 100Hz to 1MHz are supported.
void analogWriteRange(uint32_t range) and analogWriteResolution(int res)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+4 -4
View File
@@ -19,7 +19,7 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
# -- General configuration ------------------------------------------------
@@ -30,7 +30,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinx_rtd_theme']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -46,7 +46,7 @@ master_doc = 'index'
# General information about the project.
project = u'Arduino-Pico'
copyright = u'2021, Earle F. Philhower, III'
copyright = u'2022, Earle F. Philhower, III'
author = u'Earle F. Philhower, III'
# The version info for the project you're documenting, acts as replacement for
@@ -82,7 +82,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
+49
View File
@@ -0,0 +1,49 @@
FreeRTOS SMP
============
The SMP (multicore) port of FreeRTOS is included with the core. This allows complex
task operations and real preemptive multithreading in your sketches. While the
``setup1`` and ``loop1`` way of multitasking is simplest for most folks, FreeRTOS
is much more powerful.
Enabling FreeRTOS
-----------------
To enable FreeRTOS, simply add
.. code:: c++
#include <FreeRTOS.h>
to your sketch and it will be included and enabled automatically.
Configuration and Predefined Tasks
----------------------------------
FreeRTOS is configured with 8 priority levels (0 through 7) and a process for
``setup()/loop()``, ``setup1()/loop1()``, and the USB port will be created. The task
quantum is 1 millisecond (i.e. 1,000 switches per second).
``setup()`` and ``loop()`` are assigned to only run on core 0, while ``setup1()`` and ``loop1()``
only run in core 1 in this mode, the same as the default multithreading mode.
You can launch and manage additional processes using the standard FreeRTOS routines.
``delay()`` and ``yield()`` free the CPU for other tasks, while ``delayMicroseconds()`` does not.
Caveats
-------
While the core now supports FreeRTOS, most (probably all) Arduino libraries were not written
to support preemptive multithreading. This means that all calls to a particular library should
be made from a single task.
In particular, the ``LittleFS`` and ``SDFS`` libraries can not be called from different
threads. Do all ``File`` operations from a single thread or else undefined behavior
(aka strange crashes or data corruption) can occur.
More Information
----------------
For full FreeRTOS documentation look at `FreeRTOS.org <https://freertos.org/index.html>`__
and `FreeRTOS SMP support <https://freertos.org/symmetric-multiprocessing-introduction.html>`__.
+37
View File
@@ -34,3 +34,40 @@ Debug messages from `printf` and the Core can be printed to a Serial port
to allow for easier debugging. Select the desired port and verbosity.
Selecting a port for debug output does not stop a sketch from using it
for normal operations.
Generic RP2040 Support
----------------------
If your RP2040 board isn't in the menus you can still use it with the
IDE bu using the `Board->Generic RP2040` menu option. You will need to
then set the flash size (see above) and tell the IDE how to communicate
with the flash chip using the `Tools->Boot Stage 2` menu.
Boot Stage 2 Options for Generic RP2040
---------------------------------------
The Arduino Pico needs to set up its internal flash interface to talk to
whatever flash chip is in the system. While all flash chips support a
basic (and slow) 1-bit operation using common timings, each different
brand (and sometimes model) of flash chip require custom timings to work
in QSPI (4-bit) mode. The `Boot Stage 2` menu lets you select from
the supported timings.
The options with `/2` in them divide the system clock by 2 to drive the
bus. Options with `/4` divide the clock by 4 and so are slower but more
compatible.
If you can't match a chip name in the menu to your flash chip, a simple
test can be run to determine which is correct. Simpily load the `Blink`
example, select the first option in the `Boot Stage 2` menu, and upload.
If that works, note it and continue. Iterate through the options and
note which ones work. If an option doesn't work, unplug the chip and
hold the BOOTSEL button down while re-inserting it to enter the ROM
uploader mode. (The CPU and flash will not be harmed if the test fails.)
If one of the custom bootloaders (not `Generic SPI /2 or /4`) worked, use
that option to get best performance. If none worked other than the
`Generic SPI /2 or /4` then use that. The `/2` options of all models
is preferred as it is faster, but some boards do require `/4` on the
custom chip interfaces.
When in doubt, `Generic SPI /4` should work with any flash chip but is
slow.
+2
View File
@@ -37,6 +37,8 @@ For the latest version, always check https://github.com/earlephilhower/arduino-p
USB (Arduino and Adafruit_TinyUSB) <usb>
Multicore Processing <multicore>
FreeRTOS SMP (multicore) <freertos>
Ported/Optimized Libraries <libraries>
Using Pico-SDK <sdk>
+10 -4
View File
@@ -41,6 +41,12 @@ void rp2040.resumeOtherCore()
Resumes processing in the other core, where it left off.
void rp2040.restartCore1()
~~~~~~~~~~~~~~~~~~~~~~~~~~
Hard resets Core1 from Core 0 and restarts its operation from ``setup1()``.
Communicating Between Cores
---------------------------
@@ -50,23 +56,23 @@ use the following functions to access a software-managed, multicore safe
FIFO.
void rp2040.fifo.push(uint32_t)
~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pushes a value to the other core. Will block if the FIFO is full.
bool rp2040.fifo.push_nb(uint32_t)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pushes a value to the other core. If the FIFO is full, returns ``false``
immediately and doesn't block. If the push is successful, returns ``true``.
uint32_t rp2040.fifo.pop()
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~
Reads a value from this core's FIFO. Blocks until one is available.
bool rp2040.fifo.pop_nb(uint32_t *dest)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reads a value from this core's FIFO and places it in dest. Will return
``true`` if successful, or ``false`` if the pop would block.
+6
View File
@@ -26,6 +26,8 @@ Serial1 (UART0), Serial2 (UART1)
::setRX(pin)
::setTX(pin)
::setRTS(pin)
::setCTS(pin)
SPI (SPI0), SPI1 (SPI1)
-----------------------
@@ -59,3 +61,7 @@ it use a non-default pinout with a simple call
SD.begin(5);
}
Pad Strength
============
The Raspberry Pi Pico has the ability to set the current that a pin (actually the pad associated with it) is capable of supplying. The current can be set to values of 2mA, 4mA, 8mA and 12mA. By default, on a reset, the setting is 4mA. A `pinMode(x, OUTPUT)`, where `x` is the pin number, is also the default setting. 4 settings have been added for use with `pinMode`: `OUTPUT_2MA`, `OUTPUT_4MA`, which has the same behavior as `OUTPUT`, `OUTPUT_8MA` and `OUTPUT_12MA`.
+10
View File
@@ -21,3 +21,13 @@ For example, to make a transmit-only port on GP16
For detailed information about the Serial ports, see the
Arduino `Serial Reference <https://www.arduino.cc/reference/en/language/functions/communication/serial/>`_ .
SoftwareSerial Emulation
========================
A ``SoftwareSerial`` wrapper is included to provide plug-and-play compatibility
with the Arduino `Software Serial <https://docs.arduino.cc/learn/built-in-libraries/software-serial>`_
library. Use the normal ``#include <SoftwareSerial.h>`` to include it. The following
differences from the Arduino standard are present:
* Inverted mode is not supported
* All ports are always listening. The ``listen`` call is a no-op, and ``isListening()`` always returns ``true`` .
+11
View File
@@ -31,5 +31,16 @@ using the ``setFIFOSize`` call prior to calling ``begin()``
Serial1.setFIFOSize(128);
Serial1.begin(baud);
The FIFO is normally handled via an interrupt, which reduced CPU load and
makes it less likely to lose characters. However, the FIFO introduces up
to 32 bit-times of delay before serial data is available to the application.
For applications where this is an issue (i.e. very low baud), use
``setPollingMode(true)`` before calling ``begin()``
.. code:: cpp
Serial1.setPollingMode(true);
Serial1.begin(110)
For detailed information about the Serial ports, see the
Arduino `Serial Reference <https://www.arduino.cc/reference/en/language/functions/communication/serial/>`_ .
+7 -1
View File
@@ -11,7 +11,7 @@
#######################################
setup1 KEYWORD2
loop2 KEYWORD2
loop1 KEYWORD2
analogWriteFreq KEYWORD2
analogWriteRange KEYWORD2
@@ -35,3 +35,9 @@ PIOProgram KEYWORD2
prepare KEYWORD2
SerialPIO KEYWORD2
setFIFOSize KEYWORD2
setPollingMode KEYWORD2
OUTPUT_2MA LITERAL1
OUTPUT_4MA LITERAL1
OUTPUT_8MA LITERAL1
OUTPUT_12MA LITERAL1
BIN
View File
Binary file not shown.
+1
View File
@@ -28,6 +28,7 @@
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_flash/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_gpio/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_i2c/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_interp/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_irq/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_rtc/include
-iwithprefixbefore/pico-sdk/src/rp2_common/hardware_pio/include
@@ -0,0 +1,81 @@
// Demonstrates a simple use of the setup1()/loop1() functions
// for a multiprocessor run.
// Will output something like, where C0 is running on core 0 and
// C1 is on core 1, in parallel.
// 11:23:07.507 -> C0: Blue leader standing by...
// 11:23:07.507 -> C1: Red leader standing by...
// 11:23:07.507 -> C1: Stay on target...
// 11:23:08.008 -> C1: Stay on target...
// 11:23:08.505 -> C0: Blue leader standing by...
// 11:23:08.505 -> C1: Stay on target...
// 11:23:09.007 -> C1: Stay on target...
// 11:23:09.511 -> C0: Blue leader standing by...
// 11:23:09.511 -> C1: Stay on target...
// 11:23:10.015 -> C1: Stay on target...
// Released to the public domain
#include <FreeRTOS.h>
#include <task.h>
#include <map>
#include <EEPROM.h>
std::map<eTaskState, const char *> eTaskStateName { {eReady, "Ready"}, { eRunning, "Running" }, {eBlocked, "Blocked"}, {eSuspended, "Suspended"}, {eDeleted, "Deleted"} };
void ps() {
int tasks = uxTaskGetNumberOfTasks();
TaskStatus_t *pxTaskStatusArray = new TaskStatus_t[tasks];
unsigned long runtime;
tasks = uxTaskGetSystemState( pxTaskStatusArray, tasks, &runtime );
Serial.printf("# Tasks: %d\n", tasks);
Serial.println("ID, NAME, STATE, PRIO, CYCLES");
for (int i=0; i < tasks; i++) {
Serial.printf("%d: %-16s %-10s %d %lu\n", i, pxTaskStatusArray[i].pcTaskName, eTaskStateName[pxTaskStatusArray[i].eCurrentState], pxTaskStatusArray[i].uxCurrentPriority, pxTaskStatusArray[i].ulRunTimeCounter);
}
delete[] pxTaskStatusArray;
}
void blink(void *param) {
(void) param;
pinMode(LED_BUILTIN, OUTPUT);
while (true) {
digitalWrite(LED_BUILTIN, LOW);
delay(750);
digitalWrite(LED_BUILTIN, HIGH);
delay(250);
}
}
void setup() {
Serial.begin(115200);
xTaskCreate(blink, "BLINK", 128, nullptr, 1, nullptr);
delay(5000);
}
volatile int val= 0;
void loop() {
Serial.printf("C0: Blue leader standing by...\n");
ps();
Serial.printf("val: %d\n", val);
delay(1000);
}
// Running on core1
void setup1() {
delay(5000);
Serial.printf("C1: Red leader standing by...\n");
}
void loop1() {
static int x = 0;
Serial.printf("C1: Stay on target...\n");
val++;
if (++x < 10) {
EEPROM.begin(512);
EEPROM.write(0,x);
EEPROM.commit();
}
delay(1000);
}
+60
View File
@@ -0,0 +1,60 @@
# Syntax Coloring Map For FreeRTOS
# https://arduino.github.io/arduino-cli/library-specification/#keywords
# Formatted by a single true tab (not spaces)
# Datatypes (KEYWORD1)
StackType_t KEYWORD1
BaseType_t KEYWORD1
UBaseType_t KEYWORD1
TickType_t KEYWORD1
TaskHandle_t KEYWORD1
QueueHandle_t KEYWORD1
TimerHandle_t KEYWORD1
SemaphoreHandle_t KEYWORD1
StreamBufferHandle_t KEYWORD1
MessageBufferHandle_t KEYWORD1
EventGroupHandle_t KEYWORD1
# Methods and Functions (KEYWORD2)
xSemaphoreCreateMutex KEYWORD2
xSemaphoreCreateBinary KEYWORD2
xSemaphoreTake KEYWORD2
xSemaphoreTakeFromISR KEYWORD2
xSemaphoreGive KEYWORD2
xSemaphoreGiveFromISR KEYWORD2
xTaskCreate KEYWORD2
vTaskDelete KEYWORD2
vTaskDelay KEYWORD2
xTaskDelayUntil KEYWORD2
xQueueCreate KEYWORD2
xQueueSend KEYWORD2
xQueueReceive KEYWORD2
pcTaskGetName KEYWORD2
ulTaskNotifyTake KEYWORD2
vTaskNotifyGiveFromISR KEYWORD2
taskYIELD KEYWORD2
vTaskSuspend KEYWORD2
vTaskResume KEYWORD2
xTaskResumeFromISR KEYWORD2
xTaskGetTickCount KEYWORD2
xTaskGetTickCountFromISR KEYWORD2
uxTaskGetNumberOfTasks KEYWORD2
uxTaskGetStackHighWaterMark KEYWORD2
# Instances (KEYWORD2)
# Structures (KEYWORD3)
TaskParameters_t KEYWORD3
TaskStatus_t KEYWORD3
ListItem_t KEYWORD3
MiniListItem_t KEYWORD3
HeapStats_t KEYWORD3
# Constants (LITERAL1)
portUSE_WDTO LITERAL1
portTICK_PERIOD_MS LITERAL1
configTICK_RATE_HZ LITERAL1
configCPU_CLOCK_HZ LITERAL1
configMAX_PRIORITIES LITERAL1
configMINIMAL_STACK_SIZE LITERAL1
+10
View File
@@ -0,0 +1,10 @@
name=FreeRTOS
version=1.0.0
author=Graham Sanderson <info@freertos.org>
maintainer=Graham Sanderson <info@freertos.org>
sentence=<h3>FreeRTOS Real Time Operating System implemented for RP2040.</h3>
paragraph=Taken from the official FreeRTOS SMP branch.
category=Timing
url=https://github.com/FreeRTOS/FreeRTOS-Kernel
architectures=rp2040
license=MIT
+39
View File
@@ -0,0 +1,39 @@
**ATTENTION**
Please be aware that this library was copied from the original Arduino AVR FreeRTOS library and may still contain files from that library that have no meaning in the context of this package, i.e. the licensing and code of conduct file! Each file retains the license and copyright from where it was taken (FreeRTOS repository or AVR FreeRTOS library, respectively.)
______
This is a copy of the RP2040 port of the FreeRTOS SMP branch, packaged as an Arduino library.
It has been created to provide access to FreeRTOS capabilities, with full compatibility to the Arduino environment.
It does this by keeping hands off almost everything, and only touching the minimum of hardware to be successful.
## General
FreeRTOS has a multitude of configuration options, which can be specified from within the FreeRTOSConfig.h file.
To keep commonality with all of the Arduino hardware options, some sensible defaults have been selected.
System ticks are 1ms, which means that Tasks can only be scheduled to run up to 1000 times per second.
Stack for the `loop()` function has been set at 256 bytes. This can be configured by adjusting the `configMINIMAL_STACK_SIZE` parameter. If you have stack overflow issues, just increase it.
Users should prefer to allocate larger structures, arrays, or buffers using `pvPortMalloc()`, rather than defining them locally on the stack.
Memory for the heap is allocated by the normal `malloc()` function, wrapped by `pvPortMalloc()`.
This option has been selected because it is automatically adjusted to use the capabilities of each device.
Other heap allocation schemes are supported by FreeRTOS, and they can used with additional configuration.
## Errors
* Stack Overflow: If any stack (for the `loop()` or) for any Task overflows, there will be a slow LED blink, with 4 second cycle.
* Heap Overflow: If any Task tries to allocate memory and that allocation fails, there will be a fast LED blink, with 100 millisecond cycle.
## Files & Configuration
* `RP2040_FreeRTOS.h` : Must always be `#include` first. It references other configuration files, and sets defaults where necessary.
* `FreeRTOSConfig.h` : Contains a multitude of API and environment configurations.
* `variantHooks.cpp` : Contains the RP2040 specific configurations for this port of FreeRTOS.
* `heap_3.c` : Contains the heap allocation scheme based on `malloc()`. Other schemes are available, but depend on user configuration for specific MCU choice.
## Sources / Credits ✨
This library is built on the efforts of the authors of the FreeRTOS SMP port for the RP2040, using the original Arduino FreeRTOS library as a template for the library package and the Arduino specific behavior.
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/FreeRTOS.h"
+122
View File
@@ -0,0 +1,122 @@
/* Cores */
#define configNUM_CORES 2
#define configUSE_CORE_AFFINITY 1
#define configRUN_MULTIPLE_PRIORITIES 1
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_MINIMAL_IDLE_HOOK 1
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) F_CPU )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 8 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 164 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_QUEUE_SETS 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configSUPPORT_STATIC_ALLOCATION 0
/* Run time stats related definitions. */
void vMainConfigureTimerForRunTimeStats( void );
unsigned long ulMainGetRunTimeCounterValue( void );
#define configGENERATE_RUN_TIME_STATS 1
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() //vMainConfigureTimerForRunTimeStats()
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 1
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Software timer definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( 80 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_eTaskGetState 1
/* This demo makes use of one or more example stats formatting functions. These
format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
#define configUSE_MUTEXES 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define configUSE_MALLOC_FAILED_HOOK 1
#define configCHECK_FOR_STACK_OVERFLOW 2
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
/* Cortex-M specific definitions. */
#undef __NVIC_PRIO_BITS
#ifdef __NVIC_PRIO_BITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#define configPRIO_BITS 3 /* 8 priority levels */
#endif
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
extern void rtosFatalError(void);
#define configASSERT( x ) \
if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); rtosFatalError(); }
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names - or at least those used in the unmodified vector table. */
//#define xPortPendSVHandler PendSV_Handler
//#define xPortSysTickHandler SysTick_Handler
//#define vPortSVCHandler SVC_Handler
/* The size of the global output buffer that is available for use when there
are multiple command interpreters running at once (for example, one on a UART
and one on TCP/IP). This is done to prevent an output buffer being defined by
each implementation - which would waste RAM. In this case, there is only one
command interpreter running. */
#define configCOMMAND_INT_MAX_OUTPUT_SIZE 2048
#define configUSE_DYNAMIC_EXCEPTION_HANDLERS 0
#define configSUPPORT_PICO_SYNC_INTEROP 1
#define configSUPPORT_PICO_TIME_INTEROP 1
#include "rp2040_config.h"
//#include "task.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/StackMacros.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/atomic.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/croutine.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/croutine.h"
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/deprecated_definitions.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/event_groups.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/event_groups.h"
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/freertos_sdk_config.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/portable/MemMang/heap_3.c"
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/idle_task_static_memory.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/list.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/list.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/message_buffer.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/mpu_prototypes.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/mpu_wrappers.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/port.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/portable.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/projdefs.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/queue.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/queue.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/rp2040_config.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/semphr.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/stack_macros.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/stream_buffer.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/stream_buffer.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/task.h"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/tasks.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/timers.c"
+1
View File
@@ -0,0 +1 @@
#include "../lib/FreeRTOS-Kernel/include/timers.h"
+419
View File
@@ -0,0 +1,419 @@
/*
* Copyright (C) 2021 Phillip Stevens All Rights Reserved.
* Modifications by Earle F. Philhower, III, for Arduino-Pico
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* This file is NOT part of the FreeRTOS distribution.
*
*/
#include <stdlib.h>
/* Arduino Core includes */
#include <Arduino.h>
#include <RP2040USB.h>
#include "tusb.h"
#define USB_TASK_IRQ 31
/* Raspberry PI Pico includes */
#include <pico.h>
#include <pico/time.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
/*-----------------------------------------------------------*/
void initFreeRTOS(void)
{
}
extern void setup() __attribute__((weak));
extern void loop() __attribute__((weak));
extern void setup1() __attribute__((weak));
extern void loop1() __attribute__((weak));
// Idle functions (USB, events, ...) from the core
extern void __loop();
volatile bool __usbInitted = false;
static void __core0(void *params)
{
(void) params;
#ifndef NO_USB
while (!__usbInitted) {
delay(1);
}
#endif
if (setup) {
setup();
}
if (loop) {
while (1) {
loop();
__loop();
}
} else {
while (1) {
__loop();
}
}
}
static void __core1(void *params)
{
(void) params;
#ifndef NO_USB
while (!__usbInitted) {
delay(1);
}
#endif
if (setup1) {
setup1();
}
if (loop1) {
while (1) {
loop1();
}
} else {
while (1) {
vTaskDelay(1000);
}
}
}
extern "C" void delay(unsigned long ms) {
vTaskDelay(ms / portTICK_PERIOD_MS);
}
extern "C" void yield() {
taskYIELD();
}
extern mutex_t __usb_mutex;
static TaskHandle_t __usbTask;
static void __usb(void *param);
void startFreeRTOS(void)
{
TaskHandle_t c0;
xTaskCreate(__core0, "CORE0", 1024, 0, configMAX_PRIORITIES / 2, &c0);
vTaskCoreAffinitySet( c0, 1 << 0 );
if (setup1 || loop1) {
TaskHandle_t c1;
xTaskCreate(__core1, "CORE1", 1024, 0, configMAX_PRIORITIES / 2, &c1);
vTaskCoreAffinitySet( c1, 1 << 1 );
}
// Initialise and run the freeRTOS scheduler. Execution should never return here.
vTaskStartScheduler();
while (true) {
/* noop */
}
}
/*-----------------------------------------------------------*/
void prvDisableInterrupts()
{
portDISABLE_INTERRUPTS();
}
void prvEnableInterrupts()
{
portENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
#if ( configUSE_IDLE_HOOK == 1 )
/*
* Call the user defined loop() function from within the idle task.
* This allows the application designer to add background functionality
* without the overhead of a separate task.
*
* NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.
*
*/
extern "C"
void vApplicationIdleHook( void ) __attribute__((weak));
void vApplicationIdleHook( void )
{
__wfe(); // Low power idle if nothing to do...
}
#endif /* configUSE_IDLE_HOOK == 1 */
/*-----------------------------------------------------------*/
#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
/*
* Call the user defined minimalIdle() function from within the idle task.
* This allows the application designer to add background functionality
* without the overhead of a separate task.
*
* NOTE: vApplicationMinimalIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.
*
*/
void minimalIdle( void ) __attribute__((weak));
void minimalIdle() {} //Empty minimalIdle function
extern "C"
void vApplicationMinimalIdleHook( void ) __attribute__((weak));
void vApplicationMinimalIdleHook( void )
{
minimalIdle();
}
#endif /* configUSE_MINIMAL_IDLE_HOOK == 1 */
/*-----------------------------------------------------------*/
#if ( configUSE_TICK_HOOK == 1 )
/*
* Call the user defined minimalIdle() function from within the idle task.
* This allows the application designer to add background functionality
* without the overhead of a separate task.
*
* NOTE: vApplicationMinimalIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.
*
*/
void tick( void ) __attribute__((weak));
void tick() {} //Empty minimalIdle function
extern "C"
void vApplicationTickHook( void ) __attribute__((weak));
void vApplicationTickHook( void )
{
tick();
}
#endif /* configUSE_TICK_HOOK == 1 */
/*-----------------------------------------------------------*/
#if ( configUSE_MALLOC_FAILED_HOOK == 1 || configCHECK_FOR_STACK_OVERFLOW >= 1 || configDEFAULT_ASSERT == 1 )
/**
* Private function to enable board led to use it in application hooks
*/
void prvSetMainLedOn( void )
{
gpio_init(LED_BUILTIN);
gpio_set_dir(LED_BUILTIN, true);
gpio_put(LED_BUILTIN, true);
}
/**
* Private function to blink board led to use it in application hooks
*/
void prvBlinkMainLed( void )
{
gpio_put(LED_BUILTIN, !gpio_get(LED_BUILTIN));
}
#endif
/*---------------------------------------------------------------------------*\
Usage:
called on fatal error (interrupts disabled already)
\*---------------------------------------------------------------------------*/
extern "C"
void rtosFatalError(void)
{
prvSetMainLedOn(); // Main LED on.
for(;;)
{
// Main LED slow flash
sleep_ms(100);
prvBlinkMainLed();
sleep_ms(2000);
prvBlinkMainLed();
}
}
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
/*---------------------------------------------------------------------------*\
Usage:
called by task system when a malloc failure is noticed
Description:
Malloc failure handler -- Shut down all interrupts, send serious complaint
to command port. FAST Blink on main LED.
Arguments:
pxTask - pointer to task handle
pcTaskName - pointer to task name
Results:
<none>
Notes:
This routine will never return.
This routine is referenced in the task.c file of FreeRTOS as an extern.
\*---------------------------------------------------------------------------*/
extern "C"
void vApplicationMallocFailedHook( void ) __attribute__((weak));
void vApplicationMallocFailedHook( void )
{
prvSetMainLedOn(); // Main LED on.
for(;;)
{
sleep_ms(50);
prvBlinkMainLed(); // Main LED fast blink.
}
}
#endif /* configUSE_MALLOC_FAILED_HOOK == 1 */
/*-----------------------------------------------------------*/
#if ( configCHECK_FOR_STACK_OVERFLOW >= 1 )
extern "C"
void vApplicationStackOverflowHook( TaskHandle_t xTask,
char * pcTaskName ) __attribute__((weak));
void vApplicationStackOverflowHook( TaskHandle_t xTask __attribute__((unused)),
char * pcTaskName __attribute__((unused)) )
{
prvSetMainLedOn(); // Main LED on.
for(;;)
{
sleep_ms(2000);
prvBlinkMainLed(); // Main LED slow blink.
}
}
#endif /* configCHECK_FOR_STACK_OVERFLOW >= 1 */
/*-----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION >= 1 )
extern "C"
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
configSTACK_DEPTH_TYPE * pulIdleTaskStackSize ) __attribute__((weak));
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
configSTACK_DEPTH_TYPE * pulIdleTaskStackSize )
{
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
#if ( configUSE_TIMERS >= 1 )
extern "C"
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
configSTACK_DEPTH_TYPE * pulTimerTaskStackSize ) __attribute__((weak));
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
configSTACK_DEPTH_TYPE * pulTimerTaskStackSize )
{
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}
#endif /* configUSE_TIMERS >= 1 */
#endif /* configSUPPORT_STATIC_ALLOCATION >= 1 */
/**
* configASSERT default implementation
*/
#if configDEFAULT_ASSERT == 1
extern "C"
void vApplicationAssertHook() {
taskDISABLE_INTERRUPTS(); // Disable task interrupts
prvSetMainLedOn(); // Main LED on.
for(;;)
{
sleep_ms(100);
prvBlinkMainLed(); // Led off.
sleep_ms(2000);
prvBlinkMainLed(); // Led on.
sleep_ms(100);
prvBlinkMainLed(); // Led off
sleep_ms(100);
prvBlinkMainLed(); // Led on.
}
}
#endif
static void __usb_irq() {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
vTaskNotifyGiveFromISR( __usbTask, &xHigherPriorityTaskWoken );
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
static void __usb(void *param)
{
(void) param;
tusb_init();
irq_set_exclusive_handler(USB_TASK_IRQ, __usb_irq);
irq_set_enabled(USB_TASK_IRQ, true);
Serial.begin(115200);
__usbInitted = true;
while (true) {
if (mutex_try_enter(&__usb_mutex, NULL)) {
tud_task();
mutex_exit(&__usb_mutex);
}
vTaskDelay(1 / portTICK_PERIOD_MS);
}
}
void __USBStart()
{
mutex_init(&__usb_mutex);
// Make highest prio and locked to core 0
xTaskCreate(__usb, "USB", 256, 0, configMAX_PRIORITIES - 1, &__usbTask);
vTaskCoreAffinitySet( __usbTask, 1 << 0 );
}
@@ -6,28 +6,59 @@
created 17 November 2016
by Sandeep Mistry
modified for ESP8266 by Earle F. Philhower, III <earlephilhower@yahoo.com>
Only 16 bitsPerSample are allowed by the PIO code. Only write, no read.
bool setBCLK(pin_size_t pin); // Must be 28 or less. Default is 26
// This assigns two adjacent pins - the pin after this one (one greater) is the WS (word select) signal,
// which toggles before the sample for each channel is sent
bool setDOUT(pin_size_t pin); // Must be 29 or less. Default is 28
*/
#include <I2S.h>
// GPIO pin numbers
//define pBCLK 26
#define pBCLK 20
#define pWS (pBCLK+1)
//define pDOUT 28
#define pDOUT 22
const int frequency = 440; // frequency of square wave in Hz
const int amplitude = 500; // amplitude of square wave
const int sampleRate = 8000; // sample rate in Hz
//const int sampleRate = 8000; // sample rate in Hz
const int sampleRate = 16000; // minimum for UDA1334A
const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave
short sample = amplitude; // current sample value
int count = 0;
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, 1);
Serial.begin(9600);
Serial.println("I2S simple tone");
I2S.setBCLK(pBCLK); // Must be 28 or less. Default is 26
// This assigns two adjacent pins - the pin after this one (one greater) is the WS (word select) signal,
// which toggles before the sample for each channel is sent
I2S.setDOUT(pDOUT); // Must be 29 or less. Default is 28
// start I2S at the sample rate with 16-bits per sample
if (!I2S.begin(sampleRate)) {
Serial.println("Failed to initialize I2S!");
while (1); // do nothing
}
}
void loop() {
@@ -43,4 +74,3 @@ void loop() {
// increment the counter for the next sample
count++;
}
@@ -13,6 +13,25 @@
// How large of a file to test
#define TESTSIZEKB 256
// Format speed in bytes/second. Static buffer so not re-entrant safe
const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
static char buff[64];
if (stop == start) {
strcpy_P(buff, PSTR("Inf b/s"));
} else {
unsigned long delta = stop - start;
float r = 1000.0 * (float)bytes / (float)delta;
if (r >= 1000000.0) {
sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
} else if (r >= 1000.0) {
sprintf_P(buff, PSTR("%0.2f KB/s"), r / 1000.0);
} else {
sprintf_P(buff, PSTR("%d bytes/s"), (int)r);
}
}
return buff;
}
void DoTest(FS *fs) {
if (!fs->format()) {
Serial.printf("Unable to format(), aborting\n");
@@ -29,7 +48,7 @@ void DoTest(FS *fs) {
}
Serial.printf("Creating %dKB file, may take a while...\n", TESTSIZEKB);
long start = millis();
unsigned long start = millis();
File f = fs->open("/testwrite.bin", "w");
if (!f) {
Serial.printf("Unable to open file for writing, aborting\n");
@@ -41,11 +60,11 @@ void DoTest(FS *fs) {
}
}
f.close();
long stop = millis();
Serial.printf("==> Time to write %dKB in 256b chunks = %ld milliseconds\n", TESTSIZEKB, stop - start);
unsigned long stop = millis();
Serial.printf("==> Time to write %dKB in 256b chunks = %lu milliseconds\n", TESTSIZEKB, stop - start);
f = fs->open("/testwrite.bin", "r");
Serial.printf("==> Created file size = %d\n", f.size());
Serial.printf("==> Created file size = %zu\n", f.size());
f.close();
Serial.printf("Reading %dKB file sequentially in 256b chunks\n", TESTSIZEKB);
@@ -58,7 +77,7 @@ void DoTest(FS *fs) {
}
f.close();
stop = millis();
Serial.printf("==> Time to read %dKB sequentially in 256b chunks = %ld milliseconds = %ld bytes/s\n", TESTSIZEKB, stop - start, TESTSIZEKB * 1024 / (stop - start) * 1000);
Serial.printf("==> Time to read %dKB sequentially in 256b chunks = %lu milliseconds = %s\n", TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n", TESTSIZEKB);
start = millis();
@@ -71,8 +90,7 @@ void DoTest(FS *fs) {
}
f.close();
stop = millis();
Serial.printf("==> Time to read %dKB sequentially MISALIGNED in flash and RAM in 256b chunks = %ld milliseconds = %ld bytes/s\n", TESTSIZEKB, stop - start, TESTSIZEKB * 1024 / (stop - start) * 1000);
Serial.printf("==> Time to read %dKB sequentially MISALIGNED in flash and RAM in 256b chunks = %lu milliseconds = %s\n", TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
Serial.printf("Reading %dKB file in reverse by 256b chunks\n", TESTSIZEKB);
start = millis();
@@ -91,8 +109,7 @@ void DoTest(FS *fs) {
}
f.close();
stop = millis();
Serial.printf("==> Time to read %dKB in reverse in 256b chunks = %ld milliseconds = %ld bytes/s\n", TESTSIZEKB, stop - start, TESTSIZEKB * 1024 / (stop - start) * 1000);
Serial.printf("==> Time to read %dKB in reverse in 256b chunks = %lu milliseconds = %s\n", TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
Serial.printf("Writing 64K file in 1-byte chunks\n");
start = millis();
@@ -102,7 +119,7 @@ void DoTest(FS *fs) {
}
f.close();
stop = millis();
Serial.printf("==> Time to write 64KB in 1b chunks = %ld milliseconds = %ld bytes/s\n", stop - start, 65536 / (stop - start) * 1000);
Serial.printf("==> Time to write 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
Serial.printf("Reading 64K file in 1-byte chunks\n");
start = millis();
@@ -113,9 +130,7 @@ void DoTest(FS *fs) {
}
f.close();
stop = millis();
Serial.printf("==> Time to read 64KB in 1b chunks = %ld milliseconds = %ld bytes/s\n", stop - start, 65536 / (stop - start) * 1000);
Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
}
void setup() {
@@ -124,6 +139,7 @@ void setup() {
Serial.printf("Beginning test\n");
Serial.flush();
DoTest(&TESTFS);
Serial.println("done");
}
void loop() {
+6
View File
@@ -58,6 +58,12 @@ private:
int _gain;
int _init;
// Hardware peripherals used
uint _dmaChannel;
PIO _pio;
int _smIdx;
int _pgmOffset;
PDMDoubleBuffer _doubleBuffer;
void (*_onReceive)(void);
+24 -18
View File
@@ -11,11 +11,7 @@ extern "C" {
}
#include "hardware/sync.h"
#include "pdm.pio.h"
// Hardware peripherals used
uint dmaChannel = 0;
PIO pio = pio0;
uint sm = 0;
static PIOProgram _pdmPgm(&pdm_pio_program);
// raw buffers contain PDM data
#define RAW_BUFFER_SIZE 512 // should be a multiple of (decimation / 8)
@@ -49,7 +45,11 @@ PDMClass::PDMClass(int dinPin, int clkPin, int pwrPin) :
_gain(-1),
_channels(-1),
_samplerate(-1),
_init(-1)
_init(-1),
_dmaChannel(0),
_pio(nullptr),
_smIdx(-1),
_pgmOffset(-1)
{
}
@@ -89,29 +89,35 @@ int PDMClass::begin(int channels, int sampleRate)
// Configure PIO state machine
float clkDiv = (float)clock_get_hz(clk_sys) / sampleRate / decimation / 2;
uint offset = pio_add_program(pio, &pdm_pio_program);
pdm_pio_program_init(pio, sm, offset, _clkPin, _dinPin, clkDiv);
if (!_pdmPgm.prepare(&_pio, &_smIdx, &_pgmOffset)) {
// ERROR, no free slots
return -1;
}
pdm_pio_program_init(_pio, _smIdx, _pgmOffset, _clkPin, _dinPin, clkDiv);
// Wait for microphone
delay(100);
// Configure DMA for transferring PIO rx buffer to raw buffers
dma_channel_config c = dma_channel_get_default_config(dmaChannel);
_dmaChannel = dma_claim_unused_channel(false);
dma_channel_config c = dma_channel_get_default_config(_dmaChannel);
channel_config_set_read_increment(&c, false);
channel_config_set_write_increment(&c, true);
channel_config_set_dreq(&c, pio_get_dreq(pio, sm, false));
channel_config_set_dreq(&c, pio_get_dreq(_pio, _smIdx, false));
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
// Clear DMA interrupts
dma_hw->ints0 = 1u << dmaChannel;
dma_hw->ints0 = 1u << _dmaChannel;
// Enable DMA interrupts
dma_channel_set_irq0_enabled(dmaChannel, true);
irq_set_exclusive_handler(DMA_IRQ_0, dmaHandler);
dma_channel_set_irq0_enabled(_dmaChannel, true);
// Share but allocate a high priority to the interrupt
irq_add_shared_handler(DMA_IRQ_0, dmaHandler, 0);
irq_set_enabled(DMA_IRQ_0, true);
dma_channel_configure(dmaChannel, &c,
dma_channel_configure(_dmaChannel, &c,
rawBuffer[rawBufferIndex], // Destinatinon pointer
&pio->rxf[sm], // Source pointer
&_pio->rxf[_smIdx], // Source pointer
RAW_BUFFER_SIZE, // Number of transfers
true // Start immediately
);
@@ -123,7 +129,7 @@ int PDMClass::begin(int channels, int sampleRate)
void PDMClass::end()
{
dma_channel_abort(dmaChannel);
dma_channel_abort(_dmaChannel);
pinMode(_clkPin, INPUT);
}
@@ -171,10 +177,10 @@ void PDMClass::IrqHandler(bool halftranfer)
static int cutSamples = 100;
// Clear the interrupt request.
dma_hw->ints0 = 1u << dmaChannel;
dma_hw->ints0 = 1u << _dmaChannel;
// Restart dma pointing to the other buffer
int shadowIndex = rawBufferIndex ^ 1;
dma_channel_set_write_addr(dmaChannel, rawBuffer[shadowIndex], true);
dma_channel_set_write_addr(_dmaChannel, rawBuffer[shadowIndex], true);
if (_doubleBuffer.available()) {
// buffer overflow, stop
+1
View File
@@ -26,6 +26,7 @@ static inline void pdm_pio_program_init(PIO pio, uint sm, uint offset, uint clkP
sm_config_set_in_pins(&c, dataPin);
sm_config_set_sideset_pins(&c, clkPin);
sm_config_set_clkdiv(&c, clkDiv);
sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_RX);
pio_sm_set_consecutive_pindirs(pio, sm, dataPin, 1, false);
pio_sm_set_consecutive_pindirs(pio, sm, clkPin, 1, true);
+1
View File
@@ -43,6 +43,7 @@ static inline void pdm_pio_program_init(PIO pio, uint sm, uint offset, uint clkP
sm_config_set_in_pins(&c, dataPin);
sm_config_set_sideset_pins(&c, clkPin);
sm_config_set_clkdiv(&c, clkDiv);
sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_RX);
pio_sm_set_consecutive_pindirs(pio, sm, dataPin, 1, false);
pio_sm_set_consecutive_pindirs(pio, sm, clkPin, 1, true);
pio_sm_set_pins_with_mask(pio, sm, 0, (1u << clkPin) );
Submodule libraries/SdFat deleted from 3a6b688b1b
+4 -1
View File
@@ -83,6 +83,9 @@ bool TwoWire::setSCL(pin_size_t pin) {
void TwoWire::setClock(uint32_t hz) {
_clkHz = hz;
if (_running) {
i2c_set_baudrate(_i2c, hz);
}
}
// Master mode
@@ -146,7 +149,7 @@ void TwoWire::onIRQ() {
_i2c->hw->clr_start_det;
}
if (_i2c->hw->intr_stat & (1 << 9)) {
if (_onReceiveCallback) {
if (_onReceiveCallback && _buffLen) {
_onReceiveCallback(_buffLen);
}
_buffLen = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "framework-arduinopico",
"version": "1.10913.0",
"version": "1.20000.0",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
"keywords": [
"framework",
+6
View File
@@ -1,6 +1,12 @@
Publishing New Releases
=======================
First, update the version number throughout the repo and push the change:
./tools/makever.py --version X.Y.Z
git commit -a -m "Update version"
git push
GitHub CI Actions are used to automatically build a draft package whenever a tag is pushed to repo:
git tag X.Y.Z
+165 -150
View File
@@ -50,6 +50,12 @@
{
"name": "Cytron Maker Pi RP2040"
},
{
"name": "DeRuiLab FlyBoard2040 Core"
},
{
"name": "DFRobot Beetle RP2040"
},
{
"name": "Invector Labs Challenger RP2040 WiFi"
},
@@ -59,15 +65,24 @@
{
"name": "Invector Labs Challenger RP2040 LTE"
},
{
"name": "Invector Labs Challenger RP2040 LoRa"
},
{
"name": "Invector Labs RPICO32"
},
{
"name": "Seeed XIAO RP2040"
},
{
"name": "Solder Party RP2040 Stamp"
},
{
"name": "SparkFun ProMicro RP2040"
},
{
"name": "SparkFun Thing Plus RP2040"
},
{
"name": "Melopero Shake RP2040"
},
@@ -84,22 +99,22 @@
"toolsDependencies": [
{
"packager": "rp2040",
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-gcc"
},
{
"packager": "rp2040",
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-mklittlefs"
},
{
"packager": "rp2040",
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-elf2uf2"
},
{
"packager": "rp2040",
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-pioasm"
},
{
@@ -109,7 +124,7 @@
},
{
"packager": "rp2040",
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-openocd"
}
],
@@ -120,57 +135,57 @@
],
"tools": [
{
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-openocd",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/aarch64-linux-gnu.openocd-e3428fadb.210706.tar.gz",
"archiveFileName": "aarch64-linux-gnu.openocd-e3428fadb.210706.tar.gz",
"checksum": "SHA-256:62662b74a7cbbb5db0998987585d74a3261c3e6f0c1440d7449505832020e095",
"size": "6224364"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
"archiveFileName": "aarch64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
"checksum": "SHA-256:d1d95978101c69c3bc777e61ba70077bf9dc4b3245aa7dd93171acaec4d29fb1",
"size": "5607214"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/arm-linux-gnueabihf.openocd-e3428fadb.210706.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.openocd-e3428fadb.210706.tar.gz",
"checksum": "SHA-256:15b188279382ee182253984ed45785f3a15387576583a1c6bff2c71d724ff76a",
"size": "5931976"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.openocd-e3428fadb.220212.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.openocd-e3428fadb.220212.tar.gz",
"checksum": "SHA-256:81373c1e12a88e382a587688343c2e2f2f1f999d38334b7b6ded174929cc9b88",
"size": "5344032"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-linux-gnu.openocd-e3428fadb.210706.tar.gz",
"archiveFileName": "i686-linux-gnu.openocd-e3428fadb.210706.tar.gz",
"checksum": "SHA-256:40a7a417b46875b2ccff582309b0e8ffcfd5c038ad1dc1775d53c683708c363c",
"size": "5728004"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.openocd-e3428fadb.220212.tar.gz",
"archiveFileName": "i686-linux-gnu.openocd-e3428fadb.220212.tar.gz",
"checksum": "SHA-256:6a4dd98422a187c7725fc349b045b55e4742166c65461847d1bd59537242b0be",
"size": "5168258"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-w64-mingw32.openocd-e3428fadb.210706.zip",
"archiveFileName": "i686-w64-mingw32.openocd-e3428fadb.210706.zip",
"checksum": "SHA-256:945cf4b0de879b935e05af2f438a6964949fbbf6d163e96e507939c55cafbff0",
"size": "8539935"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
"checksum": "SHA-256:0643903fcd887a8423cb4ba5329565b499c206921f77ad2e59ae32c472a26dd7",
"size": "2156820"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-apple-darwin14.openocd-e3428fadb.210706.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.openocd-e3428fadb.210706.tar.gz",
"checksum": "SHA-256:b28b54580b16e6d7f0229a653acf68aeab8cc3270d8b9dcaf178b8b8c0aafcb7",
"size": "2006182"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.openocd-e3428fadb.220212.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.openocd-e3428fadb.220212.tar.gz",
"checksum": "SHA-256:913b65baeeef1b60caf202e69cde4cd5a3ba0ed2f75f2600adfb3dcf4b3899ef",
"size": "2002482"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-linux-gnu.openocd-e3428fadb.210706.tar.gz",
"archiveFileName": "x86_64-linux-gnu.openocd-e3428fadb.210706.tar.gz",
"checksum": "SHA-256:90aec3a7818697e04e798a0470133caf62e7583a48f7ae3848b9b536c3180b0b",
"size": "6154827"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
"archiveFileName": "x86_64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
"checksum": "SHA-256:63b2be48c1438d2a09f4ed65d89e555176f18753886555cf48f861e9288d7dc1",
"size": "5540524"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.openocd-e3428fadb.210706.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-e3428fadb.210706.zip",
"checksum": "SHA-256:86e0341d50723d5e0c2969a903e911273e3b70ed5b794284b7d7ec7a1f09ee2f",
"size": "8929726"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
"checksum": "SHA-256:0643903fcd887a8423cb4ba5329565b499c206921f77ad2e59ae32c472a26dd7",
"size": "2156820"
}
]
},
@@ -237,222 +252,222 @@
]
},
{
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-gcc",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/aarch64-linux-gnu.arm-none-eabi-7855b0c.210706.tar.gz",
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-7855b0c.210706.tar.gz",
"checksum": "SHA-256:32f2a28e0f12bd1c8aaefa10bc2646f0f058b77d0030bec3e1e0ec89409d2380",
"size": "103186082"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
"checksum": "SHA-256:7773b43b9c0bf5b7cdb2299e9d1b151df97e0a2ded4428809ec68264ac9818a9",
"size": "102741416"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/arm-linux-gnueabihf.arm-none-eabi-7855b0c.210706.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-7855b0c.210706.tar.gz",
"checksum": "SHA-256:0cca5b4c429acf26eeb093bf21b16c2265fd6c04aafe91ceb304dfee35a662d7",
"size": "95859088"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.arm-none-eabi-ed6d983.220212.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-ed6d983.220212.tar.gz",
"checksum": "SHA-256:c422910ef0e29528939e037ea3c518a532726111604b85b27f3f245820680ccb",
"size": "95383443"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-linux-gnu.arm-none-eabi-7855b0c.210706.tar.gz",
"archiveFileName": "i686-linux-gnu.arm-none-eabi-7855b0c.210706.tar.gz",
"checksum": "SHA-256:9a1ba7cdcb11d817ddbcb60d53f5b804b787a7a3c2e0bc5a33e86b8bbf653391",
"size": "105956199"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
"archiveFileName": "i686-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
"checksum": "SHA-256:6306791b43de955c4a4d0a1b8972e0f696206591a810eefc16b906b157322bd3",
"size": "105350371"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-w64-mingw32.arm-none-eabi-7855b0c.210706.zip",
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-7855b0c.210706.zip",
"checksum": "SHA-256:5b06d0dcfcf78c83b85aadbcbd8b6e3301b60acd14d6319e066e125586331aac",
"size": "105493451"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
"checksum": "SHA-256:b00aa3594d1911bea07c1dbf31b9a63430f4dcb91c7b3b1341f8551d361d405f",
"size": "105568357"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-apple-darwin14.arm-none-eabi-7855b0c.210706.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.arm-none-eabi-7855b0c.210706.tar.gz",
"checksum": "SHA-256:6d4dfd0e032df43687683504b747a0010cea53b2d86f4662f72997fd0cbd8b1a",
"size": "107371801"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.arm-none-eabi-ed6d983.220212.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.arm-none-eabi-ed6d983.220212.tar.gz",
"checksum": "SHA-256:e93b967d1fb6ed0fc7cf6a5161e22a597dd05080c1353ac74e2a42ddf8dfe98d",
"size": "107429038"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-linux-gnu.arm-none-eabi-7855b0c.210706.tar.gz",
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-7855b0c.210706.tar.gz",
"checksum": "SHA-256:791b6386a6b6742d627af3277f401db7bb2b407852c8b3f49eaee30fcc5ceb8a",
"size": "107845636"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
"checksum": "SHA-256:047c4d482cf77e09bd8069fc9d5b28b1e0c76440ad81583a0fc3a8e809959bb8",
"size": "106740897"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.arm-none-eabi-7855b0c.210706.zip",
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-7855b0c.210706.zip",
"checksum": "SHA-256:7f8b591902e9f164904974bb8224808371b025affaf7cbffdeb3f3ff259b9464",
"size": "110342777"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
"checksum": "SHA-256:5c15725628a3dbd47a8fa8f9a9aab7a2221815ec9bf85dc2080ce19166316ae6",
"size": "110420777"
}
]
},
{
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-elf2uf2",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/aarch64-linux-gnu.elf2uf2-fc10a97.210706.tar.gz",
"archiveFileName": "aarch64-linux-gnu.elf2uf2-fc10a97.210706.tar.gz",
"checksum": "SHA-256:3c67eb63da563c505dd046cd069aee1754ff735e9d0d7dacfd8b003a85a078ca",
"size": "79842"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
"archiveFileName": "aarch64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
"checksum": "SHA-256:8cb7ce703b0fa6f2fce6b124ae6f34ad0b866aa4a58096f22b66b1251c1b11c0",
"size": "79853"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/arm-linux-gnueabihf.elf2uf2-fc10a97.210706.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-fc10a97.210706.tar.gz",
"checksum": "SHA-256:62457fc90b0993d720a3523537e8d55e9378769db1595709ff01357ebc13a3dd",
"size": "54219"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.elf2uf2-2062372.220212.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-2062372.220212.tar.gz",
"checksum": "SHA-256:790d46b411c16a4a210a91436eb4bdc81fb34f0119148a8f9c4b09489489a54d",
"size": "54244"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-linux-gnu.elf2uf2-fc10a97.210706.tar.gz",
"archiveFileName": "i686-linux-gnu.elf2uf2-fc10a97.210706.tar.gz",
"checksum": "SHA-256:59e83f09322a2a292c20a4852512aa8c086b5b0d02842e11dfb9cb122485fb84",
"size": "87881"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.elf2uf2-2062372.220212.tar.gz",
"archiveFileName": "i686-linux-gnu.elf2uf2-2062372.220212.tar.gz",
"checksum": "SHA-256:7c05c70f761bb6caa986d24ac1065367fe906ff7f0434cf4b0112ace331f74bc",
"size": "87891"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-w64-mingw32.elf2uf2-fc10a97.210706.zip",
"archiveFileName": "i686-w64-mingw32.elf2uf2-fc10a97.210706.zip",
"checksum": "SHA-256:2b7c676fa0ff8a7fb6638dfe770787e6bdd9c6cd2f5a0d86f8c64c267a9bc328",
"size": "70429"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.elf2uf2-2062372.220212.zip",
"archiveFileName": "i686-w64-mingw32.elf2uf2-2062372.220212.zip",
"checksum": "SHA-256:e6f0578ea781b160390994d3e95bedfec01e212d47243b1adb84f910a06bcba4",
"size": "70405"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-apple-darwin14.elf2uf2-fc10a97.210706.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.elf2uf2-fc10a97.210706.tar.gz",
"checksum": "SHA-256:1154dd7bb3186bb66b8b53699d29083a688564ace502f28cf53cf9f15214d816",
"size": "81919"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.elf2uf2-2062372.220212.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.elf2uf2-2062372.220212.tar.gz",
"checksum": "SHA-256:d65de7218eaf01c9bf58fa22bd9e1e7c10c054213948b4b62f648a058d09b4de",
"size": "81981"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-linux-gnu.elf2uf2-fc10a97.210706.tar.gz",
"archiveFileName": "x86_64-linux-gnu.elf2uf2-fc10a97.210706.tar.gz",
"checksum": "SHA-256:0ed4a2a3973ee2e7a5edc4932bd2485ac0825750b72fabdb8a96e8d274dc30a4",
"size": "79516"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
"archiveFileName": "x86_64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
"checksum": "SHA-256:ba7795ed49c54f3f52caee675b0fd078f6fb8498a47bf7e5d7457065271df338",
"size": "79585"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.elf2uf2-fc10a97.210706.zip",
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-fc10a97.210706.zip",
"checksum": "SHA-256:81c3c458fda68840439afc7b16133febb21e023a910924761abaee9c011a44db",
"size": "78298"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.elf2uf2-2062372.220212.zip",
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-2062372.220212.zip",
"checksum": "SHA-256:02c7684ed1aea4e18216ec6bbbcedeb482c5f23ad7d5eb9dcb942b8ae6cad5ae",
"size": "78279"
}
]
},
{
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-pioasm",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/aarch64-linux-gnu.pioasm-fc10a97.210706.tar.gz",
"archiveFileName": "aarch64-linux-gnu.pioasm-fc10a97.210706.tar.gz",
"checksum": "SHA-256:bbc6735939ffab312e700b687c29ecf7873564cec9028588c39b7be5a5b18ba3",
"size": "453297"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.pioasm-2062372.220212.tar.gz",
"archiveFileName": "aarch64-linux-gnu.pioasm-2062372.220212.tar.gz",
"checksum": "SHA-256:9ea17ecf0e492bc6a971f6a78780c3b3c6ee644d52e056cba08a708ac225add2",
"size": "453558"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/arm-linux-gnueabihf.pioasm-fc10a97.210706.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.pioasm-fc10a97.210706.tar.gz",
"checksum": "SHA-256:9390b87fa87fa03d1033cf75624c0dd3d2acd7b2d794f5ab91a800ffb7546a17",
"size": "360370"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.pioasm-2062372.220212.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.pioasm-2062372.220212.tar.gz",
"checksum": "SHA-256:c7af69227a3b3c54ccf87122b18842460a263bd711abf93336794ce5f905c284",
"size": "360559"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-linux-gnu.pioasm-fc10a97.210706.tar.gz",
"archiveFileName": "i686-linux-gnu.pioasm-fc10a97.210706.tar.gz",
"checksum": "SHA-256:a84e7389c5e959a409b6ce8b1150fad7641fad4ac55c129888439f33c5bfb7cc",
"size": "511409"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.pioasm-2062372.220212.tar.gz",
"archiveFileName": "i686-linux-gnu.pioasm-2062372.220212.tar.gz",
"checksum": "SHA-256:f66b9bde3d6859d43049b019fb639dd0bfafcd43f1389ffc499d18949bcf1808",
"size": "511397"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-w64-mingw32.pioasm-fc10a97.210706.zip",
"archiveFileName": "i686-w64-mingw32.pioasm-fc10a97.210706.zip",
"checksum": "SHA-256:d1f1e34bd6e4b32301f3e7b147a9eb6710c2b52f816288a11e9aeb619f242355",
"size": "385662"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.pioasm-2062372.220212.zip",
"archiveFileName": "i686-w64-mingw32.pioasm-2062372.220212.zip",
"checksum": "SHA-256:89cfa44101dade30000cfaa5985de7f0e7aba93d03dc45ba962f97226ae4e41f",
"size": "385748"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-apple-darwin14.pioasm-fc10a97.210706.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.pioasm-fc10a97.210706.tar.gz",
"checksum": "SHA-256:f9cb3bf99c84221b8c63d95dd22bbd1cc1ba40bd847530819392ee047962571e",
"size": "480405"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.pioasm-2062372.220212.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.pioasm-2062372.220212.tar.gz",
"checksum": "SHA-256:d531c911e6eba0333379af04dd807917659bd4d34be9f4bd6792aeff55ab15a9",
"size": "480495"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-linux-gnu.pioasm-fc10a97.210706.tar.gz",
"archiveFileName": "x86_64-linux-gnu.pioasm-fc10a97.210706.tar.gz",
"checksum": "SHA-256:96721566a97f07cbe4af3a1d80d63336a75b129a7cb821a407260d250666a30f",
"size": "458641"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.pioasm-2062372.220212.tar.gz",
"archiveFileName": "x86_64-linux-gnu.pioasm-2062372.220212.tar.gz",
"checksum": "SHA-256:2cd4aa8af98558461cb7b85b21830ea854a430a3e57668d618c5f1cd5e389809",
"size": "458730"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.pioasm-fc10a97.210706.zip",
"archiveFileName": "x86_64-w64-mingw32.pioasm-fc10a97.210706.zip",
"checksum": "SHA-256:15fe69c11ad86ddf78c1ee26610b8b0f9d4a2323af13854e8e6b5e20d5a6fff5",
"size": "408341"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.pioasm-2062372.220212.zip",
"archiveFileName": "x86_64-w64-mingw32.pioasm-2062372.220212.zip",
"checksum": "SHA-256:ba586e67f4b309690a51fca70fdd26f38b68951b0fee4dc8333183ef6429833a",
"size": "408649"
}
]
},
{
"version": "1.3.1-a-7855b0c",
"version": "1.3.3-a-ed6d983",
"name": "pqt-mklittlefs",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/aarch64-linux-gnu.mklittlefs-6b5c62d.210706.tar.gz",
"archiveFileName": "aarch64-linux-gnu.mklittlefs-6b5c62d.210706.tar.gz",
"checksum": "SHA-256:3b318dbefd8ac36b3f1531d14d018d7aaad26b4f7f259a3a0c116939e74c76f6",
"size": "44788"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
"archiveFileName": "aarch64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
"checksum": "SHA-256:2455f5ca6cb1f7b73ed1cb55d4d2261d249c1b24915bd4e66e28f037a0a13116",
"size": "47271"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/arm-linux-gnueabihf.mklittlefs-6b5c62d.210706.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-6b5c62d.210706.tar.gz",
"checksum": "SHA-256:2b67c6ab2d6fd7239944963beeca0664f85fbffb7b68bcf9eaa7c64e81cad7a5",
"size": "38247"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.mklittlefs-affa497.220212.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-affa497.220212.tar.gz",
"checksum": "SHA-256:f4b71138f1469e4b9ce82b3b21252aca265a88d56a5d48513dbb5c6d58b19841",
"size": "40807"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-linux-gnu.mklittlefs-6b5c62d.210706.tar.gz",
"archiveFileName": "i686-linux-gnu.mklittlefs-6b5c62d.210706.tar.gz",
"checksum": "SHA-256:791f12a6969e3b78d13e4355b7977a49e5b567261499451a10ce0781a7d08d70",
"size": "48237"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.mklittlefs-affa497.220212.tar.gz",
"archiveFileName": "i686-linux-gnu.mklittlefs-affa497.220212.tar.gz",
"checksum": "SHA-256:ed1011230c75447dad3d912b7b5607ddcc59e093ee7ebd653fb05274bc876f4c",
"size": "50909"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/i686-w64-mingw32.mklittlefs-6b5c62d.210706.zip",
"archiveFileName": "i686-w64-mingw32.mklittlefs-6b5c62d.210706.zip",
"checksum": "SHA-256:a5bf0308b8f279f5e06c2b5f24f6843d934046ceba84fd7ed5c44ba682b770c4",
"size": "332804"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.mklittlefs-affa497.220212.zip",
"archiveFileName": "i686-w64-mingw32.mklittlefs-affa497.220212.zip",
"checksum": "SHA-256:1289f51c674ebdc568843b82c88db21eb4c295f3b15c26398d31266b9da63b4c",
"size": "334050"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-apple-darwin14.mklittlefs-6b5c62d.210706.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.mklittlefs-6b5c62d.210706.tar.gz",
"checksum": "SHA-256:e5dd89a7a4ffe494440975ec511cdf24d5978da07a9bff96429a48ad0a7054e7",
"size": "362810"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.mklittlefs-affa497.220212.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.mklittlefs-affa497.220212.tar.gz",
"checksum": "SHA-256:0c0d7d8c80739ed79bc5a41e831d0229b6378e87f4c58f148d884814f1ad46d2",
"size": "365757"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-linux-gnu.mklittlefs-6b5c62d.210706.tar.gz",
"archiveFileName": "x86_64-linux-gnu.mklittlefs-6b5c62d.210706.tar.gz",
"checksum": "SHA-256:f1e3b374c66811bfe07997b12b6cb318c58ac84973c46e6887553aea13276884",
"size": "46915"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
"archiveFileName": "x86_64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
"checksum": "SHA-256:c504429c24cfea9bf841cbf0caa29bbe0115e72c94c18f949451ffa540d6cacc",
"size": "49766"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.mklittlefs-6b5c62d.210706.zip",
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-6b5c62d.210706.zip",
"checksum": "SHA-256:f5d69785c0bb5397eb49cccaa23dd131d32ab013e1124e38c15f758ded799fdb",
"size": "345250"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.mklittlefs-affa497.220212.zip",
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-affa497.220212.zip",
"checksum": "SHA-256:4ada867888513596fa51bf78c98d9e970de9b8f1eec4f88d85e6e7621704fb91",
"size": "347602"
}
]
}
+2 -1
View File
@@ -20,7 +20,8 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Raspberry Pi RP2040 Boards
version=1.9.13
version=2.0.0
runtime.tools.pqt-gcc.path={runtime.platform.path}/system/arm-none-eabi
runtime.tools.pqt-python3.path={runtime.platform.path}/system/python3
runtime.tools.pqt-mklittlefs.path={runtime.platform.path}/system/mklittlefs
+2 -1
View File
@@ -19,8 +19,9 @@ function skip_ino()
/hid_keyboard/
/msc_external_flash/
/msc_external_flash_sdcard/
/msc_sdfat/
/msc_internal_flash_samd/
/msc_sd/
/msc_sdfat/
/midi_pizza_box_dj/
EOL
echo $ino | grep -q -F "$skiplist"
+1 -1
View File
@@ -2,7 +2,7 @@
for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S \
./libraries/LittleFS/src ./libraries/LittleFS/examples \
./libraries/rp2040 ./libraries/SD ./libraries/SdFat \
./libraries/rp2040 ./libraries/SD ./libraries/ESP8266SdFat \
./libraries/Servo ./libraries/SPI ./libraries/Wire; do
find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" \) -a \! -path '*api*' -exec astyle --suffix=none --options=./tests/astyle_core.conf \{\} \;
find $dir -type f -name "*.ino" -exec astyle --suffix=none --options=./tests/astyle_examples.conf \{\} \;
+5 -1
View File
@@ -25,11 +25,15 @@ rely on existence of `sed` command.
## makeboards.py
Generates `boards.txt` programmatically. Never edit the `boards.txt` file
manually, use `python3 tools/makeboards.py > boards.py`. Change the script
manually, use `python3 tools/makeboards.py`. Change the script
as necessary to add any add'l fields or menus required. Used because the
`boards.txt` file is very repetitive and it's safer to generate with code
than by hand.
## makever.py
Updates the version info prior to a release in platform.txt, package.json,
and the version header. Run from root of the repo.
## libpico/make-libpico.sh
Builds the libpico.a file as well as the bootloader stage2 binaries.
Run whenever the pico-sdk is updated.
+1
View File
@@ -0,0 +1 @@
This directory contains JSON board definitions for use with Platform.IO
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_FEATHER_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_feather",
"boot2_source": "boot2_w25x10cl_4_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80f1",
"usb_manufacturer": "Adafruit",
"usb_product": "Feather RP2040"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Feather RP2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_ITSYBITSY_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_itsybitsy",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80fd",
"usb_manufacturer": "Adafruit",
"usb_product": "ItsyBitsy RP2040"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "ItsyBitsy RP2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_KB2040_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_kb2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x8105",
"usb_manufacturer": "Adafruit",
"usb_product": "KB2040"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "KB2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_MACROPAD_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_macropad2040",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x8107",
"usb_manufacturer": "Adafruit",
"usb_product": "MacroPad RP2040"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "MacroPad RP2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_QTPY_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_qtpy",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80f7",
"usb_manufacturer": "Adafruit",
"usb_product": "QT Py RP2040"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "QT Py RP2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_STEMMAFRIEND_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_stemmafriend",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x80e3",
"usb_manufacturer": "Adafruit",
"usb_product": "STEMMA Friend RP2040"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "STEMMA Friend RP2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+52
View File
@@ -0,0 +1,52 @@
{
"build": {
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_TRINKEYQT_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
]
],
"mcu": "rp2040",
"arduino": {
"earlephilhower": {
"variant": "adafruit_trinkeyrp2040qt",
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239a",
"usb_pid": "0x8109",
"usb_manufacturer": "Adafruit",
"usb_product": "Trinkey RP2040 QT"
}
}
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Trinkey RP2040 QT",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 8388608,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}

Some files were not shown because too many files have changed in this diff Show More