Compare commits

...
59 Commits
Author SHA1 Message Date
Earle F. Philhower, III ef257c32b4 Update version 2023-09-05 14:15:03 -07:00
Earle F. Philhower, III 88cd4b5288 Fix Print::print(0ULL) (#1692)
Move to a patched ArduinoCore-API revision.

Fixes #1691
2023-09-03 13:30:12 -07:00
Earle F. Philhower, III ca7ec56f0d Rebuild OTA using GCC 12.3 (#1690)
No functional changes, just for completeness.
2023-09-03 09:58:28 -07:00
Earle F. Philhower, III 74b1156d5e Fix PicoProbe CMSIS restart of second core (#1689)
For some reason `program ... reset" causes OpenOCD to leave the chip in a
state where the 2nd core does not come up properly, leading to problems in
FreeRTOS and others.

Use a separate reset sequence after programming to work around the issue.

Fixes #1687
2023-09-03 09:43:34 -07:00
Odd Stråbø 6ac7ee1a9d Fix gcc search path in make-ota.sh (#1688) 2023-09-03 09:23:50 -07:00
Earle F. Philhower, III 0b56452c35 Rebuild libpico/libbearssl using GCC 12.3 (#1686) 2023-09-01 08:17:31 -07:00
Earle F. Philhower, III b9c66ca0fd Ensure HID reports aren't dropped (#1685)
Fixes #1682

Make the HID report wait up to 500ms for an existing one to go out
before giving up sending a report.
2023-08-31 08:40:38 -07:00
Earle F. Philhower, III faf06a3b70 Avoid obsolete GCC 7.1 note on building WiFi (#1684)
Fixes #1683
2023-08-31 07:42:54 -07:00
Earle F. Philhower, III d0ac7f06b1 Update version 2023-08-30 08:29:26 -07:00
Earle F. Philhower, III e9daaa3589 Add TDM support to I2S (#1673)
Fixes #1066

Implements a simple TDM mode for the I2S output object.
2023-08-30 08:28:34 -07:00
João Vieira 1393811525 Add stdint.h to generic variant common.h (#1677)
Fixes #1676
2023-08-27 13:55:17 -07:00
Andriy Golovnya 2b640669a7 Added RP2040-ProMini board to the project. (#1674) 2023-08-27 11:53:19 -07:00
Earle F. Philhower, III 9d0f0a8d7a Add missing Tiny2040 JSON (#1675) 2023-08-27 10:03:12 -07:00
Earle F. Philhower, III 21d2fb4afa Add Pimoroni Tiny2040 (#1672)
Fixes #1604.  Supports 2MB and 8MB revs
2023-08-25 10:39:56 -07:00
Earle F. Philhower, III ade74986ee GCC 12.3, GDB 12, OpenOCD 0.12, Picotool 1.1.2 (#1670)
Major toolchain update including:
* GCC 12.3
* GDB 12
* OpenOCD 0.12
* Picotool 1.1.2

* Fix MDNS infinite recursion

* Remove legacy Picoprobe

Fixes #1313
Fixes #1650
2023-08-25 09:56:52 -07:00
LinusHeu 73722b5c87 Fix I2S stop/start race condition #1656 (#1659)
Fixes  #1656
2023-08-22 08:40:23 -07:00
Earle F. Philhower, III 456b474a48 Allow re-setting identical pins without panic() (#1655)
Setting a pin to the current value is a no-op, not fatal.

Fixes #1652
2023-08-21 08:52:49 -07:00
Jimmy Hedman f11cc4db69 Make MDNS compile with IPv6 enabled (#1651) 2023-08-20 14:47:23 -07:00
Matt 8c2901da13 Update license.rst (#1648)
fixed typo in license.rst
2023-08-17 09:33:31 -07:00
LinusHeu ca4637d14d SPI debugging: tiny fix & log actual baudrate (#1641) 2023-08-10 07:39:36 -07:00
Earle F. Philhower, III 313caf406e Update version 2023-08-04 17:09:07 -07:00
Rastloser 25052fedd6 Update platform.txt to require auto-discovery and serial-monitor (#1631)
Fixes #1619

Requiring the auto-discovery tool and serial monitor if they have not already been included by other boards (namely if AVR cores have been uninstalled in the IDE).
2023-08-04 16:31:47 -07:00
Kattni 678cd2c4b9 Add Adafruit Metro RP2040 (#1630) 2023-08-04 15:49:05 -07:00
Dryw Wade 1231317c9c Fix race condition between WiFi receive and consume (#1614)
If another packet comes in between freeing `_rx_buf` and setting `_rx_buf` to 0, that new packet could get put into the same memory address and get concatenated to itself, which leads to an infinite loop.
New solution assigns a temp pointer, sets `rx_buf` to 0, then frees the memory, which guarantees `_rx_buf` always points to valid data.
2023-08-03 20:10:24 -07:00
Earle F. Philhower, III cd76f030cb Update serial.rst 2023-08-03 11:10:01 -07:00
Earle F. Philhower, III 36839cb190 Update serial.rst, add ignoreFlowControl docs (#1626) 2023-08-02 17:06:42 -07:00
marklinmax 23e68973c0 Add SerialUSB::ignoreFlowControl() method (#1624)
Fixes #1620
2023-08-02 17:00:26 -07:00
Patrick Van Oosterwijck 70af32eead Add new board Silicognition RP2040-Shim (#1623)
Board documentation can be found here:
https://silicognition.com/Products/rp2040-shim/

Signed-off-by: Patrick Van Oosterwijck <patrick@silicognition.com>
2023-08-02 16:48:55 -07:00
Maximilian Gerhardt 3cc5ac14ff Fix PlatformIO intellisense (#1616)
The `_idedata` has been changed to `__idedata` in newer PlatformIO core versions per https://github.com/platformio/platformio-core/commit/158aabbdf23ed1ff8f5e3f01fb4ef1723a78d3bb. This change has broken the logic to expand out the `-iprefix PATH @INCLUDEFILE` argument into its individual include paths, causing Intellisense breakages on some VSCode systems and other IDEs that didn't handle these arguments correctly or in which the path was corrupted.
2023-07-29 13:48:29 -07:00
Earle F. Philhower, III 4fd8e41db1 Update version 2023-07-28 10:35:47 -07:00
Earle F. Philhower, III 5fd4736d8f Handle swapped Wire IRQs properly (#1608)
When we swap the Wire objects, we need the i2c0 IRQ shim to call
Wire1.onIRQ, not the usual Wire.onIRQ.  Same for i2c1 IRQ shim.

Fixes #1607
2023-07-26 15:40:07 -07:00
Earle F. Philhower, III 67a07edccc Fix FS upload crash (#1598)
Thanks to @pietglas for finding and fixing.  See #1590 for more info.
2023-07-17 15:17:31 -07:00
Earle F. Philhower, III 1dc0872818 Remove obsolete refs to ATOMIC_FS_UPDATE (#1597)
See #1590
2023-07-14 14:58:21 -07:00
Pontus Oldberg ead0728a57 Adds new Challenger WiFi6/BLE5 board to the mix. (#1595) 2023-07-14 08:58:06 -07:00
Jack Burgess 14eb8d3906 Update ota.rst (#1592)
Spelling mistakes and grammatical corrections
2023-07-14 08:10:13 -07:00
LinusHeu 4c90b295b2 Fix: 'I2S::operator=(const I2S&)' is implicitly (#1588) 2023-07-12 03:26:43 -07:00
Earle F. Philhower, III 43aa0427ea Reapply #1548 (#1582) 2023-07-07 13:38:04 -07:00
palmerr23 cc5d1779a3 Add MCLK support for I2S, optimize clocks for jitter-free playback (#1555)
Fixes #1065
2023-07-07 13:10:32 -07:00
Earle F. Philhower, III 0f437e4db2 Remove leftover debug printf in LWIP_Ethernet (#1572)
See #1161
2023-07-02 13:12:22 -07:00
Max 3778fbb833 Add ArtronShop RP2 Nano board (#1567) 2023-06-28 09:16:05 -07:00
Ha Thach 4b6f3d05e1 BREAKING: Change default debug_script to cmsis-dap (#1565)
The PicoProbe firmware has only supported  CMSIS-DAP for some time, make it the default debugging option to work around IDE 2.0 issues.
2023-06-27 09:31:58 -07:00
Earle F. Philhower, III 9e89dda900 Ensure 64bit math for SD card FSInfo (#1553)
Fixes #1552

Ensure that 64 bit multiplication is done when calculating the total size
available and used for SDFS.
2023-06-23 08:25:36 -07:00
Tristan Rowley 91e69e2a1a Add Pimoroni Plasma RP2040 support (#1556) 2023-06-22 12:58:57 -07:00
Mohammed Chamma 21d1a285dc Fix typo in fs.rst regarding info64 (#1551) 2023-06-20 13:00:36 -07:00
LinusHeu 0e579792d1 I2S: Don't consider _isHolding when it's an output (#1548) 2023-06-19 07:54:34 -07:00
Earle F. Philhower, III 20cabe824f Update version 2023-06-17 19:40:40 -07:00
Earle F. Philhower, III 0847d3dbb0 Update to Pico-SDK 1.5.1 (#1539)
This should reduce the `git submodule update` space required as well as
avoid the max-path-len errors under Windows in most cases.
2023-06-15 17:05:04 -07:00
Paint Your Dragon fa7c287f07 Linker tweaks for RAM-resident PicoDVI library functions (#1541) 2023-06-15 15:01:02 -07:00
hreintke 9b3032cd58 WebServer: Solve HTTP request delay by dropping idle connections (#1537)
Serve next wificlient (http_request) if current client does not have data
2023-06-15 07:39:02 -07:00
Earle F. Philhower, III 50646b9e70 Update httpclient.rst (#1538) 2023-06-15 07:20:15 -07:00
Earle F. Philhower, III 3d6a1c7b41 Enable proper reuse of PIO programs (#1526)
* Enable proper reuse of PIO programs

Rewrite the PIOProgram helper class to properly re-use loaded programs
and to try to re-use loaded instructions before allocating a new PIO
program.

Supersedes #1524

* Less copy-pasta
2023-06-13 04:42:37 -07:00
Earle F. Philhower, III 5b76b0668b Addition ABM checks in PWMAudio and ADCInput (#1530)
Handle the case where the DMA manager is unable to completely allocate
needed resources (DMA channels or memory) and return `false` in ::begin()
2023-06-12 15:20:52 -07:00
Earle F. Philhower, III d18f8dce2f I2S check for failure of ARB and PIO allocation (#1528)
Per https://github.com/earlephilhower/arduino-pico/pull/1524#issuecomment-1587885054
2023-06-12 12:24:08 -07:00
Earle F. Philhower, III c64cdc14b6 Call I2S::end() in I2S destructor (#1527)
Per https://github.com/earlephilhower/arduino-pico/pull/1524#issuecomment-1587562257
2023-06-12 12:12:50 -07:00
Earle F. Philhower, III cc800713bd Minor clean up includes (#1520) 2023-06-10 20:42:28 -07:00
Linar Yusupov c6a0d6ecfe Fix for invalid __channelCount in ~AudioBufferManager() (#1519) 2023-06-10 10:51:19 -07:00
Earle F. Philhower, III c6426ae461 Update RP2040Support.h (#1518) 2023-06-09 07:59:05 -07:00
Earle F. Philhower, III 7b04a033b3 Update rp2040.rst (#1515) 2023-06-08 09:49:57 -07:00
madias123 8e4008bf12 Add rebootToBootloader to reboot to bootloader from code (#1514) 2023-06-08 09:48:35 -07:00
86 changed files with 3909 additions and 837 deletions
+7
View File
@@ -21,10 +21,12 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* Adafruit ItsyBitsy RP2040
* Adafruit KB2040
* Adafruit Macropad RP2040
* Adafruit Metro RP2040
* Adafruit QTPy RP2040
* Adafruit STEMMA Friend RP2040
* Adafruit Trinkey RP2040 QT
* Arduino Nano RP2040 Connect
* ArtronShop RP2 Nano
* BridgeTek IDM2040-7A
* Cytron Maker Pi RP2040
* Cytron Maker Nano RP2040
@@ -35,6 +37,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* ExtremeElectronics RC2040
* Invector Labs Challenger RP2040 WiFi
* Invector Labs Challenger RP2040 WiFi/BLE
* Invector Labs Challenger RP2040 WiFi6/BLE
* Invector Labs Challenger NB RP2040 WiFi
* Invector Labs Challenger RP2040 LTE
* Invector Labs Challenger RP2040 LoRa
@@ -47,8 +50,11 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* Neko Systems BL2040 Mini
* nullbits Bit-C PRO
* Pimoroni PGA2040
* Pimoroni Plasma2040
* Pimoroni Tiny2040
* Seeed Indicator RP2040
* Seeed XIAO RP2040
* Silicognition RP2040-Shim
* Solder Party RP2040 Stamp
* SparkFun ProMicro RP2040
* SparkFun Thing Plus RP2040
@@ -63,6 +69,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* WIZnet W5100S-EVB-Pico
* WIZnet W5500-EVB-Pico
* WIZnet WizFi360-EVB-Pico
* Redscorp RP2040-ProMini
* Generic (configurable flash, I/O pins)
# Installing via Arduino Boards Manager
+1722 -413
View File
File diff suppressed because it is too large Load Diff
+82
View File
@@ -0,0 +1,82 @@
/*
RP2040 PIO utility class
Copyright (c) 2023 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
*/
#include <Arduino.h>
#include "PIOProgram.h"
#include <map>
static std::map<const pio_program_t *, int> __pioMap[2];
auto_init_mutex(_pioMutex);
PIOProgram::PIOProgram(const pio_program_t *pgm) {
_pgm = pgm;
_pio = nullptr;
_sm = -1;
}
// We leave the INSN loaded in INSN RAM
PIOProgram::~PIOProgram() {
if (_pio) {
pio_sm_unclaim(_pio, _sm);
}
}
// Possibly load into a PIO and allocate a SM
bool PIOProgram::prepare(PIO *pio, int *sm, int *offset) {
CoreMutex m(&_pioMutex);
PIO pi[2] = { pio0, pio1 };
// If it's already loaded into PIO IRAM, try and allocate in that specific PIO
for (int o = 0; o < 2; o++) {
auto p = __pioMap[o].find(_pgm);
if (p != __pioMap[o].end()) {
int idx = pio_claim_unused_sm(pi[o], false);
if (idx >= 0) {
_pio = pi[o];
_sm = idx;
*pio = pi[o];
*sm = idx;
*offset = p->second;
return true;
}
}
}
// Not in any PIO IRAM, so try and add
for (int o = 0; o < 2; o++) {
if (pio_can_add_program(pi[o], _pgm)) {
int idx = pio_claim_unused_sm(pi[o], false);
if (idx >= 0) {
int off = pio_add_program(pi[o], _pgm);
__pioMap[o].insert({_pgm, off});
_pio = pi[o];
_sm = idx;
*pio = pi[o];
*sm = idx;
*offset = off;
return true;
}
}
}
// Nope, no room either for SMs or INSNs
return false;
}
+37
View File
@@ -0,0 +1,37 @@
/*
RP2040 PIO utility class
Copyright (c) 2023 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
*/
#pragma once
#include <hardware/pio.h>
// Wrapper class for PIO programs, abstracting common operations out
class PIOProgram {
public:
PIOProgram(const pio_program_t *pgm);
~PIOProgram();
// Possibly load into a PIO and allocate a SM
bool prepare(PIO *pio, int *sm, int *offset);
private:
const pio_program_t *_pgm;
PIO _pio;
int _sm;
};
+9 -56
View File
@@ -29,7 +29,9 @@
#include <pico/multicore.h>
#include <pico/rand.h>
#include <pico/util/queue.h>
#include <pico/bootrom.h>
#include "CoreMutex.h"
#include "PIOProgram.h"
#include "ccount.pio.h"
#include <malloc.h>
@@ -153,65 +155,9 @@ private:
class RP2040;
extern RP2040 rp2040;
extern "C" void main1();
class PIOProgram;
extern "C" char __StackLimit;
extern "C" char __bss_end__;
// Wrapper class for PIO programs, abstracting common operations out
// TODO - Add unload/destructor
class PIOProgram {
public:
PIOProgram(const pio_program_t *pgm) {
_pgm = pgm;
}
// Possibly load into a PIO and allocate a SM
bool prepare(PIO *pio, int *sm, int *offset) {
extern mutex_t _pioMutex;
CoreMutex m(&_pioMutex);
// Is there an open slot to run in, first?
if (!_findFreeSM(pio, sm)) {
return false;
}
// Is it loaded on that PIO?
if (_offset[pio_get_index(*pio)] < 0) {
// Nope, need to load it
if (!pio_can_add_program(*pio, _pgm)) {
return false;
}
_offset[pio_get_index(*pio)] = pio_add_program(*pio, _pgm);
}
// Here it's guaranteed loaded, return values
// PIO and SM already set
*offset = _offset[pio_get_index(*pio)];
return true;
}
private:
// Find an unused PIO state machine to grab, returns false when none available
static bool _findFreeSM(PIO *pio, int *sm) {
int idx = pio_claim_unused_sm(pio0, false);
if (idx >= 0) {
*pio = pio0;
*sm = idx;
return true;
}
idx = pio_claim_unused_sm(pio1, false);
if (idx >= 0) {
*pio = pio1;
*sm = idx;
return true;
}
return false;
}
private:
int _offset[2] = { -1, -1 };
const pio_program_t *_pgm;
};
class RP2040 {
public:
RP2040() { /* noop */ }
@@ -317,6 +263,13 @@ public:
reboot();
}
inline void rebootToBootloader() {
reset_usb_boot(0, 0);
while (1) {
continue;
}
}
static void enableDoubleResetBootloader();
void wdt_begin(uint32_t delay_ms) {
+12
View File
@@ -394,6 +394,18 @@ void __USBStart() {
}
bool __USBHIDReady() {
uint32_t start = millis();
const uint32_t timeout = 500;
while (((millis() - start) < timeout) && tud_ready() && !tud_hid_ready()) {
tud_task();
delay(1);
}
return tud_hid_ready();
}
// Invoked when received GET_REPORT control request
// Application must fill buffer report's content and return its length.
// Return zero will cause the stack to STALL request
+3
View File
@@ -45,3 +45,6 @@ int __USBGetJoystickReportID();
// Called by main() to init the USB HW/SW.
void __USBStart();
// Helper class for HID report sending with wait and timeout
bool __USBHIDReady();
+3 -3
View File
@@ -1,5 +1,5 @@
#pragma once
#define ARDUINO_PICO_MAJOR 3
#define ARDUINO_PICO_MINOR 2
#define ARDUINO_PICO_REVISION 2
#define ARDUINO_PICO_VERSION_STR "3.2.2"
#define ARDUINO_PICO_MINOR 4
#define ARDUINO_PICO_REVISION 1
#define ARDUINO_PICO_VERSION_STR "3.4.1"
+16
View File
@@ -40,6 +40,10 @@ bool SerialUART::setRX(pin_size_t pin) {
return true;
}
if (_rx == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set Serial%d.RX while running", uart_get_index(_uart) + 1);
} else {
@@ -57,6 +61,10 @@ bool SerialUART::setTX(pin_size_t pin) {
return true;
}
if (_tx == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set Serial%d.TX while running", uart_get_index(_uart) + 1);
} else {
@@ -74,6 +82,10 @@ bool SerialUART::setRTS(pin_size_t pin) {
return true;
}
if (_rts == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set Serial%d.RTS while running", uart_get_index(_uart) + 1);
} else {
@@ -91,6 +103,10 @@ bool SerialUART::setCTS(pin_size_t pin) {
return true;
}
if (_cts == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set Serial%d.CTS while running", uart_get_index(_uart) + 1);
} else {
+4 -1
View File
@@ -130,7 +130,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
static uint64_t last_avail_time;
int written = 0;
if (tud_cdc_connected()) {
if (tud_cdc_connected() || _ignoreFlowControl) {
for (size_t i = 0; i < length;) {
int n = length - i;
int avail = tud_cdc_write_available();
@@ -171,6 +171,9 @@ SerialUSB::operator bool() {
return tud_cdc_connected();
}
void SerialUSB::ignoreFlowControl(bool ignore) {
_ignoreFlowControl = ignore;
}
static bool _dtr = false;
static bool _rts = false;
+3
View File
@@ -44,6 +44,8 @@ public:
using Print::write;
operator bool() override;
void ignoreFlowControl(bool ignore = true);
// ESP8266 compat
void setDebugOutput(bool unused) {
(void) unused;
@@ -51,6 +53,7 @@ public:
private:
bool _running = false;
bool _ignoreFlowControl = false;
};
extern SerialUSB Serial;
-4
View File
@@ -29,8 +29,6 @@ extern "C" {
volatile bool __otherCoreIdled = false;
};
mutex_t _pioMutex;
extern void setup();
extern void loop();
@@ -91,8 +89,6 @@ extern "C" int main() {
_REENT_INIT_PTR(_impure_ptr1);
}
mutex_init(&_pioMutex);
rp2040.begin();
initVariant();
@@ -6,10 +6,9 @@
SPDX-License-Identifier: BSD-3-Clause
*/
#include "pico.h"
#include "pico/time.h"
#include "pico/bootrom.h"
#include "pico/binary_info.h"
#include <pico/time.h>
#include <pico/bootrom.h>
#include <pico/binary_info.h>
// PICO_CONFIG: PICO_BOOTSEL_VIA_DOUBLE_RESET_TIMEOUT_MS, Window of opportunity for a second press of a reset button to enter BOOTSEL mode (milliseconds), type=int, default=200, group=pico_bootsel_via_double_reset
#ifndef PICO_BOOTSEL_VIA_DOUBLE_RESET_TIMEOUT_MS
+2 -2
View File
@@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
# built documents.
#
# The short X.Y version.
version = u'3.2.2'
version = u'3.4.1'
# The full version, including alpha/beta/rc tags.
release = u'3.2.2'
release = u'3.4.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+2 -2
View File
@@ -325,8 +325,8 @@ info64
.. code:: cpp
FSInfo64 fsinfo;
SDFS.info(fsinfo);
or LittleFS(fsinfo);
SDFS.info64(fsinfo);
or LittleFS.info64(fsinfo);
Performs the same operation as ``info`` but allows for reporting greater than
4GB for filesystem size/used/etc. Should be used with the SD and SDFS
+1 -1
View File
@@ -1,7 +1,7 @@
HTTPClient Library
==================
A simple HTTP requestor that can handle both HTTP and HTTPS requests is
A simple HTTP requester that can handle both HTTP and HTTPS requests is
included as the ``HTTPClient`` library.
Check the examples for use under HTTP and HTTPS configurations. In general,
+26
View File
@@ -40,6 +40,16 @@ bool setDATA(pin_size_t pin)
Sets the DOUT or DIN pin of the I2S device. Any pin may be used.
Call before ``I2S::begin()``
bool setMCLK(pin_size_t pin)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the MCLK pin of the I2S device and enables MCLK output. Any pin may be used.
Call before ``I2S::begin()``
bool setMCLKmult(int mult)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the sample rate to MCLK multiplier value. Only multiples of 64 are valid.
Call before ``I2S::begin()``
bool setBitsPerSample(int bits)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify how many bits per audio sample to read or write. Note that
@@ -58,12 +68,28 @@ Sets the word clock frequency, but does not start the I2S device if not
already running. May be called after ``I2S::begin()`` to change the
sample rate on-the-fly.
bool setSysClk(int samplerate)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Changes the PICO system clock to optimise for the desired samplerate.
The clock changes to 147.6 MHz for samplerates that are a multiple of 8 kHz, and 135.6 MHz for multiples of 11.025 kHz.
Note that using ``setSysClk()`` may affect the timing of other sysclk-dependent functions.
Should be called before any I2S functions and any other sysclk dependent initialisations.
bool setLSBJFormat()
~~~~~~~~~~~~~~~~~~~~
Enables LSB-J format for I2S output. In this mode the MSB comes out at the
same time as the LRCLK changes, and not the normal 1-cycle delay. Useful for
DAC chips like the PT8211.
bool setTDMFormat()
~~~~~~~~~~~~~~~~~~~
Enabled TDM formatted multi-channel output. Be sure to set the number of channels to
the expected value (8 normally) and the bits per sample to 32.
bool setTDMChannels(int channels)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the number of TDM channels between frame syncs. Generally should be set to 8.
bool swapClocks()
~~~~~~~~~~~~~~~~~
Certain boards are hardwired with the WCLK before the BCLK, instead of the normal
+1 -1
View File
@@ -10,5 +10,5 @@ In addition, it contains code from additional open source projects:
* The `Pico-SDK <https://github.com/raspberrypi/pico-sdk>`_ and `Pico-Extras <https://github.com/raspberrypi/pico-extras>`_ are by Raspberry Pi (Trading) Ltd. and licensed under the BSD 3-Clause license.
* `Arduino-Pico <https://github.com/earlephilhower/arduino-pico>`_ core files are licenses under the LGPL.
* `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 Corporatio and licensed under the MIT license.
* `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.
+12 -12
View File
@@ -90,7 +90,7 @@ Signing requires the generation of an RSA-2048 key (other bit lengths are suppor
Automatic Signing
^^^^^^^^^^^^^^^^^
The simplest way of implementing signing is to use the automatic mode, which presently is only possible on Linux and Mac due to some of the tools not being available for Windows. This mode uses the IDE to configure the source code to enable sigining verification with a given public key, and signs binaries as part of the standard build process using a given public key.
The simplest way of implementing signing is to use the automatic mode, which presently is only possible on Linux and Mac due to some of the tools not being available for Windows. This mode uses the IDE to configure the source code to enable signing verification with a given public key, and signs binaries as part of the standard build process using a given public key.
To enable this mode, just include `private.key` and `public.key` in the sketch `.ino` directory. The IDE will call a helper script (`tools/signing.py`) before the build begins to create a header to enable key validation using the given public key, and to actually do the signing after the build process, generating a `sketch.bin.signed` file. When OTA is enabled (ArduinoOTA, Web, or HTTP), the binary will automatically only accept signed updates.
@@ -140,11 +140,11 @@ Compile the sketch normally and, once a `.bin` file is available, sign it using
Compression
-----------
The eboot bootloader incorporates a GZIP decompressor, built for very low code requirements. For applications, this optional decompression is completely transparent. For uploading compressed filesystems, the application must be built with `ATOMIC_FS_UPDATE` defined because, otherwise, eboot will not be involved in writing the filesystem.
The bootloader incorporates a GZIP decompressor, built for very low code requirements. For applications, this optional decompression is completely transparent.
No changes to the application are required. The `Updater` class and `eboot` bootloader (which performs actual application overwriting on update) automatically search for the `gzip` header in the uploaded binary, and if found, handle it.
No changes to the application are required. The `Updater` class and bootloader (which performs actual application overwriting on update) automatically search for the `gzip` header in the uploaded binary, and if found, handle it.
Compress an application `.bin` file or filesystem package using any `gzip` available, at any desired compression level (`gzip -9` is recommended because it provides the maximum compression and uncompresses as fast as any other compressino level). For example:
Compress an application `.bin` file or filesystem package using any `gzip` available, at any desired compression level (`gzip -9` is recommended because it provides the maximum compression and uncompresses as fast as any other compression level). For example:
.. code:: bash
@@ -185,11 +185,11 @@ Uploading modules wirelessly from Arduino IDE is intended for the following typi
- Only if modules are accessible on the same network as the computer with the Arduino IDE.
- For all IDE uploads,m the Pico W and the computer must be connected to the same network.
- For all IDE uploads, the Pico W and the computer must be connected to the same network.
To upload wirelessly from the IDE:
1. Build a sketch starts ``WiFi`` and includes the appropriare calls to ``ArduinoOTA`` (see the examples for reference). These include the ``ArduinoOTA.begin()`` call in ``setup()`` and periodically calling ``ArduinoOTA.handle();`` from the ``loop()``
1. Build a sketch starts ``WiFi`` and includes the appropriate calls to ``ArduinoOTA`` (see the examples for reference). These include the ``ArduinoOTA.begin()`` call in ``setup()`` and periodically calling ``ArduinoOTA.handle();`` from the ``loop()``
2. Upload using standard USB connection the first time.
@@ -200,7 +200,7 @@ To upload wirelessly from the IDE:
Password Protection
-------------------
Protecting your OTA uploads with password is really straightforward. All you need to do, is to include the following statement in your code:
Protecting your OTA uploads with a password is really straightforward. All you need to do, is to include the following statement in your code:
.. code:: cpp
@@ -208,11 +208,11 @@ Protecting your OTA uploads with password is really straightforward. All you nee
Where ``123`` is a sample password that you should replace with your own.
Before implementing it in your sketch, it is a good idea to check how it works using *BasicOTA.ino* sketch available under *File > Examples > ArduinoOTA*. Go ahead, open *BasicOTA.ino*, uncomment the above statement that is already there, and upload the sketch. To make troubleshooting easier, do not modify example sketch besides what is absolutely required. This is including original simple ``123`` OTA password. Then attempt to upload sketch again (using OTA). After compilation is complete, once upload is about to begin, you should see prompt for password.
Before implementing it in your sketch, it is a good idea to check how it works using *BasicOTA.ino* sketch available under *File > Examples > ArduinoOTA*. Go ahead, open *BasicOTA.ino*, uncomment the above statement that is already there, and upload the sketch. To make troubleshooting easier, do not modify example sketch besides what is absolutely required. This includes the original simple ``123`` OTA password. Then attempt to upload a sketch again (using OTA). After compilation is complete, once upload is about to begin, you should see a prompt for password.
Enter the password and upload should be initiated as usual with the only difference being ``Authenticating...OK`` message visible in upload log.
Enter the password and upload should be initiated as usual with the only difference being ``Authenticating...OK`` message visible in the upload log.
You will not be prompted for a reentering the same password next time. Arduino IDE will remember it for you. You will see prompt for password only after reopening IDE, or if you change it in your sketch, upload the sketch and then try to upload it again.
You will not be prompted for a reentering the same password next time. Arduino IDE will remember it for you. You will see a prompt for password only after reopening IDE, or if you change it in your sketch, upload the sketch and then try to upload it again.
Please note, it is possible to reveal password entered previously in Arduino IDE, if IDE has not been closed since last upload. This can be done by enabling *Show verbose output during: upload* in *File > Preferences* and attempting to upload the module.
@@ -289,7 +289,7 @@ Simple updater downloads the file every time the function is called.
Advanced updater
^^^^^^^^^^^^^^^^
Its possible to point the update function to a script on the server. If a version string argument is given, it will be sent to the server. The server side script can use this string to check whether an update should be performed.
It's possible to point the update function to a script on the server. If a version string argument is given, it will be sent to the server. The server side script can use this string to check whether an update should be performed.
The server-side script can respond as follows: - response code 200, and send the firmware image, - or response code 304 to notify Pico that no update is required.
@@ -305,7 +305,7 @@ The server-side script can respond as follows: - response code 200, and send the
Serial.println("[update] Update no Update.");
break;
case HTTP_UPDATE_OK:
Serial.println("[update] Update ok."); // may not be called since we reboot the RP2040
Serial.println("[update] Update ok.");
break;
}
+4
View File
@@ -95,3 +95,7 @@ void rp2040.enableDoubleResetBootloader()
Add a call anywhere in the sketch to ``rp2040.enableDoubleResetBootloader()`` and
the core will check for a double-tap on reset, and if found will start the USB
bootloader.
void rp2040.rebootToBootloader()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Will reboot the RP2040 into USB UF2 upload mode.
+10
View File
@@ -45,3 +45,13 @@ For applications where an IRQ driven serial port is not appropriate, use
For detailed information about the Serial ports, see the
Arduino `Serial Reference <https://www.arduino.cc/reference/en/language/functions/communication/serial/>`_ .
RP2040 Specific SerialUSB methods
---------------------------------
void Serial.ignoreFlowControl(bool ignore)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In some cases, the target application will not assert the DTR virtual line, thus preventing writing operations to succeed.
For this reason, the SerialUSB::ignoreFlowControl() method disables the connection's state verification, enabling the program to write on the port, even though the data might be lost.
+2 -2
View File
@@ -13,7 +13,7 @@
#define PICO_SDK_VERSION_MAJOR 1
#define PICO_SDK_VERSION_MINOR 5
#define PICO_SDK_VERSION_REVISION 0
#define PICO_SDK_VERSION_STRING "1.5.0"
#define PICO_SDK_VERSION_REVISION 1
#define PICO_SDK_VERSION_STRING "1.5.1"
#endif
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -1
View File
@@ -94,7 +94,9 @@ SECTIONS
/* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from
* FLASH ... we will include any thing excluded here in .data below by default */
*(.init)
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .text*)
/* Some of these excludes required for PicoDVI library, won't affect most code */
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a: *interp.c.obj *divider.S.obj *PicoDVI.cpp.o *dvi.c.o) .text*)
*(.fini)
/* Pull all c'tors into .text */
*crtbegin.o(.ctors)
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
source [find interface/picoprobe.cfg]
source [find target/rp2040.cfg]
+9 -1
View File
@@ -79,6 +79,10 @@ void ADCInput::onReceive(void(*fn)(void)) {
}
bool ADCInput::begin() {
if (_running) {
return false;
}
_running = true;
_isHolding = 0;
@@ -105,7 +109,11 @@ bool ADCInput::begin() {
setFrequency(_freq);
_arb = new AudioBufferManager(_buffers, _bufferWords, 0, INPUT, DMA_SIZE_16);
_arb->begin(DREQ_ADC, (volatile void*)&adc_hw->fifo);
if (!_arb->begin(DREQ_ADC, (volatile void*)&adc_hw->fifo)) {
delete _arb;
_arb = nullptr;
return false;
}
_arb->setCallback(_cb);
adc_fifo_drain();
@@ -20,8 +20,8 @@
*/
#include <Arduino.h>
#include "hardware/dma.h"
#include "hardware/irq.h"
#include <hardware/dma.h>
#include <hardware/irq.h>
#include "AudioBufferManager.h"
static int __channelCount = 0; // # of channels left. When we hit 0, then remove our handler
@@ -73,13 +73,11 @@ AudioBufferManager::~AudioBufferManager() {
if (_running) {
_running = false;
for (auto i = 0; i < 2; i++) {
dma_channel_set_irq0_enabled(_channelDMA[i], false);
dma_channel_cleanup(_channelDMA[i]);
__channelMap[_channelDMA[i]] = nullptr;
dma_channel_abort(_channelDMA[i]);
dma_channel_unclaim(_channelDMA[i]);
dma_channel_acknowledge_irq0(_channelDMA[i]);
__channelCount--;
}
__channelCount--;
if (!__channelCount) {
irq_set_enabled(DMA_IRQ_0, false);
// TODO - how can we know if there are no other parts of the core using DMA0 IRQ??
@@ -21,7 +21,7 @@
#pragma once
#include <Arduino.h>
#include "hardware/dma.h"
#include <hardware/dma.h>
class AudioBufferManager {
public:
-4
View File
@@ -282,11 +282,7 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient& http, const String& curren
_cbEnd();
}
#ifdef ATOMIC_FS_UPDATE
if (_rebootOnUpdate) {
#else
if (_rebootOnUpdate && !spiffs) {
#endif
rp2040.restart();
}
@@ -0,0 +1,84 @@
/*
This example demonstrates I2S output with the optional MCLK signal.
Note: System clock sppeds used here may not be compatible with all other libraries
requiring specific sys_clks, particularly Pico PIO USB.
Original 17 November 2016
by Sandeep Mistry
modified for RP2040 by Earle F. Philhower, III <earlephilhower@yahoo.com>
bool setBCLK(pin_size_t pin);
- 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 setDATA(pin_size_t pin);
- Sets the DOUT pin, can be any valid GPIO pin
modified for MCLK by Richard Palmer June 2023
*/
#include <I2S.h>
// Create the I2S port using a PIO state machine
I2S i2s(OUTPUT);
// GPIO pin numbers
#define pDOUT 19
#define pBCLK 20
#define pWS (pBCLK+1)
#define pMCLK 22 // optional MCLK pin
const int frequency = 440; // frequency of square wave in Hz
const int sampleRate = 16000; // minimum for many i2s DACs
const int bitsPerSample = 16;
const int amplitude = 1 << (bitsPerSample - 2); // amplitude of square wave = 1/2 of maximum
#define MCLK_MUL 256 // depends on audio hardware. Suits common hardware.
const int halfWavelength = sampleRate / (2 * frequency); // half wavelength of square wave
int16_t sample = amplitude; // current sample value
int count = 0;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, 1);
// set the system clock to a compatible value to the samplerate
i2s.setSysClk(sampleRate); // best to do this before starting anything clock-dependent
Serial.begin(115200);
while (!Serial) {
delay(10);
}
Serial.println("I2S with MCLK - square wave");
i2s.setBCLK(pBCLK);
i2s.setDATA(pDOUT);
i2s.setMCLK(pMCLK); // must be run before setFrequency() and i2s.begin()
i2s.setMCLKmult(MCLK_MUL); // also before i2s.begin()
i2s.setBitsPerSample(16);
// start I2S at the sample rate with 16-bits per sample
if (!i2s.begin(sampleRate)) {
Serial.println("Failed to initialize I2S!");
while (100); // do nothing
}
}
void loop() {
if (count % halfWavelength == 0) {
// invert the sample every half wavelength count multiple to generate square wave
sample = -1 * sample;
}
// write the same sample twice, once for left and once for the right channel
i2s.write(sample);
i2s.write(sample);
// increment the counter for the next sample
count++;
}
+49
View File
@@ -0,0 +1,49 @@
/*
This example just sends out TDM data on 8 channels with their value
equal to the channel number.
Released to the public domain by Earle F. Philhower, III <earlephilhower@yahoo.com>
*/
#include <I2S.h>
// Create the I2S port using a PIO state machine
I2S i2s(OUTPUT);
// GPIO pin numbers
#define pBCLK 20
#define pWS (pBCLK+1)
#define pDOUT 22
const int sampleRate = 1000;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, 1);
Serial.begin(115200);
Serial.println("I2S TDM test");
i2s.setBCLK(pBCLK);
i2s.setDATA(pDOUT);
i2s.setBitsPerSample(32);
i2s.setTDMFormat();
i2s.setTDMChannels(8);
// 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() {
uint32_t x = 0;
while (1) {
i2s.write(x & 0x07);
if (!(x % 10000)) {
Serial.println(x);
}
x++;
}
}
+5
View File
@@ -16,11 +16,16 @@ end KEYWORD2
setBCLK KEYWORD2
setDATA KEYWORD2
setMCLK KEYWORD2
setBitsPerSample KEYWORD2
setFrequency KEYWORD2
setBuffers KEYWORD2
setLSBJFormat KEYWORD2
setTDMFormat KEYWORD2
setTDMChannels KEYWORD2
swapClocks KEYWORD2
setMCLKmult KEYWORD2
setSysClk KEYWORD2
read8 KEYWORD2
read16 KEYWORD2
+101 -14
View File
@@ -21,6 +21,7 @@
#include <Arduino.h>
#include "I2S.h"
#include "pio_i2s.pio.h"
#include <pico/stdlib.h>
I2S::I2S(PinMode direction) {
@@ -30,6 +31,8 @@ I2S::I2S(PinMode direction) {
_isOutput = direction == OUTPUT;
_pinBCLK = 26;
_pinDOUT = 28;
_pinMCLK = 25;
_MCLKenabled = false;
#ifdef PIN_I2S_BCLK
_pinBCLK = PIN_I2S_BCLK;
#endif
@@ -52,10 +55,14 @@ I2S::I2S(PinMode direction) {
_bufferWords = 0;
_silenceSample = 0;
_isLSBJ = false;
_isTDM = false;
_tdmChannels = 8;
_swapClocks = false;
_multMCLK = 256;
}
I2S::~I2S() {
end();
}
bool I2S::setBCLK(pin_size_t pin) {
@@ -66,6 +73,14 @@ bool I2S::setBCLK(pin_size_t pin) {
return true;
}
bool I2S::setMCLK(pin_size_t pin) {
if (_running || (pin > 28)) {
return false;
}
_pinMCLK = pin;
return true;
}
bool I2S::setDATA(pin_size_t pin) {
if (_running || (pin > 29)) {
return false;
@@ -95,12 +110,41 @@ bool I2S::setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample)
bool I2S::setFrequency(int newFreq) {
_freq = newFreq;
if (_running) {
float bitClk = _freq * _bps * 2.0 /* channels */ * 2.0 /* edges per clock */;
pio_sm_set_clkdiv(_pio, _sm, (float)clock_get_hz(clk_sys) / bitClk);
if (_MCLKenabled) {
int bitClk = _freq * _bps * (_isTDM ? (double)_tdmChannels : 2.0) /* channels */ * 2.0 /* edges per clock */;
pio_sm_set_clkdiv_int_frac(_pio, _sm, clock_get_hz(clk_sys) / bitClk, 0);
} else {
float bitClk = _freq * _bps * (_isTDM ? (double)_tdmChannels : 2.0) /* channels */ * 2.0 /* edges per clock */;
pio_sm_set_clkdiv(_pio, _sm, (float)clock_get_hz(clk_sys) / bitClk);
}
}
return true;
}
bool I2S::setSysClk(int samplerate) { // optimise sys_clk for desired samplerate
if (samplerate % 11025 == 0) {
set_sys_clock_khz(I2SSYSCLK_44_1, false); // 147.6 unsuccessful - no I2S no USB
return true;
}
if (samplerate % 8000 == 0) {
set_sys_clock_khz(I2SSYSCLK_8, false);
return true;
}
return false;
}
bool I2S::setMCLKmult(int mult) {
if (_running || !_isOutput) {
return false;
}
if ((mult % 64) == 0) {
_MCLKenabled = true;
_multMCLK = mult;
return true;
}
return false;
}
bool I2S::setLSBJFormat() {
if (_running || !_isOutput) {
return false;
@@ -109,6 +153,22 @@ bool I2S::setLSBJFormat() {
return true;
}
bool I2S::setTDMFormat() {
if (_running || !_isOutput) {
return false;
}
_isTDM = true;
return true;
}
bool I2S::setTDMChannels(int channels) {
if (_running || !_isOutput) {
return false;
}
_tdmChannels = channels;
return true;
}
bool I2S::swapClocks() {
if (_running || !_isOutput) {
return false;
@@ -135,19 +195,36 @@ void I2S::onReceive(void(*fn)(void)) {
}
}
void I2S::MCLKbegin() {
int off = 0;
_i2sMCLK = new PIOProgram(&pio_i2s_mclk_program);
_i2sMCLK->prepare(&_pioMCLK, &_smMCLK, &off); // not sure how to use the same PIO
pio_i2s_MCLK_program_init(_pioMCLK, _smMCLK, off, _pinMCLK);
int mClk = _multMCLK * _freq * 2.0 /* edges per clock */;
pio_sm_set_clkdiv_int_frac(_pioMCLK, _smMCLK, clock_get_hz(clk_sys) / mClk, 0);
pio_sm_set_enabled(_pioMCLK, _smMCLK, true);
}
bool I2S::begin() {
_running = true;
_hasPeeked = false;
_isHolding = 0;
int off = 0;
if (!_swapClocks) {
_i2s = new PIOProgram(_isOutput ? (_isLSBJ ? &pio_lsbj_out_program : &pio_i2s_out_program) : &pio_i2s_in_program);
_i2s = new PIOProgram(_isOutput ? (_isTDM ? &pio_tdm_out_program : (_isLSBJ ? &pio_lsbj_out_program : &pio_i2s_out_program)) : &pio_i2s_in_program);
} else {
_i2s = new PIOProgram(_isOutput ? (_isLSBJ ? &pio_lsbj_out_swap_program : &pio_i2s_out_swap_program) : &pio_i2s_in_swap_program);
_i2s = new PIOProgram(_isOutput ? (_isTDM ? &pio_tdm_out_swap_program : (_isLSBJ ? &pio_lsbj_out_swap_program : &pio_i2s_out_swap_program)) : &pio_i2s_in_swap_program);
}
if (!_i2s->prepare(&_pio, &_sm, &off)) {
_running = false;
delete _i2s;
_i2s = nullptr;
return false;
}
_i2s->prepare(&_pio, &_sm, &off);
if (_isOutput) {
if (_isLSBJ) {
if (_isTDM) {
pio_tdm_out_program_init(_pio, _sm, off, _pinDOUT, _pinBCLK, _bps, _swapClocks, _tdmChannels);
} else if (_isLSBJ) {
pio_lsbj_out_program_init(_pio, _sm, off, _pinDOUT, _pinBCLK, _bps, _swapClocks);
} else {
pio_i2s_out_program_init(_pio, _sm, off, _pinDOUT, _pinBCLK, _bps, _swapClocks);
@@ -156,6 +233,9 @@ bool I2S::begin() {
pio_i2s_in_program_init(_pio, _sm, off, _pinDOUT, _pinBCLK, _bps, _swapClocks);
}
setFrequency(_freq);
if (_MCLKenabled) {
MCLKbegin();
}
if (_bps == 8) {
uint8_t a = _silenceSample & 0xff;
_silenceSample = (a << 24) | (a << 16) | (a << 8) | a;
@@ -167,7 +247,14 @@ bool I2S::begin() {
_bufferWords = 64 * (_bps == 32 ? 2 : 1);
}
_arb = new AudioBufferManager(_buffers, _bufferWords, _silenceSample, _isOutput ? OUTPUT : INPUT);
_arb->begin(pio_get_dreq(_pio, _sm, _isOutput), _isOutput ? &_pio->txf[_sm] : (volatile void*)&_pio->rxf[_sm]);
if (!_arb->begin(pio_get_dreq(_pio, _sm, _isOutput), _isOutput ? &_pio->txf[_sm] : (volatile void*)&_pio->rxf[_sm])) {
_running = false;
delete _arb;
_arb = nullptr;
delete _i2s;
_i2s = nullptr;
return false;
}
_arb->setCallback(_cb);
pio_sm_set_enabled(_pio, _sm, true);
@@ -176,6 +263,11 @@ bool I2S::begin() {
void I2S::end() {
if (_running) {
if (_MCLKenabled) {
pio_sm_set_enabled(_pioMCLK, _smMCLK, false);
delete _i2sMCLK;
_i2sMCLK = nullptr;
}
pio_sm_set_enabled(_pio, _sm, false);
_running = false;
delete _arb;
@@ -191,13 +283,8 @@ int I2S::available() {
} else {
auto avail = _arb->available();
avail *= 4; // 4 samples per 32-bits
if (_bps < 24) {
if (_isOutput) {
// 16- and 8-bit can have holding bytes available
avail += (32 - _isHolding) / 8;
} else {
avail += _isHolding / 8;
}
if (_bps < 24 && !_isOutput) {
avail += _isHolding / 8;
}
return avail;
}
+17 -2
View File
@@ -30,11 +30,16 @@ public:
bool setBCLK(pin_size_t pin);
bool setDATA(pin_size_t pin);
bool setMCLK(pin_size_t pin);
bool setBitsPerSample(int bps);
bool setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample = 0);
bool setFrequency(int newFreq);
bool setLSBJFormat();
bool setTDMFormat();
bool setTDMChannels(int channels);
bool swapClocks();
bool setMCLKmult(int mult);
bool setSysClk(int samplerate);
bool begin(long sampleRate) {
setFrequency(sampleRate);
@@ -110,14 +115,19 @@ public:
private:
pin_size_t _pinBCLK;
pin_size_t _pinDOUT;
pin_size_t _pinMCLK;
int _bps;
int _freq;
int _multMCLK;
size_t _buffers;
size_t _bufferWords;
int32_t _silenceSample;
bool _isLSBJ;
bool _isTDM;
int _tdmChannels;
bool _isOutput;
bool _swapClocks;
bool _MCLKenabled;
bool _running;
@@ -132,9 +142,14 @@ private:
int _isHolding = 0;
void (*_cb)();
void MCLKbegin();
AudioBufferManager *_arb;
PIOProgram *_i2s;
PIO _pio;
int _sm;
PIOProgram *_i2sMCLK;
PIO _pio, _pioMCLK;
int _sm, _smMCLK;
static const int I2SSYSCLK_44_1 = 135600; // 44.1, 88.2 kHz sample rates
static const int I2SSYSCLK_8 = 147600; // 8k, 16, 32, 48, 96, 192 kHz
};
+76
View File
@@ -19,7 +19,16 @@
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.program pio_i2s_mclk
; PIO SM clock is MCLK x 2
; MCLK/BCLK sync is maintained by ensuring IN/OUT PIO SM clock dividers
; are x128, 384, 256, 512 or 768 multiples of MCLK SM divider as required.
loop_mclk:
set pins, 1 ; toggle mclk
set pins, 0
; Loop back to beginning...
.program pio_i2s_out
.side_set 2 ; 0 = bclk, 1=wclk
@@ -63,6 +72,38 @@ right:
; Loop back to beginning...
.program pio_tdm_out
.side_set 2 ; 0 = bclk, 1 = wclk
; The C code should place (number of bits - 1) in Y and update SHIFTCTRL
; to be 32 (as per the TDM specs)
; +----- WCLK
; |+---- BCLK
mov x, y side 0b11
bitloop:
out pins, 1 side 0b00
jmp x-- bitloop side 0b01
lastbit:
out pins, 1 side 0b10
; Loop back to the beginning
.program pio_tdm_out_swap
.side_set 2 ; 0 = wclk, 1 = bclk
; The C code should place (number of bits - 1) in Y and update SHIFTCTRL
; to be 32 (as per the TDM specs)
; +----- BCLK
; |+---- WCLK
mov x, y side 0b11
bitloop:
out pins, 1 side 0b00
jmp x-- bitloop side 0b10
lastbit:
out pins, 1 side 0b01
; Loop back to the beginning
.program pio_lsbj_out
.side_set 2 ; 0 = bclk, 1=wclk
@@ -157,6 +198,14 @@ right:
% c-sdk {
static inline void pio_i2s_MCLK_program_init(PIO pio, uint sm, uint offset, uint MCLK_pin) {
pio_gpio_init(pio, MCLK_pin);
pio_sm_set_consecutive_pindirs(pio, sm, MCLK_pin, 1, true);
pio_sm_config sm_config = pio_i2s_mclk_program_get_default_config(offset);
sm_config_set_set_pins(&sm_config, MCLK_pin, 1);
pio_sm_init(pio, sm, offset, &sm_config);
}
static inline void pio_i2s_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits, bool swap) {
pio_gpio_init(pio, data_pin);
pio_gpio_init(pio, clock_pin_base);
@@ -178,6 +227,33 @@ static inline void pio_i2s_out_program_init(PIO pio, uint sm, uint offset, uint
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
}
static inline void pio_tdm_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits, bool swap, uint channels) {
pio_gpio_init(pio, data_pin);
pio_gpio_init(pio, clock_pin_base);
pio_gpio_init(pio, clock_pin_base + 1);
pio_sm_config sm_config = swap ? pio_tdm_out_swap_program_get_default_config(offset) : pio_tdm_out_program_get_default_config(offset);
sm_config_set_out_pins(&sm_config, data_pin, 1);
sm_config_set_sideset_pins(&sm_config, clock_pin_base);
sm_config_set_out_shift(&sm_config, false, true, 32);
sm_config_set_fifo_join(&sm_config, PIO_FIFO_JOIN_TX);
pio_sm_init(pio, sm, offset, &sm_config);
uint pin_mask = (1u << data_pin) | (3u << clock_pin_base);
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
pio_sm_set_pins(pio, sm, 0); // clear pins
// Can't set constant > 31, so push and pop/mov
pio_sm_put_blocking(pio, sm, bits * channels - 2);
pio_sm_exec(pio, sm, pio_encode_pull(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_y, pio_osr));
// Need to make OSR believe there's nothing left to shift out, or the 1st word will be the count we just passed in, not a sample
pio_sm_exec(pio, sm, pio_encode_out(pio_osr, 32));
}
static inline void pio_lsbj_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits, bool swap) {
pio_gpio_init(pio, data_pin);
pio_gpio_init(pio, clock_pin_base);
+117
View File
@@ -8,6 +8,34 @@
#include "hardware/pio.h"
#endif
// ------------ //
// pio_i2s_mclk //
// ------------ //
#define pio_i2s_mclk_wrap_target 0
#define pio_i2s_mclk_wrap 1
static const uint16_t pio_i2s_mclk_program_instructions[] = {
// .wrap_target
0xe001, // 0: set pins, 1
0xe000, // 1: set pins, 0
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program pio_i2s_mclk_program = {
.instructions = pio_i2s_mclk_program_instructions,
.length = 2,
.origin = -1,
};
static inline pio_sm_config pio_i2s_mclk_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + pio_i2s_mclk_wrap_target, offset + pio_i2s_mclk_wrap);
return c;
}
#endif
// ----------- //
// pio_i2s_out //
// ----------- //
@@ -78,6 +106,68 @@ static inline pio_sm_config pio_i2s_out_swap_program_get_default_config(uint off
}
#endif
// ----------- //
// pio_tdm_out //
// ----------- //
#define pio_tdm_out_wrap_target 0
#define pio_tdm_out_wrap 3
static const uint16_t pio_tdm_out_program_instructions[] = {
// .wrap_target
0xb822, // 0: mov x, y side 3
0x6001, // 1: out pins, 1 side 0
0x0841, // 2: jmp x--, 1 side 1
0x7001, // 3: out pins, 1 side 2
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program pio_tdm_out_program = {
.instructions = pio_tdm_out_program_instructions,
.length = 4,
.origin = -1,
};
static inline pio_sm_config pio_tdm_out_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + pio_tdm_out_wrap_target, offset + pio_tdm_out_wrap);
sm_config_set_sideset(&c, 2, false, false);
return c;
}
#endif
// ---------------- //
// pio_tdm_out_swap //
// ---------------- //
#define pio_tdm_out_swap_wrap_target 0
#define pio_tdm_out_swap_wrap 3
static const uint16_t pio_tdm_out_swap_program_instructions[] = {
// .wrap_target
0xb822, // 0: mov x, y side 3
0x6001, // 1: out pins, 1 side 0
0x1041, // 2: jmp x--, 1 side 2
0x6801, // 3: out pins, 1 side 1
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program pio_tdm_out_swap_program = {
.instructions = pio_tdm_out_swap_program_instructions,
.length = 4,
.origin = -1,
};
static inline pio_sm_config pio_tdm_out_swap_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + pio_tdm_out_swap_wrap_target, offset + pio_tdm_out_swap_wrap);
sm_config_set_sideset(&c, 2, false, false);
return c;
}
#endif
// ------------ //
// pio_lsbj_out //
// ------------ //
@@ -217,6 +307,13 @@ static inline pio_sm_config pio_i2s_in_swap_program_get_default_config(uint offs
return c;
}
static inline void pio_i2s_MCLK_program_init(PIO pio, uint sm, uint offset, uint MCLK_pin) {
pio_gpio_init(pio, MCLK_pin);
pio_sm_set_consecutive_pindirs(pio, sm, MCLK_pin, 1, true);
pio_sm_config sm_config = pio_i2s_mclk_program_get_default_config(offset);
sm_config_set_set_pins(&sm_config, MCLK_pin, 1);
pio_sm_init(pio, sm, offset, &sm_config);
}
static inline void pio_i2s_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits, bool swap) {
pio_gpio_init(pio, data_pin);
pio_gpio_init(pio, clock_pin_base);
@@ -232,6 +329,26 @@ static inline void pio_i2s_out_program_init(PIO pio, uint sm, uint offset, uint
pio_sm_set_pins(pio, sm, 0); // clear pins
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
}
static inline void pio_tdm_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits, bool swap, uint channels) {
pio_gpio_init(pio, data_pin);
pio_gpio_init(pio, clock_pin_base);
pio_gpio_init(pio, clock_pin_base + 1);
pio_sm_config sm_config = swap ? pio_tdm_out_swap_program_get_default_config(offset) : pio_tdm_out_program_get_default_config(offset);
sm_config_set_out_pins(&sm_config, data_pin, 1);
sm_config_set_sideset_pins(&sm_config, clock_pin_base);
sm_config_set_out_shift(&sm_config, false, true, 32);
sm_config_set_fifo_join(&sm_config, PIO_FIFO_JOIN_TX);
pio_sm_init(pio, sm, offset, &sm_config);
uint pin_mask = (1u << data_pin) | (3u << clock_pin_base);
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
pio_sm_set_pins(pio, sm, 0); // clear pins
// Can't set constant > 31, so push and pop/mov
pio_sm_put_blocking(pio, sm, bits * channels - 2);
pio_sm_exec(pio, sm, pio_encode_pull(false, false));
pio_sm_exec(pio, sm, pio_encode_mov(pio_y, pio_osr));
// Need to make OSR believe there's nothing left to shift out, or the 1st word will be the count we just passed in, not a sample
pio_sm_exec(pio, sm, pio_encode_out(pio_osr, 32));
}
static inline void pio_lsbj_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits, bool swap) {
pio_gpio_init(pio, data_pin);
pio_gpio_init(pio, clock_pin_base);
+1 -1
View File
@@ -40,7 +40,7 @@ Joystick_::Joystick_(void) {
void Joystick_::send_now(void) {
CoreMutex m(&__usb_mutex);
tud_task();
if (tud_hid_ready()) {
if (__USBHIDReady()) {
tud_hid_n_report(0, __USBGetJoystickReportID(), &data, sizeof(data));
}
tud_task();
+2 -2
View File
@@ -40,7 +40,7 @@ Keyboard_::Keyboard_(void) {
void Keyboard_::sendReport(KeyReport* keys) {
CoreMutex m(&__usb_mutex);
tud_task();
if (tud_hid_ready()) {
if (__USBHIDReady()) {
tud_hid_keyboard_report(__USBGetKeyboardReportID(), keys->modifiers, keys->keys);
}
tud_task();
@@ -49,7 +49,7 @@ void Keyboard_::sendReport(KeyReport* keys) {
void Keyboard_::sendConsumerReport(uint16_t key) {
CoreMutex m(&__usb_mutex);
tud_task();
if (tud_hid_ready()) {
if (__USBHIDReady()) {
tud_hid_report(__USBGetKeyboardReportID() + 1, &key, sizeof(key));
}
tud_task();
@@ -268,7 +268,11 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
remote = m_pUDPContext->getRemoteAddress();
local = WiFi.localIP();
netmask = WiFi.subnetMask();
#if LWIP_IPV6
if (ip4_addr_netcmp(&remote.u_addr.ip4, &local.u_addr.ip4, &netmask.u_addr.ip4))
#else
if (ip4_addr_netcmp(&remote, &local, &netmask))
#endif
// ip_info IPInfo_Local;
// ip_info IPInfo_Remote;
// if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress()))
@@ -1539,15 +1539,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(
return bResult;
}
/*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address (const)
*/
const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(
const IPAddress& p_IPAddress) const {
return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
}
/*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
*/
+1 -1
View File
@@ -44,7 +44,7 @@ Mouse_::Mouse_(void) {
void Mouse_::move(int x, int y, signed char wheel) {
CoreMutex m(&__usb_mutex);
tud_task();
if (tud_hid_ready()) {
if (__USBHIDReady()) {
tud_hid_mouse_report(__USBGetMouseReportID(), _buttons, limit_xy(x), limit_xy(y), wheel, 0);
}
tud_task();
+4 -4
View File
@@ -5,11 +5,11 @@
#include "OpenPDMFilter.h"
extern "C" {
#include "hardware/pio.h"
#include "hardware/dma.h"
#include "hardware/clocks.h"
#include <hardware/pio.h>
#include <hardware/dma.h>
#include <hardware/clocks.h>
}
#include "hardware/sync.h"
#include <hardware/sync.h>
#include "pdm.pio.h"
static PIOProgram _pdmPgm(&pdm_pio_program);
+11 -1
View File
@@ -100,6 +100,10 @@ void PWMAudio::onTransmit(void(*fn)(void)) {
}
bool PWMAudio::begin() {
if (_running) {
return false;
}
if (_stereo && (_pin & 1)) {
// Illegal, need to have consecutive pins on the same PWM slice
Serial.printf("ERROR: PWMAudio stereo mode requires pin be even\n");
@@ -118,7 +122,13 @@ bool PWMAudio::begin() {
uint32_t ccAddr = PWM_BASE + PWM_CH0_CC_OFFSET + pwm_gpio_to_slice_num(_pin) * 20;
_arb = new AudioBufferManager(_buffers, _bufferWords, 0x80008000, OUTPUT, DMA_SIZE_32);
_arb->begin(pwm_get_dreq(pwm_gpio_to_slice_num(_pin)), (volatile void*)ccAddr);
if (!_arb->begin(pwm_get_dreq(pwm_gpio_to_slice_num(_pin)), (volatile void*)ccAddr)) {
_running = false;
delete _arb;
_arb = nullptr;
return false;
}
_arb->setCallback(_cb);
return true;
+2 -2
View File
@@ -101,8 +101,8 @@ public:
info.blockSize = _fs.vol()->bytesPerCluster();
info.pageSize = 0; // TODO ?
info.maxPathLength = 255; // TODO ?
info.totalBytes = _fs.vol()->clusterCount() * info.blockSize;
info.usedBytes = info.totalBytes - (_fs.vol()->freeClusterCount() * _fs.vol()->bytesPerCluster());
info.totalBytes = (uint64_t)_fs.vol()->clusterCount() * (uint64_t)info.blockSize;
info.usedBytes = info.totalBytes - ((uint64_t)_fs.vol()->freeClusterCount() * (uint64_t)_fs.vol()->bytesPerCluster());
return true;
}
+18 -1
View File
@@ -177,7 +177,7 @@ void SPIClassRP2040::transfer(const void *txbuf, void *rxbuf, size_t count) {
}
void SPIClassRP2040::beginTransaction(SPISettings settings) {
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s\n", _spis.getClockFreq(), (_spis.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s)\n", settings.getClockFreq(), (settings.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
if (_initted && settings == _spis) {
DEBUGSPI("SPI: Reusing existing initted SPI\n");
} else {
@@ -188,6 +188,7 @@ void SPIClassRP2040::beginTransaction(SPISettings settings) {
}
DEBUGSPI("SPI: initting SPI\n");
spi_init(_spi, _spis.getClockFreq());
DEBUGSPI("SPI: actual baudrate=%u\n", spi_get_baudrate(_spi));
_initted = true;
}
}
@@ -205,6 +206,10 @@ bool SPIClassRP2040::setRX(pin_size_t pin) {
return true;
}
if (_RX == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set SPI%s.RX while running", spi_get_index(_spi) ? "1" : "");
} else {
@@ -222,6 +227,10 @@ bool SPIClassRP2040::setCS(pin_size_t pin) {
return true;
}
if (_CS == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set SPI%s.CS while running", spi_get_index(_spi) ? "1" : "");
} else {
@@ -239,6 +248,10 @@ bool SPIClassRP2040::setSCK(pin_size_t pin) {
return true;
}
if (_SCK == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set SPI%s.SCK while running", spi_get_index(_spi) ? "1" : "");
} else {
@@ -256,6 +269,10 @@ bool SPIClassRP2040::setTX(pin_size_t pin) {
return true;
}
if (_TX == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set SPI%s.TX while running", spi_get_index(_spi) ? "1" : "");
} else {
+1
View File
@@ -123,6 +123,7 @@ bool UpdaterClass::begin(size_t size, int command) {
//initialize
_startAddress = updateStartAddress;
_currentAddress = _startAddress; // Only used in the FS upload case
_size = size;
_bufferSize = 4096;
_buffer = new uint8_t[_bufferSize];
-67
View File
@@ -237,73 +237,6 @@ void HTTPServer::serveStatic(const char* uri, FS& fs, const char* path, const ch
_addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header));
}
void HTTPServer::httpHandleClient() {
bool keepCurrentClient = false;
bool callYield = false;
if (_currentClient->connected()) {
switch (_currentStatus) {
case HC_NONE:
// No-op to avoid C++ compiler warning
break;
case HC_WAIT_READ:
// Wait for data from client to become available
if (_currentClient->available()) {
switch (_parseRequest(_currentClient)) {
case CLIENT_REQUEST_CAN_CONTINUE:
// Because HTTP_MAX_SEND_WAIT is expressed in milliseconds, it must be divided by 1000
_currentClient->setTimeout(HTTP_MAX_SEND_WAIT / 1000);
_contentLength = CONTENT_LENGTH_NOT_SET;
_handleRequest();
/* fallthrough */
case CLIENT_REQUEST_IS_HANDLED:
if (_currentClient->connected() || _currentClient->available()) {
_currentStatus = HC_WAIT_CLOSE;
_statusChange = millis();
keepCurrentClient = true;
} else {
log_v("webserver: peer has closed after served\n");
}
break;
case CLIENT_MUST_STOP:
log_v("Close client\n");
_currentClient->stop();
break;
case CLIENT_IS_GIVEN:
// client must not be stopped but must not be handled here anymore
// (example: tcp connection given to websocket)
log_v("Give client\n");
break;
} // switch _parseRequest()
} else { // !_currentClient->available()
if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) {
keepCurrentClient = true;
}
callYield = true;
}
break;
case HC_WAIT_CLOSE:
// Wait for client to close the connection
if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) {
keepCurrentClient = true;
callYield = true;
}
}
}
if (!keepCurrentClient) {
if (_currentClient) {
delete _currentClient;
_currentClient = nullptr;
}
_currentStatus = HC_NONE;
_currentUpload.reset();
}
if (callYield) {
yield();
}
}
void HTTPServer::httpClose() {
_currentStatus = HC_NONE;
+1 -1
View File
@@ -41,6 +41,7 @@ enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
#endif
#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request
#define HTTP_MAX_DATA_AVAILABLE_WAIT 30 //ms to wait for the client to send the request when there is another client with data available
#define HTTP_MAX_POST_WAIT 5000 //ms to wait for POST data to arrive
#define HTTP_MAX_SEND_WAIT 5000 //ms to wait for data chunk to be ACKed
#define HTTP_MAX_CLOSE_WAIT 2000 //ms to wait for the client to close the connection
@@ -74,7 +75,6 @@ public:
virtual ~HTTPServer();
virtual void httpClose();
virtual void httpHandleClient();
bool authenticate(const char * username, const char * password);
void requestAuthentication(HTTPAuthMethod mode = BASIC_AUTH, const char* realm = nullptr, const String& authFailMsg = String(""));
+79 -5
View File
@@ -90,19 +90,93 @@ void WebServerTemplate<ServerType, DefaultPort>::handleClient() {
_currentClient = nullptr;
}
ClientType client = _server.available();
if (!client) {
_currentClient = new ClientType(_server.available());
if (!_currentClient) {
if (_nullDelay) {
delay(1);
}
return;
}
_currentClient = new ClientType(client);
_currentStatus = HC_WAIT_READ;
_statusChange = millis();
}
httpHandleClient();
bool keepCurrentClient = false;
bool callYield = false;
if (_currentClient->connected()) {
switch (_currentStatus) {
case HC_NONE:
// No-op to avoid C++ compiler warning
break;
case HC_WAIT_READ:
// Wait for data from client to become available
if (_currentClient->available()) {
switch (_parseRequest(_currentClient)) {
case CLIENT_REQUEST_CAN_CONTINUE:
// Because HTTP_MAX_SEND_WAIT is expressed in milliseconds, it must be divided by 1000
_currentClient->setTimeout(HTTP_MAX_SEND_WAIT / 1000);
_contentLength = CONTENT_LENGTH_NOT_SET;
_handleRequest();
/* fallthrough */
case CLIENT_REQUEST_IS_HANDLED:
if (_currentClient->connected() || _currentClient->available()) {
_currentStatus = HC_WAIT_CLOSE;
_statusChange = millis();
keepCurrentClient = true;
} else {
//log_v("webserver: peer has closed after served\n");
}
break;
case CLIENT_MUST_STOP:
//log_v("Close client\n");
_currentClient->stop();
break;
case CLIENT_IS_GIVEN:
// client must not be stopped but must not be handled here anymore
// (example: tcp connection given to websocket)
//log_v("Give client\n");
break;
} // switch _parseRequest()
} else {
// !_currentClient.available(): waiting for more data
unsigned long timeSinceChange = millis() - _statusChange;
// Use faster connection drop timeout if any other client has data
// or the buffer of pending clients is full
if ((_server.hasClientData() || _server.hasMaxPendingClients())
&& timeSinceChange > HTTP_MAX_DATA_AVAILABLE_WAIT) {
//log_v("webserver: closing since there's another connection to read from\r\n");
} else {
if (timeSinceChange > HTTP_MAX_DATA_WAIT) {
//log_v("webserver: closing after read timeout\r\n");
} else {
keepCurrentClient = true;
}
}
callYield = true;
}
break;
case HC_WAIT_CLOSE:
// Wait for client to close the connection
if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) {
keepCurrentClient = true;
callYield = true;
}
}
}
if (!keepCurrentClient) {
if (_currentClient) {
delete _currentClient;
_currentClient = nullptr;
}
_currentStatus = HC_NONE;
_currentUpload.reset();
}
if (callYield) {
yield();
}
}
template <typename ServerType, int DefaultPort>
+2 -1
View File
@@ -611,9 +611,10 @@ protected:
_rx_buf_offset += size;
} else if (!_rx_buf->next) {
DEBUGV(":c0 %d, %d\r\n", size, _rx_buf->tot_len);
pbuf_free(_rx_buf);
auto head = _rx_buf;
_rx_buf = 0;
_rx_buf_offset = 0;
pbuf_free(head);
} else {
DEBUGV(":c %d, %d, %d\r\n", size, _rx_buf->len, _rx_buf->tot_len);
auto head = _rx_buf;
+24
View File
@@ -56,6 +56,10 @@ bool TwoWire::setSDA(pin_size_t pin) {
return true;
}
if (_sda == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set Wire%s.SDA while running", i2c_hw_index(_i2c) ? "1" : "");
} else {
@@ -73,6 +77,10 @@ bool TwoWire::setSCL(pin_size_t pin) {
return true;
}
if (_scl == pin) {
return true;
}
if (_running) {
panic("FATAL: Attempting to set Wire%s.SCL while running", i2c_hw_index(_i2c) ? "1" : "");
} else {
@@ -108,11 +116,27 @@ void TwoWire::begin() {
}
static void _handler0() {
#if defined(__WIRE0_DEVICE)
if (__WIRE0_DEVICE == i2c0) {
Wire.onIRQ();
} else {
Wire1.onIRQ();
}
#else
Wire.onIRQ();
#endif
}
static void _handler1() {
#if defined(__WIRE1_DEVICE)
if (__WIRE1_DEVICE == i2c0) {
Wire.onIRQ();
} else {
Wire1.onIRQ();
}
#else
Wire1.onIRQ();
#endif
}
// Slave mode
@@ -20,10 +20,10 @@
#include "CYW43shim.h"
extern "C" {
#include "cyw43.h"
#include "cyw43_stats.h"
#include <cyw43.h>
#include <cyw43_stats.h>
}
#include "pico/cyw43_arch.h"
#include <pico/cyw43_arch.h>
#include <Arduino.h>
// From cyw43_ctrl.c
@@ -416,10 +416,6 @@ template<class RawDev>
err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf) {
LwipIntfDev* lid = (LwipIntfDev*)netif->state;
if (pbuf->len != pbuf->tot_len || pbuf->next) {
Serial.println("ERRTOT\r\n");
}
uint16_t len = lid->sendFrame((const uint8_t*)pbuf->payload, pbuf->len);
#if PHY_HAS_CAPTURE
+1 -1
View File
@@ -3,7 +3,7 @@
set -e # Exit on error
export PICO_SDK_PATH="$(cd ../pico-sdk/; pwd)"
export PATH="$(cd ../../system/arm-none-eabi/bin; pwd):$PATH"
export PATH="$(cd ../system/arm-none-eabi/bin; pwd):$PATH"
rm -rf build
mkdir build
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "framework-arduinopico",
"version": "1.30202.0",
"version": "1.30401.0",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
"keywords": [
"framework",
+201 -180
View File
@@ -53,6 +53,9 @@
{
"name": "Adafruit ItsyBitsy RP2040"
},
{
"name": "Adafruit Metro RP2040"
},
{
"name": "Adafruit QT Py RP2040"
},
@@ -71,6 +74,9 @@
{
"name": "Arduino Nano RP2040 Connect"
},
{
"name": "ArtronShop RP2 Nano"
},
{
"name": "BridgeTek IDM2040-7A"
},
@@ -110,6 +116,9 @@
{
"name": "iLabs Challenger 2040 WiFi/BLE"
},
{
"name": "iLabs Challenger 2040 WiFi6/BLE"
},
{
"name": "iLabs Challenger NB 2040 WiFi"
},
@@ -140,6 +149,15 @@
{
"name": "Pimoroni PGA2040"
},
{
"name": "Pimoroni Plasma2040"
},
{
"name": "Pimoroni Tiny2040"
},
{
"name": "Silicognition RP2040-Shim"
},
{
"name": "Solder Party RP2040 Stamp"
},
@@ -191,6 +209,9 @@
{
"name": "WIZnet W5500-EVB-Pico"
},
{
"name": "redscorp RP2040-ProMini"
},
{
"name": "Generic RP2040"
}
@@ -198,22 +219,22 @@
"toolsDependencies": [
{
"packager": "rp2040",
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-gcc"
},
{
"packager": "rp2040",
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-mklittlefs"
},
{
"packager": "rp2040",
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-elf2uf2"
},
{
"packager": "rp2040",
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-pioasm"
},
{
@@ -223,12 +244,12 @@
},
{
"packager": "rp2040",
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-openocd"
},
{
"packager": "rp2040",
"version": "1.5.0-b-03f2812",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-picotool"
}
],
@@ -239,112 +260,112 @@
],
"tools": [
{
"version": "1.5.0-b-03f2812",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-picotool",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/aarch64-linux-gnu.picotool-03f2812.230216.tar.gz",
"archiveFileName": "aarch64-linux-gnu.picotool-03f2812.230216.tar.gz",
"checksum": "SHA-256:5efe9c4ccc08d9d28cc87a0cfaf563b6fc1caa5d3967c963814225fd252756c7",
"size": "171877"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/aarch64-linux-gnu.picotool-f6fe6b7.230824.tar.gz",
"archiveFileName": "aarch64-linux-gnu.picotool-f6fe6b7.230824.tar.gz",
"checksum": "SHA-256:161f345373b4eb02cd5aa9d9009af51262c6ad4ce3ee7dbf251eb47bf60d2ab5",
"size": "173036"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/arm-linux-gnueabihf.picotool-03f2812.230216.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.picotool-03f2812.230216.tar.gz",
"checksum": "SHA-256:38f3f0925be5e053866ad33e8a535ac9d08f58af837a53b65dfe45f2ccbe9c5b",
"size": "152925"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/arm-linux-gnueabihf.picotool-f6fe6b7.230824.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.picotool-f6fe6b7.230824.tar.gz",
"checksum": "SHA-256:2fcd62798af43b2c6228153158ab7a2c6dd2dac9e25b3a66454f72aa27e4c3d4",
"size": "153324"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-linux-gnu.picotool-03f2812.230216.tar.gz",
"archiveFileName": "i686-linux-gnu.picotool-03f2812.230216.tar.gz",
"checksum": "SHA-256:485c09be49850d2e05c32e20fcc899b58e649e2863b300c7e89110d36094dce1",
"size": "183644"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-linux-gnu.picotool-f6fe6b7.230824.tar.gz",
"archiveFileName": "i686-linux-gnu.picotool-f6fe6b7.230824.tar.gz",
"checksum": "SHA-256:b36741bdf141b2f2606f0053747f5d571a2f9496662617b76edba321477cd6e5",
"size": "184362"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-w64-mingw32.picotool-03f2812.230216.zip",
"archiveFileName": "i686-w64-mingw32.picotool-03f2812.230216.zip",
"checksum": "SHA-256:9d7516313c1e9b341fe8ce05b786348def60692dc88f17bdee5bc25b6baf6871",
"size": "352766"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-w64-mingw32.picotool-f6fe6b7.230824.zip",
"archiveFileName": "i686-w64-mingw32.picotool-f6fe6b7.230824.zip",
"checksum": "SHA-256:4c6bea425acca78e26dd0fc9d1a02b167ca459f1a51ac714c54cef8ad6f107d4",
"size": "292401"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-apple-darwin14.picotool-03f2812.230216.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.picotool-03f2812.230216.tar.gz",
"checksum": "SHA-256:8b48c395f871dac7cbe396e4518649d40582d5a78948f0e792d0569db5069226",
"size": "852423"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-apple-darwin15.picotool-f6fe6b7.230824.tar.gz",
"archiveFileName": "x86_64-apple-darwin15.picotool-f6fe6b7.230824.tar.gz",
"checksum": "SHA-256:39111cba2e6b72060f42e25c04a2660398213aa9a3ca76295a588bf8da73d2e0",
"size": "844015"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-linux-gnu.picotool-03f2812.230216.tar.gz",
"archiveFileName": "x86_64-linux-gnu.picotool-03f2812.230216.tar.gz",
"checksum": "SHA-256:507d7d01d63caebb2c3f33e99a8545a3719699c5645c423175bf0b7bfd685a48",
"size": "131605"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-linux-gnu.picotool-f6fe6b7.230824.tar.gz",
"archiveFileName": "x86_64-linux-gnu.picotool-f6fe6b7.230824.tar.gz",
"checksum": "SHA-256:361f63ef35d15cdf5c3cd2edcaaef059e22d137c288b5b59eae9c9e1f916ecc4",
"size": "131860"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.picotool-03f2812.230216.zip",
"archiveFileName": "x86_64-w64-mingw32.picotool-03f2812.230216.zip",
"checksum": "SHA-256:ca62fe7dd783fc38080d834e413e1632086c6bc24660e6f5eaad931465ca87e3",
"size": "337119"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-w64-mingw32.picotool-f6fe6b7.230824.zip",
"archiveFileName": "x86_64-w64-mingw32.picotool-f6fe6b7.230824.zip",
"checksum": "SHA-256:1bda4467f4fd433a57a73bc899c0557b62ea4357eed0add9ca4f9e2817d0af67",
"size": "277241"
}
]
},
{
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-openocd",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/aarch64-linux-gnu.openocd-8e3c38f78.230216.tar.gz",
"archiveFileName": "aarch64-linux-gnu.openocd-8e3c38f78.230216.tar.gz",
"checksum": "SHA-256:6875c0c2e7faa320882d00f33f415499e1028d3bd0bac7d672d4342968c28eaf",
"size": "5812640"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/aarch64-linux-gnu.openocd-4d87f6dca.230824.tar.gz",
"archiveFileName": "aarch64-linux-gnu.openocd-4d87f6dca.230824.tar.gz",
"checksum": "SHA-256:f47ab6ee8b0f4fccb6975255009e9d0ba57b3b1b9d41a22e7aeee6fd26e0bc0a",
"size": "6438760"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/arm-linux-gnueabihf.openocd-8e3c38f78.230216.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.openocd-8e3c38f78.230216.tar.gz",
"checksum": "SHA-256:fa35b2c6ca10b332718db8217c7bb57cc1e15bafc526dd05c0d6a890b05dec50",
"size": "5543967"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/arm-linux-gnueabihf.openocd-4d87f6dca.230824.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.openocd-4d87f6dca.230824.tar.gz",
"checksum": "SHA-256:ff8228dc8a3f79212b5204f53404dd569c28899a9264925c64fe0a4c667c7c27",
"size": "6155079"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-linux-gnu.openocd-8e3c38f78.230216.tar.gz",
"archiveFileName": "i686-linux-gnu.openocd-8e3c38f78.230216.tar.gz",
"checksum": "SHA-256:0f27f4a7be0411db032b8fc0aa8f55b559d03909830b38dc6610301a9a79050c",
"size": "5347247"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-linux-gnu.openocd-4d87f6dca.230824.tar.gz",
"archiveFileName": "i686-linux-gnu.openocd-4d87f6dca.230824.tar.gz",
"checksum": "SHA-256:86713ce74bc19c09e4f4536a26ec331e8ccb62a796f4257d2e9d99d5d28fb87c",
"size": "5961262"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-w64-mingw32.openocd-8e3c38f78.230216.zip",
"archiveFileName": "i686-w64-mingw32.openocd-8e3c38f78.230216.zip",
"checksum": "SHA-256:a53ee67b63893d2dc432df293f494443921301021ec0828a044813528880d16a",
"size": "2207880"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-w64-mingw32.openocd-4d87f6dca.230824.zip",
"archiveFileName": "i686-w64-mingw32.openocd-4d87f6dca.230824.zip",
"checksum": "SHA-256:4873ccc7b7bbe25c5a5e5bff494887a1b069d7c0612440033cc063095f7ec9c3",
"size": "2468166"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-apple-darwin14.openocd-8e3c38f78.230216.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.openocd-8e3c38f78.230216.tar.gz",
"checksum": "SHA-256:8f68f93ee51973926cb94c24164013d35d4dd42a636e4c15af5d3bb3884e6daf",
"size": "2599703"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-apple-darwin15.openocd-4d87f6dca.230824.tar.gz",
"archiveFileName": "x86_64-apple-darwin15.openocd-4d87f6dca.230824.tar.gz",
"checksum": "SHA-256:1313bd1ea2503052e3b2158d6f6b6489668b54246fb5d12267d402a4a78a85eb",
"size": "2800939"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-linux-gnu.openocd-8e3c38f78.230216.tar.gz",
"archiveFileName": "x86_64-linux-gnu.openocd-8e3c38f78.230216.tar.gz",
"checksum": "SHA-256:50fe784a938922ffb0c12076245cedbc467f5f51b6030da776b6f95305308492",
"size": "5732546"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-linux-gnu.openocd-4d87f6dca.230824.tar.gz",
"archiveFileName": "x86_64-linux-gnu.openocd-4d87f6dca.230824.tar.gz",
"checksum": "SHA-256:f43ccce16676e59d0bb06e3343c281343aa1e36d6f4e24d7668a90a881022592",
"size": "6355819"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.openocd-8e3c38f78.230216.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-8e3c38f78.230216.zip",
"checksum": "SHA-256:d36a25b7e40771bcc286a51bfa4803668037662651bce5a40a36608babbc3f5f",
"size": "2168940"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-w64-mingw32.openocd-4d87f6dca.230824.zip",
"archiveFileName": "x86_64-w64-mingw32.openocd-4d87f6dca.230824.zip",
"checksum": "SHA-256:db17f7a64ff0386de76c11a054be6c35f4ffa2c1bab0558c147e551abfb717a9",
"size": "2412178"
}
]
},
@@ -411,222 +432,222 @@
]
},
{
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-gcc",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/aarch64-linux-gnu.arm-none-eabi-c7bab52.230216.tar.gz",
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-c7bab52.230216.tar.gz",
"checksum": "SHA-256:2b3ec7c790bab21e08347205b8dec03a39747d0ef99266ce26a04e8e55bd7db8",
"size": "81474732"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/aarch64-linux-gnu.arm-none-eabi-d3d2e6b.230824.tar.gz",
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-d3d2e6b.230824.tar.gz",
"checksum": "SHA-256:dedc8a8d1fda82c56622d0d7054f47fbf3e41b80f2ce94e51ee4bbd7b111d6be",
"size": "91447565"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/arm-linux-gnueabihf.arm-none-eabi-c7bab52.230216.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-c7bab52.230216.tar.gz",
"checksum": "SHA-256:9ec76a79f045d6f634a21e2b1e814b39bf85bb294c53a076b9c8ac2640ad3acc",
"size": "76133046"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/arm-linux-gnueabihf.arm-none-eabi-d3d2e6b.230824.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-d3d2e6b.230824.tar.gz",
"checksum": "SHA-256:3d59a409c8eb1791055f35b0d423ea28bf0ed42fb1cde4ea1ffbf3f50c980cbc",
"size": "85417744"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-linux-gnu.arm-none-eabi-c7bab52.230216.tar.gz",
"archiveFileName": "i686-linux-gnu.arm-none-eabi-c7bab52.230216.tar.gz",
"checksum": "SHA-256:dea62b8d66c323a07e366625049a17b2d1d8a8a7882b4d2b3aa6247456614867",
"size": "83713275"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-linux-gnu.arm-none-eabi-d3d2e6b.230824.tar.gz",
"archiveFileName": "i686-linux-gnu.arm-none-eabi-d3d2e6b.230824.tar.gz",
"checksum": "SHA-256:979dfc2131d1e2114273b516e68a7a2ba4920cbd818394a075ecf3ec0c51b6e8",
"size": "93996357"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-w64-mingw32.arm-none-eabi-c7bab52.230216.zip",
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-c7bab52.230216.zip",
"checksum": "SHA-256:0b76a320398ce6f0457edf98033742afd85ea3f143dec034a3fec7d3a21c52bf",
"size": "85634400"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-w64-mingw32.arm-none-eabi-d3d2e6b.230824.zip",
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-d3d2e6b.230824.zip",
"checksum": "SHA-256:7d1efb7628a3757539a5f04edd4596262b59d1315e3f2bbce44bea10d14ff3b4",
"size": "94386074"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-apple-darwin14.arm-none-eabi-c7bab52.230216.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.arm-none-eabi-c7bab52.230216.tar.gz",
"checksum": "SHA-256:f83f143d424077322f7ea3971b88ac558c7b211f4a27776f6ba7c012a7c19938",
"size": "84979864"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-apple-darwin15.arm-none-eabi-d3d2e6b.230824.tar.gz",
"archiveFileName": "x86_64-apple-darwin15.arm-none-eabi-d3d2e6b.230824.tar.gz",
"checksum": "SHA-256:a186dcb41c23ef784700299d580671d21a51c7ac2ed92bf488b3f59b0177410a",
"size": "96256078"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-linux-gnu.arm-none-eabi-c7bab52.230216.tar.gz",
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-c7bab52.230216.tar.gz",
"checksum": "SHA-256:bf197bde7ee76d26a8c142b2308e46269252b19403df5617aa1bd90ea4618427",
"size": "83669292"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-linux-gnu.arm-none-eabi-d3d2e6b.230824.tar.gz",
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-d3d2e6b.230824.tar.gz",
"checksum": "SHA-256:29b3b7bb64e1876c94fd14889e55bee08777630a6f31c5e4fd32179adea2993b",
"size": "93883705"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.arm-none-eabi-c7bab52.230216.zip",
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-c7bab52.230216.zip",
"checksum": "SHA-256:ed1a7103c9d55ad3d44eeb399a308789d1d1094a73c78b554e2693eb8140b9c5",
"size": "88352385"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-w64-mingw32.arm-none-eabi-d3d2e6b.230824.zip",
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-d3d2e6b.230824.zip",
"checksum": "SHA-256:6da912f970be58447dea84b80565fe7c1c3308d0c62674bf7ac14b1fd8e61544",
"size": "97313187"
}
]
},
{
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-elf2uf2",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/aarch64-linux-gnu.elf2uf2-2e6142b.230216.tar.gz",
"archiveFileName": "aarch64-linux-gnu.elf2uf2-2e6142b.230216.tar.gz",
"checksum": "SHA-256:00adc6949c467c75181364e9e5bf6378e50483caf4f04b0fc5e4c1d105f780ee",
"size": "82856"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/aarch64-linux-gnu.elf2uf2-6a7db34.230824.tar.gz",
"archiveFileName": "aarch64-linux-gnu.elf2uf2-6a7db34.230824.tar.gz",
"checksum": "SHA-256:a7be96a75084675aeedaf2ef476102447e464308f9b2216997e6b6dd085773da",
"size": "83803"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/arm-linux-gnueabihf.elf2uf2-2e6142b.230216.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-2e6142b.230216.tar.gz",
"checksum": "SHA-256:de9991519727ecbb3a157e672de2572c843558018515d7c680a3aa5a0d700056",
"size": "56175"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/arm-linux-gnueabihf.elf2uf2-6a7db34.230824.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-6a7db34.230824.tar.gz",
"checksum": "SHA-256:19f3df244c6ca6c1dc6481e594322d961900067edae69aafaf46580be148318e",
"size": "56800"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-linux-gnu.elf2uf2-2e6142b.230216.tar.gz",
"archiveFileName": "i686-linux-gnu.elf2uf2-2e6142b.230216.tar.gz",
"checksum": "SHA-256:12c4d4566a61c15104e26b10a1330a2dc12ecf63e054966e2d6cea13cef8f92b",
"size": "91559"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-linux-gnu.elf2uf2-6a7db34.230824.tar.gz",
"archiveFileName": "i686-linux-gnu.elf2uf2-6a7db34.230824.tar.gz",
"checksum": "SHA-256:73ecc3e36569f7132e55a57623d91ecbd1e711c05dd0f7a8b20556dd7d8c2007",
"size": "92430"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-w64-mingw32.elf2uf2-2e6142b.230216.zip",
"archiveFileName": "i686-w64-mingw32.elf2uf2-2e6142b.230216.zip",
"checksum": "SHA-256:6537879c71359b916dd604dc4833aeaab6ff7571ad9e498f1f2aa8085670548c",
"size": "72230"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-w64-mingw32.elf2uf2-6a7db34.230824.zip",
"archiveFileName": "i686-w64-mingw32.elf2uf2-6a7db34.230824.zip",
"checksum": "SHA-256:e4b8464c4a74a56c2e9e011a897284de63eadb13eee8711d74930472c1a99e5e",
"size": "72747"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-apple-darwin14.elf2uf2-2e6142b.230216.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.elf2uf2-2e6142b.230216.tar.gz",
"checksum": "SHA-256:5b8fb8fc2dec9819ca018fa53d84b824dd2136fdcde713d98ef2cea9e5a1ce3f",
"size": "86779"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-apple-darwin15.elf2uf2-6a7db34.230824.tar.gz",
"archiveFileName": "x86_64-apple-darwin15.elf2uf2-6a7db34.230824.tar.gz",
"checksum": "SHA-256:3acd2d8f8a6f9ec9b85560ef7a68d3e019ae9fbe55b8e0432159118bf7f1c3b8",
"size": "105160"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-linux-gnu.elf2uf2-2e6142b.230216.tar.gz",
"archiveFileName": "x86_64-linux-gnu.elf2uf2-2e6142b.230216.tar.gz",
"checksum": "SHA-256:784b76139053cd5fd3cac25ec00ac75d1612dc512c0cd5f7a69b5867df8ec7ba",
"size": "82555"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-linux-gnu.elf2uf2-6a7db34.230824.tar.gz",
"archiveFileName": "x86_64-linux-gnu.elf2uf2-6a7db34.230824.tar.gz",
"checksum": "SHA-256:1d02a002eabf2897ad668e2467a04a224cedb9cb3bc37cb3498cbfa049a18ad5",
"size": "83323"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.elf2uf2-2e6142b.230216.zip",
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-2e6142b.230216.zip",
"checksum": "SHA-256:7ab9d08f6f3cd472c7fc005def31c87d9ce9ea57923ef7a6a81fe4f86a75b12a",
"size": "80680"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-w64-mingw32.elf2uf2-6a7db34.230824.zip",
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-6a7db34.230824.zip",
"checksum": "SHA-256:f2751cdc76195da584533db70a08164e97f5f4e20aa1fbced234ad2ee6a49c68",
"size": "81347"
}
]
},
{
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-pioasm",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/aarch64-linux-gnu.pioasm-2e6142b.230216.tar.gz",
"archiveFileName": "aarch64-linux-gnu.pioasm-2e6142b.230216.tar.gz",
"checksum": "SHA-256:6b60c57530bb3bd07f85a95808209f158b7b45b2808544794307701d8d468dd8",
"size": "453460"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/aarch64-linux-gnu.pioasm-6a7db34.230824.tar.gz",
"archiveFileName": "aarch64-linux-gnu.pioasm-6a7db34.230824.tar.gz",
"checksum": "SHA-256:ee0f2ceb5c63c8935ea8af4e0bc3046141daf94d88d6c4f3a47435c1deb712dc",
"size": "453452"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/arm-linux-gnueabihf.pioasm-2e6142b.230216.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.pioasm-2e6142b.230216.tar.gz",
"checksum": "SHA-256:079dc194321751d70e76496f0bcffdec58b73eb9976670a170f65ec06f110450",
"size": "360828"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/arm-linux-gnueabihf.pioasm-6a7db34.230824.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.pioasm-6a7db34.230824.tar.gz",
"checksum": "SHA-256:db87d67ef5faad21db418ccab51aa32548477090b5ed2c194247d564ee41b9b4",
"size": "360801"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-linux-gnu.pioasm-2e6142b.230216.tar.gz",
"archiveFileName": "i686-linux-gnu.pioasm-2e6142b.230216.tar.gz",
"checksum": "SHA-256:8926f848f80c29d6e52595e54e9021c4955f053f8cf157b88275408a0047d08f",
"size": "511533"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-linux-gnu.pioasm-6a7db34.230824.tar.gz",
"archiveFileName": "i686-linux-gnu.pioasm-6a7db34.230824.tar.gz",
"checksum": "SHA-256:1e0bf5984b416cfa42dfdabc207dbf4681990e0ef97e70ef7ed27516aa7b0c36",
"size": "510798"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-w64-mingw32.pioasm-2e6142b.230216.zip",
"archiveFileName": "i686-w64-mingw32.pioasm-2e6142b.230216.zip",
"checksum": "SHA-256:55a887da459e46b62b4e2eb6d62556e27a879e8bbf241c719f4d85b495d1caab",
"size": "386161"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-w64-mingw32.pioasm-6a7db34.230824.zip",
"archiveFileName": "i686-w64-mingw32.pioasm-6a7db34.230824.zip",
"checksum": "SHA-256:446d3cb173e654a170641946f4129afcf33c26628cb80ecb6e0bf69999b4665d",
"size": "386188"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-apple-darwin14.pioasm-2e6142b.230216.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.pioasm-2e6142b.230216.tar.gz",
"checksum": "SHA-256:2818ab1de24bad4e421315ac497b20373beaa16dd09b876bc6d00e2bba1f3d15",
"size": "480566"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-apple-darwin15.pioasm-6a7db34.230824.tar.gz",
"archiveFileName": "x86_64-apple-darwin15.pioasm-6a7db34.230824.tar.gz",
"checksum": "SHA-256:9da859c3192de1a994c3bb7aae3be0ff2ec584dfa70f0c34b0ed3ffb44287a34",
"size": "585393"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-linux-gnu.pioasm-2e6142b.230216.tar.gz",
"archiveFileName": "x86_64-linux-gnu.pioasm-2e6142b.230216.tar.gz",
"checksum": "SHA-256:c79400b056594268aab8ae1baf18abc8cf3170c6edb1f8104579738d78cd22ad",
"size": "458858"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-linux-gnu.pioasm-6a7db34.230824.tar.gz",
"archiveFileName": "x86_64-linux-gnu.pioasm-6a7db34.230824.tar.gz",
"checksum": "SHA-256:52594b9199e21401b5b1d0a06ed8a24cb29e670ad4afde424775a4d55823f5c5",
"size": "458905"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.pioasm-2e6142b.230216.zip",
"archiveFileName": "x86_64-w64-mingw32.pioasm-2e6142b.230216.zip",
"checksum": "SHA-256:8c06fa68fe5d51fd54e9e9db11608e0e893d3b90e0437a6507eaef972e95b891",
"size": "409379"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-w64-mingw32.pioasm-6a7db34.230824.zip",
"archiveFileName": "x86_64-w64-mingw32.pioasm-6a7db34.230824.zip",
"checksum": "SHA-256:e09098e7e0c12faccbe2bee0d6fccf99a21e88986c9c8b0a39a2e84a076e42b6",
"size": "408969"
}
]
},
{
"version": "1.5.0-b-c7bab52",
"version": "2.0.0-a-d3d2e6b",
"name": "pqt-mklittlefs",
"systems": [
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/aarch64-linux-gnu.mklittlefs-4aca452.230216.tar.gz",
"archiveFileName": "aarch64-linux-gnu.mklittlefs-4aca452.230216.tar.gz",
"checksum": "SHA-256:07d1baa8f0e8c3eb38db8751eb647e0f3ff465c5d7973642c8f9011a2c05dba2",
"size": "63222"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/aarch64-linux-gnu.mklittlefs-4aca452.230824.tar.gz",
"archiveFileName": "aarch64-linux-gnu.mklittlefs-4aca452.230824.tar.gz",
"checksum": "SHA-256:9a7749c9296173c07636b8538f8025d57cb02c5e0512cd8108423d72978b9b9a",
"size": "63139"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/arm-linux-gnueabihf.mklittlefs-4aca452.230216.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-4aca452.230216.tar.gz",
"checksum": "SHA-256:e7ce6a71ea02cae9d149ee1e078702a4af50d7a930452237666a2b402c3f1181",
"size": "53461"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/arm-linux-gnueabihf.mklittlefs-4aca452.230824.tar.gz",
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-4aca452.230824.tar.gz",
"checksum": "SHA-256:673c3014252947b4d916f4e9af1d5106c744be914dced74f71eec6b51fa7688f",
"size": "53394"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-linux-gnu.mklittlefs-4aca452.230216.tar.gz",
"archiveFileName": "i686-linux-gnu.mklittlefs-4aca452.230216.tar.gz",
"checksum": "SHA-256:8c41373fb26bcdc15590b2924f23672a46464877702c583d9a7c30ac3a1ea942",
"size": "69995"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-linux-gnu.mklittlefs-4aca452.230824.tar.gz",
"archiveFileName": "i686-linux-gnu.mklittlefs-4aca452.230824.tar.gz",
"checksum": "SHA-256:d7368d642220e3fb945e3516ffd274ef201d35621a66929ad22cbe198e076c45",
"size": "69905"
},
{
"host": "i686-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/i686-w64-mingw32.mklittlefs-4aca452.230216.zip",
"archiveFileName": "i686-w64-mingw32.mklittlefs-4aca452.230216.zip",
"checksum": "SHA-256:9a4460c0e2e46847c2bd1ab934544f88fbd611237a12445ae69dbc6086f05c4f",
"size": "347619"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/i686-w64-mingw32.mklittlefs-4aca452.230824.zip",
"archiveFileName": "i686-w64-mingw32.mklittlefs-4aca452.230824.zip",
"checksum": "SHA-256:f1e90a974db08ce5d84a4137491da06436f013672a15d2e2852002d36f75ff70",
"size": "347612"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-apple-darwin14.mklittlefs-4aca452.230216.tar.gz",
"archiveFileName": "x86_64-apple-darwin14.mklittlefs-4aca452.230216.tar.gz",
"checksum": "SHA-256:3575877065d206083c3dc4715bee983a1e7145969457d1fca752943aa67eb655",
"size": "378957"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-apple-darwin15.mklittlefs-4aca452.230824.tar.gz",
"archiveFileName": "x86_64-apple-darwin15.mklittlefs-4aca452.230824.tar.gz",
"checksum": "SHA-256:aa738f35be492016ebe4a7485495c8491e4ac105a41d4b66c1b13420eb491fda",
"size": "434818"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-linux-gnu.mklittlefs-4aca452.230216.tar.gz",
"archiveFileName": "x86_64-linux-gnu.mklittlefs-4aca452.230216.tar.gz",
"checksum": "SHA-256:af472f914ba46b6a7466049cb989804ce56d5808334b1af09403dedfdf6e1ff2",
"size": "64931"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-linux-gnu.mklittlefs-4aca452.230824.tar.gz",
"archiveFileName": "x86_64-linux-gnu.mklittlefs-4aca452.230824.tar.gz",
"checksum": "SHA-256:7f913d9e91b5d34c9ac15becc843c49099e665f0e842985722bcfbeba48593f9",
"size": "64822"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.mklittlefs-4aca452.230216.zip",
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-4aca452.230216.zip",
"checksum": "SHA-256:fd3dbfd224708f05f14d1c3f715d90473d462ba2fa06683fc523e13d2bb716f2",
"size": "359304"
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.0.0-a/x86_64-w64-mingw32.mklittlefs-4aca452.230824.zip",
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-4aca452.230824.zip",
"checksum": "SHA-256:108350d5ea2372b72bc1d82d2079dca530529cbba60b423fa2fb97294223f0f7",
"size": "359298"
}
]
}
+14 -15
View File
@@ -20,7 +20,13 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Raspberry Pi RP2040 Boards
version=3.2.2
version=3.4.1
# Required discoveries and monitors
# ---------------------------------
pluggable_discovery.required.0=builtin:serial-discovery
pluggable_discovery.required.1=builtin:mdns-discovery
pluggable_monitor.required.serial=builtin:serial-monitor
runtime.tools.pqt-gcc.path={runtime.platform.path}/system/arm-none-eabi
runtime.tools.pqt-python3.path={runtime.platform.path}/system/python3
@@ -36,11 +42,11 @@ compiler.libraries.ldflags=
# Compile variables
# -----------------
compiler.warning_flags=-Werror=return-type
compiler.warning_flags.none=-Werror=return-type
compiler.warning_flags.default=-Werror=return-type
compiler.warning_flags.more=-Wall -Werror=return-type -Wno-ignored-qualifiers
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualifiers
compiler.warning_flags=-Werror=return-type -Wno-psabi
compiler.warning_flags.none=-Werror=return-type -Wno-psabi
compiler.warning_flags.default=-Werror=return-type -Wno-psabi
compiler.warning_flags.more=-Wall -Werror=return-type -Wno-ignored-qualifiers -Wno-psabi
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualifiers -Wno-psabi
compiler.netdefines=-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_LWIP=1 {build.libpicowdefs} -DLWIP_IGMP=1 -DLWIP_CHECKSUM_CTRL_PER_NETIF=1
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 {build.usbpid} {build.usbvid} {build.usbpwr} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' {compiler.netdefines} -DARDUINO_VARIANT="{build.variant}" -DTARGET_RP2040 -DPICO_FLASH_SIZE_BYTES={build.flash_total}
@@ -99,7 +105,7 @@ build.libpicow=libpicow-noipv6-nobtc-noble.a
build.boot2=boot2_generic_03h_4_padded_checksum
build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1
build.wificc=-DWIFICC=CYW43_COUNTRY_WORLDWIDE
build.debugscript=picoprobe.tcl
build.debugscript=picoprobe_cmsis_dap.tcl
build.picodebugflags=
# Allow Pico boards do be auto-discovered by the IDE
@@ -198,19 +204,12 @@ tools.picotool.upload.params.verbose=
tools.picotool.upload.params.quiet=
tools.picotool.upload.pattern="{cmd}/picotool" load "{build.path}/{build.project_name}.uf2" -f
#tools.picoprobe.cmd={runtime.tools.pqt-openocd.path}
tools.picoprobe.cmd={runtime.platform.path}/system/openocd
tools.picoprobe.upload.protocol=picoprobe
tools.picoprobe.upload.params.verbose=
tools.picoprobe.upload.params.quiet=
tools.picoprobe.upload.pattern="{cmd}/bin/openocd" -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "program {{build.path}/{build.project_name}.elf} verify reset exit"
#tools.picoprobe_cmsis_dap.cmd={runtime.tools.pqt-openocd.path}
tools.picoprobe_cmsis_dap.cmd={runtime.platform.path}/system/openocd
tools.picoprobe_cmsis_dap.upload.protocol=picoprobe_cmsis_dap
tools.picoprobe_cmsis_dap.upload.params.verbose=
tools.picoprobe_cmsis_dap.upload.params.quiet=
tools.picoprobe_cmsis_dap.upload.pattern="{cmd}/bin/openocd" -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "adapter speed 5000" -c "program {{build.path}/{build.project_name}.elf} verify reset exit"
tools.picoprobe_cmsis_dap.upload.pattern="{cmd}/bin/openocd" -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "adapter speed 5000" -c "program {{build.path}/{build.project_name}.elf} verify" -c "reset init" -c "resume" -c "exit"
#tools.picodebug.cmd={runtime.tools.pqt-openocd.path}
tools.picodebug.cmd={runtime.platform.path}/system/openocd
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239A",
"usb_pid": "0x813D"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_METRO_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x239A",
"0x813D"
]
],
"mcu": "rp2040",
"variant": "adafruit_metro"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Metro RP2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 16777216,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"
}
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2E8A",
"usb_pid": "0x000A"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ARTRONSHOP_RP2_NANO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x2E8A",
"0x000A"
]
],
"mcu": "rp2040",
"variant": "artronshop_rp2_nano"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "RP2 Nano",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 2097152,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "ArtronShop"
}
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2E8A",
"usb_pid": "0x105F"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_CHALLENGER_2040_WIFI6_BLE_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500 -DWIFIESPAT2",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x2E8A",
"0x105F"
]
],
"mcu": "rp2040",
"variant": "challenger_2040_wifi6_ble"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Challenger 2040 WiFi6/BLE",
"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": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "iLabs"
}
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2E8A",
"usb_pid": "0x100A"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_PIMORONI_PLASMA2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x2E8A",
"0x100A"
]
],
"mcu": "rp2040",
"variant": "pimoroni_plasma2040"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Plasma2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 2097152,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Pimoroni"
}
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q64jv_4_padded_checksum.S",
"usb_vid": "0x2E8A",
"usb_pid": "0x100A"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_PIMORONI_TINY2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x2E8A",
"0x100A"
]
],
"mcu": "rp2040",
"variant": "pimoroni_tiny2040"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Tiny2040",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 2097152,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Pimoroni"
}
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x2341",
"usb_pid": "0x005F"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_REDSCORP_RP2040_PROMINI -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x2341",
"0x005F"
]
],
"mcu": "rp2040",
"variant": "redscorp-rp2040-promini"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "RP2040-ProMini",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 16777216,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "redscorp"
}
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
"usb_vid": "0x1209",
"usb_pid": "0xF502"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_SILICOGNITION_RP2040_SHIM -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x1209",
"0xF502"
]
],
"mcu": "rp2040",
"variant": "silicognition_rp2040_shim"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "RP2040-Shim",
"upload": {
"maximum_ram_size": 270336,
"maximum_size": 4194304,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Silicognition"
}
+1 -1
View File
@@ -3,7 +3,7 @@
VER_H=../../include/bearssl/bearssl_git.h
all T0 clean: bearssl/README.txt
PATH="$(PATH):$(PWD)/../../system/arm-none-eabi/bin/" && cd bearssl && $(MAKE) CONF=pico $@
PATH="$(PWD)/../../system/arm-none-eabi/bin/:$(PATH)" && arm-none-eabi-gcc --version && cd bearssl && $(MAKE) CONF=pico $@
install: all version-header
cp bearssl/pico/libbearssl.a ../../lib/.
+17 -2
View File
@@ -117,9 +117,8 @@ def BuildIPBTStack(name):
print('%s.menu.ipbtstack.ipv4ipv6btcble.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1' % (name))
def BuildUploadMethodMenu(name):
for a, b, c, d, e, f in [ ["default", "Default (UF2)", 256, "picoprobe.tcl", "uf2conv", "uf2conv-network"],
for a, b, c, d, e, f in [ ["default", "Default (UF2)", 256, "picoprobe_cmsis_dap.tcl", "uf2conv", "uf2conv-network"],
["picotool", "Picotool", 256, "picoprobe.tcl", "picotool", None],
["picoprobe", "Picoprobe", 256, "picoprobe.tcl", "picoprobe", None],
["picoprobe_cmsis_dap", "Picoprobe (CMSIS-DAP)", 256, "picoprobe_cmsis_dap.tcl", "picoprobe_cmsis_dap", None],
["picodebug", "Pico-Debug", 240, "picodebug.tcl", "picodebug", None] ]:
print("%s.menu.uploadmethod.%s=%s" % (name, a, b))
@@ -216,6 +215,9 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flash
BuildFlashMenu(name, 4*1024*1024, [0, 3*1024*1024, 2*1024*1024])
BuildFlashMenu(name, 8*1024*1024, [0, 7*1024*1024, 4*1024*1024, 2*1024*1024])
BuildFlashMenu(name, 16*1024*1024, [0, 15*1024*1024, 14*1024*1024, 12*1024*1024, 8*1024*1024, 4*1024*1024, 2*1024*1024])
elif name == "pimoroni_tiny2040":
BuildFlashMenu(name, 2*1024*1024, fssizelist)
BuildFlashMenu(name, 8*1024*1024, [0, 7*1024*1024, 4*1024*1024, 2*1024*1024])
else:
BuildFlashMenu(name, flashsizemb * 1024 * 1024, fssizelist)
BuildFreq(name)
@@ -348,6 +350,7 @@ MakeBoard("adafruit_feather_usb_host", "Adafruit", "Feather RP2040 USB Host", "0
MakeBoard("adafruit_feather_can", "Adafruit", "Feather RP2040 CAN", "0x239a", "0x812f", 250, "ADAFRUIT_FEATHER_RP2040_CAN", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_feather_prop_maker", "Adafruit", "Feather RP2040 Prop-Maker", "0x239a", "0x8131", 250, "ADAFRUIT_FEATHER_RP2040_PROP_MAKER", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_itsybitsy", "Adafruit", "ItsyBitsy RP2040", "0x239a", "0x80fd", 250, "ADAFRUIT_ITSYBITSY_RP2040", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_metro", "Adafruit", "Metro RP2040", "0x239a", "0x813d", 250, "ADAFRUIT_METRO_RP2040", 16, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_qtpy", "Adafruit", "QT Py RP2040", "0x239a", "0x80f7", 250, "ADAFRUIT_QTPY_RP2040", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_stemmafriend", "Adafruit", "STEMMA Friend RP2040", "0x239a", "0x80e3", 250, "ADAFRUIT_STEMMAFRIEND_RP2040", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_trinkeyrp2040qt", "Adafruit", "Trinkey RP2040 QT", "0x239a", "0x8109", 250, "ADAFRUIT_TRINKEYQT_RP2040", 8, "boot2_w25q080_2_padded_checksum")
@@ -357,6 +360,9 @@ MakeBoard("adafruit_kb2040", "Adafruit", "KB2040", "0x239a", "0x8105", 250, "ADA
# Arduino
MakeBoard("arduino_nano_connect", "Arduino", "Nano RP2040 Connect", "0x2341", ["0x005e", "0x805e", "0x015e", "0x025e"] , 250, "NANO_RP2040_CONNECT", 16, "boot2_w25q080_2_padded_checksum")
# ArtronShop
MakeBoard("artronshop_rp2_nano", "ArtronShop", "RP2 Nano", "0x2e8a", "0x000a", 250, "ARTRONSHOP_RP2_NANO", 2, "boot2_w25q080_2_padded_checksum")
# BridgeTek
MakeBoard("bridgetek_idm2040-7a", "BridgeTek", "IDM2040-7A", "0x2e8a", "0x1041", 250, "BRIDGETEK_IDM2040-7A", 8, "boot2_w25q080_2_padded_checksum", ["FT8XX_TYPE=BT817", "DISPLAY_RES=WVGA", "PLATFORM_RP2040"])
@@ -385,6 +391,7 @@ MakeBoard("challenger_2040_lora", "iLabs", "Challenger 2040 LoRa", "0x2e8a", "0x
MakeBoard("challenger_2040_subghz", "iLabs", "Challenger 2040 SubGHz", "0x2e8a", "0x1032", 250, "CHALLENGER_2040_SUBGHZ_RP2040", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("challenger_2040_wifi", "iLabs", "Challenger 2040 WiFi", "0x2e8a", "0x1006", 250, "CHALLENGER_2040_WIFI_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
MakeBoard("challenger_2040_wifi_ble", "iLabs", "Challenger 2040 WiFi/BLE", "0x2e8a", "0x102C", 500, "CHALLENGER_2040_WIFI_BLE_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
MakeBoard("challenger_2040_wifi6_ble", "iLabs", "Challenger 2040 WiFi6/BLE", "0x2e8a", "0x105F", 500, "CHALLENGER_2040_WIFI6_BLE_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
MakeBoard("challenger_nb_2040_wifi", "iLabs", "Challenger NB 2040 WiFi", "0x2e8a", "0x100d", 500, "CHALLENGER_NB_2040_WIFI_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
MakeBoard("challenger_2040_sdrtc", "iLabs", "Challenger 2040 SD/RTC", "0x2e8a", "0x102d", 250, "CHALLENGER_2040_SDRTC_RP2040", 8, "boot2_w25q080_2_padded_checksum")
MakeBoard("challenger_2040_nfc", "iLabs", "Challenger 2040 NFC", "0x2e8a", "0x1036", 250, "CHALLENGER_2040_NFC_RP2040", 8, "boot2_w25q080_2_padded_checksum")
@@ -403,6 +410,11 @@ MakeBoard("nullbits_bit_c_pro", "nullbits", "Bit-C PRO", "0x2e8a", "0x6e61", 500
# Pimoroni
MakeBoard("pimoroni_pga2040", "Pimoroni", "PGA2040", "0x2e8a", "0x1008", 250, "PIMORONI_PGA2040", 8, "boot2_w25q64jv_4_padded_checksum")
MakeBoard("pimoroni_plasma2040", "Pimoroni", "Plasma2040", "0x2e8a", "0x100a", 500, "PIMORONI_PLASMA2040", 2, "boot2_w25q080_2_padded_checksum")
MakeBoard("pimoroni_tiny2040", "Pimoroni", "Tiny2040", "0x2e8a", "0x100a", 500, "PIMORONI_TINY2040", 2, "boot2_w25q64jv_4_padded_checksum")
# Silicognition
MakeBoard("silicognition_rp2040_shim", "Silicognition", "RP2040-Shim", "0x1209", "0xf502", 500, "SILICOGNITION_RP2040_SHIM", 4, "boot2_generic_03h_4_padded_checksum")
# Solder Party
MakeBoard("solderparty_rp2040_stamp", "Solder Party", "RP2040 Stamp", "0x1209", "0xa182", 500, "SOLDERPARTY_RP2040_STAMP", 8, "boot2_generic_03h_4_padded_checksum")
@@ -437,6 +449,9 @@ MakeBoard("wiznet_5100s_evb_pico", "WIZnet", "W5100S-EVB-Pico", "0x2e8a", "0x102
MakeBoard("wiznet_wizfi360_evb_pico", "WIZnet", "WizFi360-EVB-Pico", "0x2e8a", "0x1028", 250, "WIZNET_WIZFI360_EVB_PICO", 2, "boot2_w25q080_2_padded_checksum")
MakeBoard("wiznet_5500_evb_pico", "WIZnet", "W5500-EVB-Pico", "0x2e8a", "0x1029", 250, "WIZNET_5500_EVB_PICO", 2, "boot2_w25q080_2_padded_checksum")
# AG
MakeBoard("redscorp-rp2040-promini", "redscorp", "RP2040-ProMini", "0x2341", ["0x005f", "0x805f", "0x015f", "0x025f"] , 250, "REDSCORP_RP2040_PROMINI", 16, "boot2_w25q080_2_padded_checksum")
# Generic
MakeBoard("generic", "Generic", "RP2040", "0x2e8a", "0xf00a", 250, "GENERIC_RP2040", 16, "boot2_generic_03h_4_padded_checksum")
+1 -1
View File
@@ -53,7 +53,7 @@ for l in file_lines:
def is_pio_build():
from SCons.Script import COMMAND_LINE_TARGETS
return "idedata" not in COMMAND_LINE_TARGETS and "_idedata" not in COMMAND_LINE_TARGETS
return all([x not in COMMAND_LINE_TARGETS for x in ["idedata", "_idedata", "__idedata"]])
# get all activated macros
flatten_cppdefines = env.Flatten(env['CPPDEFINES'])
+41
View File
@@ -0,0 +1,41 @@
#pragma once
// LEDs
#define PIN_LED (13u)
// NeoPixel
#define PIN_NEOPIXEL (14u)
// Serial
#define PIN_SERIAL1_TX (0u)
#define PIN_SERIAL1_RX (1u)
// Not pinned out
#define PIN_SERIAL2_TX (31u)
#define PIN_SERIAL2_RX (31u)
// SPI
#define PIN_SPI0_MISO (20u)
#define PIN_SPI0_MOSI (19u)
#define PIN_SPI0_SCK (18u)
#define PIN_SPI0_SS (23u)
// Not pinned out
#define PIN_SPI1_MISO (31u)
#define PIN_SPI1_MOSI (31u)
#define PIN_SPI1_SCK (31u)
#define PIN_SPI1_SS (31u)
// Wire
#define __WIRE0_DEVICE i2c0
#define PIN_WIRE0_SDA (16u)
#define PIN_WIRE0_SCL (17u)
#define __WIRE1_DEVICE i2c1
#define PIN_WIRE1_SDA (2u)
#define PIN_WIRE1_SCL (3u)
#define SERIAL_HOWMANY (2u)
#define SPI_HOWMANY (1u)
#define WIRE_HOWMANY (1u)
#include "../generic/common.h"
@@ -0,0 +1,72 @@
#pragma once
#include <stdint.h>
// LEDs
#define PIN_LED (13u)
// Serial
#define PIN_SERIAL1_TX (0u)
#define PIN_SERIAL1_RX (1u)
#define PIN_SERIAL2_TX (8u)
#define PIN_SERIAL2_RX (9u)
// SPI
#define PIN_SPI0_MISO (4u)
#define PIN_SPI0_MOSI (3u)
#define PIN_SPI0_SCK (2u)
#define PIN_SPI0_SS (5u)
#define PIN_SPI1_MISO (12u)
#define PIN_SPI1_MOSI (11u)
#define PIN_SPI1_SCK (10u)
#define PIN_SPI1_SS (13u)
// Wire
#define PIN_WIRE0_SDA (16u)
#define PIN_WIRE0_SCL (17u)
#define PIN_WIRE1_SDA (18u)
#define PIN_WIRE1_SCL (19u)
#define SERIAL_HOWMANY (3u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (2u)
// from common.h
#define PINS_COUNT (22u)
#define NUM_DIGITAL_PINS (16u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)
#define ADC_RESOLUTION (12u)
#define LED_BUILTIN PIN_LED
static const uint8_t D0 = (0u);
static const uint8_t D1 = (1u);
static const uint8_t D2 = (2u);
static const uint8_t D3 = (3u);
static const uint8_t D4 = (4u);
static const uint8_t D5 = (5u);
static const uint8_t D6 = (6u);
static const uint8_t D7 = (7u);
static const uint8_t D8 = (8u);
static const uint8_t D9 = (9u);
static const uint8_t D10 = (10u);
static const uint8_t D11 = (11u);
static const uint8_t D12 = (12u);
static const uint8_t D13 = (13u);
static const uint8_t A0 = (26u);
static const uint8_t A1 = (27u);
static const uint8_t A2 = (28u);
static const uint8_t A3 = (29u);
static const uint8_t SS = PIN_SPI1_SS;
static const uint8_t MOSI = PIN_SPI1_MOSI;
static const uint8_t MISO = PIN_SPI1_MISO;
static const uint8_t SCK = PIN_SPI1_SCK;
static const uint8_t SDA = PIN_WIRE0_SDA;
static const uint8_t SCL = PIN_WIRE0_SCL;
@@ -0,0 +1,147 @@
/*
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
Copyright (c) 2021,2022 P. Oldberg <pontus@ilabs.se>
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
*/
#include <Arduino.h>
#include <ChallengerWiFi.h>
Challenger2040WiFiClass::Challenger2040WiFiClass(HardwareSerial* serial) {
_serial = serial;
pinMode(PIN_ESP_RST, OUTPUT);
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
pinMode(PIN_ESP_MODE, OUTPUT);
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
pinMode(D15, OUTPUT);
digitalWrite(D15, HIGH); // This is to correct for the
// patched PCB.
}
// Do a HW reset by applying a low pulse to the reset line for 1mSec
void Challenger2040WiFiClass::doHWReset() {
pinMode(D15, OUTPUT);
digitalWrite(D15, HIGH); // This is to correct for the
delay(1);
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
delay(1);
digitalWrite(PIN_ESP_RST, HIGH); // Release ESP reset
}
// Set the mode flag high to indicate normal run operation and do a HW
// reset.
void Challenger2040WiFiClass::runReset() { // Prepare ESP for normal op
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
doHWReset();
}
// Set the mode flag low to indicate flash operation and do a HW
// reset.
void Challenger2040WiFiClass::flashReset() { // Prepare ESP for flashing
digitalWrite(PIN_ESP_MODE, LOW); // Prepare for normal start
doHWReset();
}
// Wait for the modem to reply with a "ready" prompt. This can be done
// after a sw or hw reset have been performed to ensure that the AT
// interpreter is up and running.
bool Challenger2040WiFiClass::waitForReady() {
int timeout = 20; // Aprox max 2 sec
_serial->setTimeout(100);
String rdy = _serial->readStringUntil('\n');
while (!rdy.startsWith("ready") && timeout--) {
rdy = _serial->readStringUntil('\n');
}
_serial->setTimeout(1000); // Reset default timeout to 1000
if (timeout) {
return true;
}
return false;
}
// Reset the ESP and wait for the "ready" prompt to be returned.
bool Challenger2040WiFiClass::reset() {
runReset();
_serial->begin(DEFAULT_ESP_BAUDRATE);
return waitForReady();
}
// Checks to see if the modem responds to the "AT" poll command.
bool Challenger2040WiFiClass::isAlive() {
int timeout = 100;
_serial->setTimeout(250);
_serial->println(F("AT"));
String rdy = _serial->readStringUntil('\n');
while (!rdy.startsWith(F("OK")) && timeout--) {
_serial->println(F("AT"));
rdy = _serial->readStringUntil('\n');
}
_serial->setTimeout(1000);
if (timeout) {
return true;
}
return false;
}
// Change the baud rate of the ESP device as well as the local UART.
// No checking is done on the input baud rate so the user must know what
// baud rates are valid. The function ends by checking if the ESP is
// reachable by doing an "AT" poll.
bool Challenger2040WiFiClass::changeBaudRate(int baud) {
_serial->print(F("AT+UART_CUR="));
_serial->print(baud);
_serial->println(F(",8,1,0,0"));
delay(100);
_serial->end();
_serial->begin(baud);
return isAlive();
}
// This method should be called id the builtin object isn't needed any more
// It basically just releases the UART pins for other use.
void Challenger2040WiFiClass::release() {
_serial->end();
}
// We can assign a new hardware serial port to accommodate the ESP device here.
// The function will release the previously used serial port and assign the
// new port. The ESP will be left in a reset state ready to start normal
// operation when exiting the function.
// This function is useful for when using the PIO serial ports to communicate
// with the ESP instead of the built in hardware serial port.
void Challenger2040WiFiClass::setSerial(HardwareSerial* serial) {
release();
_serial = serial;
pinMode(PIN_ESP_RST, OUTPUT);
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
pinMode(PIN_ESP_MODE, OUTPUT);
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
}
// Return the current serial object
HardwareSerial* Challenger2040WiFiClass::getSerial() {
return _serial;
}
Challenger2040WiFiClass Challenger2040WiFi;
@@ -0,0 +1,43 @@
/*
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
Copyright (c) 2021,2022 P. Oldberg <pontus@ilabs.se>
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
*/
#pragma once
#define DEFAULT_ESP32_BAUDRATE 115200
#define DEFAULT_ESP_BAUDRATE DEFAULT_ESP32_BAUDRATE
class Challenger2040WiFiClass {
public:
Challenger2040WiFiClass(HardwareSerial* = &ESP_SERIAL_PORT);
void doHWReset();
void runReset();
void flashReset();
bool waitForReady();
bool reset();
bool isAlive();
bool changeBaudRate(int);
void release();
void setSerial(HardwareSerial*);
HardwareSerial* getSerial();
private:
HardwareSerial* _serial;
};
extern Challenger2040WiFiClass Challenger2040WiFi;
@@ -0,0 +1,29 @@
/*
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
Copyright (c) 2021,2022 P. Oldberg <pontus@ilabs.se>
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
*/
#include <Arduino.h>
#include <ChallengerWiFi.h>
/**
Just make sure we try to reset the ESP device before the user starts
using the device.
*/
void initVariant() {
Challenger2040WiFi.reset();
}
@@ -0,0 +1,95 @@
#pragma once
#define PINS_COUNT (24u)
#define NUM_DIGITAL_PINS (24u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)
#define ADC_RESOLUTION (12u)
// LEDs
#define PIN_LED (10u)
// Board serial port (Uart0)
#define PIN_SERIAL1_TX (16u)
#define PIN_SERIAL1_RX (17u)
// Uart connected to ESP32C6 (Uart1)
#define PIN_SERIAL2_TX (4u)
#define PIN_SERIAL2_RX (5u)
#define PIN_ESP32_RST (19u)
#define PIN_ESP32_MODE (24u)
#define ESP32_SERIAL Serial2
// Uart define esp serial abstraction pins
#define PIN_ESP_TX PIN_SERIAL2_TX
#define PIN_ESP_RX PIN_SERIAL2_RX
#define PIN_ESP_RST PIN_ESP32_RST
#define PIN_ESP_MODE PIN_ESP32_MODE
#define ESP_SERIAL_PORT ESP32_SERIAL
// SPI
#define PIN_SPI0_MISO (24u)
#define PIN_SPI0_MOSI (23u)
#define PIN_SPI0_SCK (22u)
#define PIN_SPI0_SS (21u)
// SPI connected to ESP32C6
#define PIN_SPI1_MISO (12u)
#define PIN_SPI1_MOSI (15u)
#define PIN_SPI1_SCK (14u)
#define PIN_SPI1_SS (13u)
// Handshake signal from ESP32C6
#define ESP32_HS (18u)
#define ESP32_SPI SPI1
// Wire
#define PIN_WIRE0_SDA (0u)
#define PIN_WIRE0_SCL (1u)
// Not pinned out
#define PIN_WIRE1_SDA (31u)
#define PIN_WIRE1_SCL (31u)
#define SERIAL_HOWMANY (2u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (1u)
#define LED_BUILTIN PIN_LED
#define NEOPIXEL (11u)
static const uint8_t D0 = (16u);
static const uint8_t D1 = (17u);
static const uint8_t D2 = (20u);
static const uint8_t D3 = (23u);
static const uint8_t D4 = (22u);
static const uint8_t D5 = (2u);
static const uint8_t D6 = (3u);
static const uint8_t D7 = (0u);
static const uint8_t D8 = (1u);
static const uint8_t D9 = (6u);
static const uint8_t D10 = (7u);
static const uint8_t D11 = (8u);
static const uint8_t D12 = (9u);
static const uint8_t D13 = (10u);
static const uint8_t D14 = (11u);
static const uint8_t D15 = (12u);
static const uint8_t D16 = (13u);
static const uint8_t D17 = (14u);
static const uint8_t D18 = (15u);
static const uint8_t D19 = (18u);
static const uint8_t D20 = (19u);
static const uint8_t D21 = (24u);
static const uint8_t A0 = (26u);
static const uint8_t A1 = (27u);
static const uint8_t A2 = (28u);
static const uint8_t A3 = (29u);
static const uint8_t A4 = (25u);
static const uint8_t A5 = (21u);
static const uint8_t SS = PIN_SPI0_SS;
static const uint8_t MOSI = PIN_SPI0_MOSI;
static const uint8_t MISO = PIN_SPI0_MISO;
static const uint8_t SCK = PIN_SPI0_SCK;
static const uint8_t SDA = PIN_WIRE0_SDA;
static const uint8_t SCL = PIN_WIRE0_SCL;
+2
View File
@@ -1,5 +1,7 @@
#pragma once
#include <stdint.h>
#define PINS_COUNT (30u)
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)
@@ -0,0 +1,82 @@
#pragma once
// Pin definitions taken from:
// https://github.com/rp-rs/rp-hal-boards/blob/main/boards/pimoroni-plasma-2040/src/lib.rs
// LEDs
#define PIN_LED (16u)
#define PIN_LED_R (16u)
#define PIN_LED_G (17u)
#define PIN_LED_B (18u)
#define LED_BUILTIN PIN_LED
// Digital pins
#if 0
static const uint8_t D0 = (26u);
static const uint8_t D1 = (27u);
static const uint8_t D2 = (28u);
static const uint8_t D3 = (29u);
static const uint8_t D4 = (6u);
static const uint8_t D5 = (7u);
static const uint8_t D6 = (0u);
static const uint8_t D7 = (1u);
static const uint8_t D8 = (2u);
static const uint8_t D9 = (4u);
static const uint8_t D10 = (3u);
#endif
// Analog pins
static const uint8_t A0 = (26u);
static const uint8_t A1 = (27u);
static const uint8_t A2 = (28u);
static const uint8_t A3 = (31u);
#define ADC_RESOLUTION 12
// NeoPixel
#define PIN_NEOPIXEL (15u)
//#define NEOPIXEL_POWER (11u)
// Serial1
#define PIN_SERIAL1_TX (31u)
#define PIN_SERIAL1_RX (31u)
// Serial2 not pinned out
#define PIN_SERIAL2_TX (31u)
#define PIN_SERIAL2_RX (31u)
// SPI
#define PIN_SPI0_MISO (31u)
#define PIN_SPI0_MOSI (31u)
#define PIN_SPI0_SCK (31u)
#define PIN_SPI0_SS (31u) // not pinned out
//static const uint8_t SS = PIN_SPI0_SS; // SPI Slave SS not used. Set here only for reference.
//static const uint8_t MOSI = PIN_SPI0_MOSI;
//static const uint8_t MISO = PIN_SPI0_MISO;
//static const uint8_t SCK = PIN_SPI0_SCK;
// Not pinned out
#define PIN_SPI1_MISO (31u)
#define PIN_SPI1_MOSI (31u)
#define PIN_SPI1_SCK (31u)
#define PIN_SPI1_SS (31u)
//#define SPI_MISO (PIN_SPI1_MISO)
//#define SPI_MOSI (PIN_SPI1_MOSI)
//#define SPI_SCK (PIN_SPI1_SCK)
// Wire
#define __WIRE0_DEVICE (i2c1)
#define PIN_WIRE0_SDA (20u)
#define PIN_WIRE0_SCL (21u)
#define SDA PIN_WIRE0_SDA
#define SCL PIN_WIRE0_SCL
#define I2C_SDA (SDA)
#define I2C_SCL (SCL)
// Wire1 not pinned out
#define __WIRE1_DEVICE (i2c0)
#define PIN_WIRE1_SDA (31u)
#define PIN_WIRE1_SCL (31u)
#define SERIAL_HOWMANY (0u)
#define SPI_HOWMANY (0u)
#define WIRE_HOWMANY (1u)
@@ -0,0 +1,5 @@
#pragma once
// This is a bare board with no real predefined pins, so use generic
#include "../generic/pins_arduino.h"
@@ -0,0 +1,102 @@
/* RP2040-ProMini board support
URL: https://github.com/red-scorp/RP2040-ProMini
Based on Arduino Nano Connect configuration */
#pragma once
// Pin definitions taken from:
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
static const uint8_t D0 = (1u);
static const uint8_t D1 = (0u);
static const uint8_t D2 = (25u);
static const uint8_t D3 = (15u);
static const uint8_t D4 = (16u);
static const uint8_t D5 = (17u);
static const uint8_t D6 = (18u);
static const uint8_t D7 = (19u);
static const uint8_t D8 = (20u);
static const uint8_t D9 = (21u);
static const uint8_t D10 = (5u);
static const uint8_t D11 = (7u);
static const uint8_t D12 = (4u);
static const uint8_t D13 = (6u);
static const uint8_t D14 = (26u);
static const uint8_t D15 = (27u);
static const uint8_t D16 = (28u);
static const uint8_t D17 = (29u);
static const uint8_t D18 = (12u);
static const uint8_t D19 = (13u);
static const uint8_t D20 = (22u);
static const uint8_t D21 = (23u);
static const uint8_t D22 = (2u);
static const uint8_t D23 = (24u);
static const uint8_t D24 = (3u);
static const uint8_t D25 = (8u);
static const uint8_t D26 = (9u);
static const uint8_t D27 = (10u);
static const uint8_t D28 = (11u);
static const uint8_t D29 = (14u);
static const uint8_t A0 = (26u);
static const uint8_t A1 = (27u);
static const uint8_t A2 = (28u);
static const uint8_t A3 = (29u);
// LEDs
#define PIN_LED (D13)
// Serial
#define PIN_SERIAL1_TX (D1)
#define PIN_SERIAL1_RX (D0)
#define PIN_SERIAL2_TX (D25)
#define PIN_SERIAL2_RX (D26)
#define PIN_SERIAL2_CTS (D27)
#define PIN_SERIAL2_RTS (D28)
// SPI
#define PIN_SPI0_MISO (D12)
#define PIN_SPI0_MOSI (D11)
#define PIN_SPI0_SCK (D13)
#define PIN_SPI0_SS (D10)
#define PIN_SPI1_MISO (D25)
#define PIN_SPI1_MOSI (D28)
#define PIN_SPI1_SCK (D29)
#define PIN_SPI1_SS (D10)
// Wire
#define PIN_WIRE0_SDA (D18)
#define PIN_WIRE0_SCL (D19)
#define PIN_WIRE1_SDA (D14)
#define PIN_WIRE1_SCL (D15)
#define SERIAL_HOWMANY (3u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (1u)
#define PINS_COUNT (30u)
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)
#define ADC_RESOLUTION (12u)
#define LED_BUILTIN PIN_LED
#define DigitalPinToPinName(p) (p)
static const uint8_t SS = PIN_SPI0_SS;
static const uint8_t MOSI = PIN_SPI0_MOSI;
static const uint8_t MISO = PIN_SPI0_MISO;
static const uint8_t SCK = PIN_SPI0_SCK;
// Some random stuff
#define SERIAL_PORT_USBVIRTUAL SerialUSB
#define SERIAL_PORT_MONITOR SerialUSB
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial2
#define CRYPTO_WIRE Wire
#define USB_MAX_POWER (500)
@@ -0,0 +1,81 @@
#pragma once
// Pin definitions taken from:
// https://silicognition.com/Products/rp2040-shim/
// LEDs
#define LED_BUILTIN (22u)
// NeoPixel
#define PIN_NEOPIXEL (23u)
// Serial
#define PIN_SERIAL1_TX (0u)
#define PIN_SERIAL1_RX (1u)
// Not pinned out
#define PIN_SERIAL2_TX (31u)
#define PIN_SERIAL2_RX (31u)
// SPI0
#define __SPI0_DEVICE spi1
#define PIN_SPI0_MISO (12u)
#define PIN_SPI0_MOSI (11u)
#define PIN_SPI0_SCK (10u)
#define PIN_SPI0_SS (21u)
// SPI1
#define __SPI1_DEVICE spi0
#define PIN_SPI1_MISO (20u)
#define PIN_SPI1_MOSI (19u)
#define PIN_SPI1_SCK (18u)
#define PIN_SPI1_SS (15u)
// Wire
#define __WIRE0_DEVICE i2c0
#define PIN_WIRE0_SDA (16u)
#define PIN_WIRE0_SCL (17u)
#define __WIRE1_DEVICE i2c1
#define PIN_WIRE1_SDA (31u)
#define PIN_WIRE1_SCL (31u)
#define SERIAL_HOWMANY (2u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (1u)
// Defines normally loaded from common.h
// We have custom pin mapping to match Adafruit Feather
#define PINS_COUNT (30u)
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)
#define ADC_RESOLUTION (12u)
static const uint8_t D0 = (1u);
static const uint8_t D1 = (0u);
static const uint8_t D4 = (6u);
static const uint8_t D5 = (18u);
static const uint8_t D6 = (19u);
static const uint8_t D9 = (20u);
static const uint8_t D10 = (21u);
static const uint8_t D11 = (15u);
static const uint8_t D12 = (14u);
static const uint8_t D13 = (22u);
static const uint8_t D24 = (24u);
static const uint8_t D25 = (25u);
static const uint8_t A0 = (29u);
static const uint8_t A1 = (28u);
static const uint8_t A2 = (27u);
static const uint8_t A3 = (26u);
static const uint8_t SS = PIN_SPI0_SS;
static const uint8_t MOSI = PIN_SPI0_MOSI;
static const uint8_t MISO = PIN_SPI0_MISO;
static const uint8_t SCK = PIN_SPI0_SCK;
static const uint8_t SDA = PIN_WIRE0_SDA;
static const uint8_t SCL = PIN_WIRE0_SCL;