Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dcfe4d483 | ||
|
|
3df1392a1b | ||
|
|
7c51742522 | ||
|
|
08353deb88 | ||
|
|
d5e844b2bd | ||
|
|
de7f1a7e83 | ||
|
|
19b14898ea | ||
|
|
304e9ce2d1 | ||
|
|
2bc00bef57 |
+4
-1
@@ -5,5 +5,8 @@ docs/_build
|
||||
ota/build
|
||||
ota/build-rp2350
|
||||
ota/build-rp2350-riscv
|
||||
tools/libpico/build
|
||||
tools/libpico/boot
|
||||
tools/libpico/build-rp2040
|
||||
tools/libpico/build-rp2350
|
||||
tools/libpico/build-rp2350-riscv
|
||||
platform.local.txt
|
||||
|
||||
+135
-127
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#define ARDUINO_PICO_MAJOR 4
|
||||
#define ARDUINO_PICO_MINOR 5
|
||||
#define ARDUINO_PICO_REVISION 3
|
||||
#define ARDUINO_PICO_VERSION_STR "4.5.3"
|
||||
#define ARDUINO_PICO_REVISION 4
|
||||
#define ARDUINO_PICO_VERSION_STR "4.5.4"
|
||||
|
||||
@@ -244,3 +244,10 @@ void hexdump(const void* mem, uint32_t len, uint8_t cols) {
|
||||
}
|
||||
|
||||
const String emptyString = "";
|
||||
|
||||
extern "C" void __attribute__((__noreturn__)) __wrap___stack_chk_fail() {
|
||||
while (true) {
|
||||
panic("*** stack smashing detected ***: terminated\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'4.5.3'
|
||||
version = u'4.5.4'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'4.5.3'
|
||||
release = u'4.5.4'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -67,3 +67,5 @@
|
||||
-Wl,--wrap=cyw43_tcpip_link_status
|
||||
-Wl,--wrap=cyw43_cb_tcpip_init
|
||||
-Wl,--wrap=cyw43_cb_tcpip_deinit
|
||||
|
||||
-Wl,--wrap=__stack_chk_fail
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1
|
||||
-DTARGET_RP2350
|
||||
-DCYW43_LWIP=1
|
||||
-DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
|
||||
-DCFG_TUSB_MCU=OPT_MCU_RP2040
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1
|
||||
-DTARGET_RP2350
|
||||
-DCYW43_LWIP=1
|
||||
-DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
|
||||
-DCFG_TUSB_MCU=OPT_MCU_RP2040
|
||||
|
||||
@@ -50,11 +50,6 @@ bool ADCInput::setBuffers(size_t buffers, size_t bufferWords) {
|
||||
int ADCInput::_mask(pin_size_t p) {
|
||||
switch (p) {
|
||||
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
|
||||
case 26: return 1;
|
||||
case 27: return 2;
|
||||
case 28: return 4;
|
||||
case 29: return 8;
|
||||
#else // Starts at 40 and there are 8 of them
|
||||
case 40: return 1;
|
||||
case 41: return 2;
|
||||
case 42: return 4;
|
||||
@@ -63,6 +58,11 @@ int ADCInput::_mask(pin_size_t p) {
|
||||
case 45: return 32;
|
||||
case 46: return 64;
|
||||
case 47: return 128;
|
||||
#else
|
||||
case 26: return 1;
|
||||
case 27: return 2;
|
||||
case 28: return 4;
|
||||
case 29: return 8;
|
||||
#endif
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
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
|
||||
|
||||
Modified May 2025 by Sven Bruns (Lorandil on GitHub) to support user defined buffer size (inspired by ESP32 code)
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
@@ -46,6 +48,10 @@ TwoWire::TwoWire(i2c_inst_t *i2c, pin_size_t sda, pin_size_t scl) {
|
||||
_running = false;
|
||||
_txBegun = false;
|
||||
_buffLen = 0;
|
||||
|
||||
// allocate buffer memory early, so we don't fragment the heap later
|
||||
_buffSize = WIRE_BUFFER_SIZE;
|
||||
_buff = (uint8_t *)malloc(_buffSize);
|
||||
}
|
||||
|
||||
bool TwoWire::setSDA(pin_size_t pin) {
|
||||
@@ -158,6 +164,16 @@ void TwoWire::begin(uint8_t addr) {
|
||||
// ERROR
|
||||
return;
|
||||
}
|
||||
|
||||
// allocate buffer if necessary
|
||||
if (!_buff) {
|
||||
_buff = (uint8_t *)malloc(_buffSize);
|
||||
if (!_buff) {
|
||||
// ERROR
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_slave = true;
|
||||
i2c_init(_i2c, _clkHz);
|
||||
i2c_set_slave_mode(_i2c, true, addr);
|
||||
@@ -192,7 +208,7 @@ void TwoWire::onIRQ() {
|
||||
// First, pull off any data available
|
||||
if (irqstat & (1 << 2)) {
|
||||
// RX_FULL
|
||||
if (_buffLen < (int)sizeof(_buff)) {
|
||||
if (_buffLen < int(_buffSize)) {
|
||||
_buff[_buffLen++] = _i2c->hw->data_cmd & 0xff;
|
||||
} else {
|
||||
_i2c->hw->data_cmd;
|
||||
@@ -271,7 +287,7 @@ void TwoWire::beginTransmission(uint8_t addr) {
|
||||
}
|
||||
|
||||
size_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit) {
|
||||
if (!_running || _txBegun || !quantity || (quantity > sizeof(_buff))) {
|
||||
if (!_running || _txBegun || !quantity || (quantity > _buffSize)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -448,7 +464,7 @@ size_t TwoWire::write(uint8_t ucData) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (!_txBegun || (_buffLen == sizeof(_buff))) {
|
||||
if (!_txBegun || (_buffLen == int(_buffSize))) {
|
||||
return 0;
|
||||
}
|
||||
_buff[_buffLen++] = ucData;
|
||||
@@ -745,6 +761,20 @@ void TwoWire::clearTimeoutFlag() {
|
||||
_timeoutFlag = false;
|
||||
}
|
||||
|
||||
size_t TwoWire::setBufferSize(size_t bSize) {
|
||||
if (_running) {
|
||||
// ERROR - transmission already running. Report back current buffer size
|
||||
return _buffSize;
|
||||
}
|
||||
// only free the buffer, if it already exists and the new size differs from the current one
|
||||
if (_buff && (bSize != _buffSize)) {
|
||||
free(_buff);
|
||||
_buff = nullptr;
|
||||
}
|
||||
_buffSize = max(WIRE_BUFFER_SIZE_MIN, int(bSize)); // enforce minimum buffer size
|
||||
return _buffSize;
|
||||
}
|
||||
|
||||
#ifndef __WIRE0_DEVICE
|
||||
#define __WIRE0_DEVICE i2c0
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
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
|
||||
|
||||
Modified May 2025 by Sven Bruns (Lorandil on GitHub) to support user defined buffer size (inspired by ESP32 code)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@@ -30,8 +32,14 @@
|
||||
// WIRE_HAS_END means Wire has end()
|
||||
#define WIRE_HAS_END 1
|
||||
|
||||
// WIRE_HAS_BUFFER_SIZE means Wire has setBufferSize()
|
||||
#define WIRE_HAS_BUFFER_SIZE 1
|
||||
|
||||
#ifndef WIRE_BUFFER_SIZE
|
||||
#define WIRE_BUFFER_SIZE 256
|
||||
#define WIRE_BUFFER_SIZE 256 // default size, if none is set using Wire::setBuffersize(size_t)
|
||||
#endif
|
||||
#ifndef WIRE_BUFFER_SIZE_MIN
|
||||
#define WIRE_BUFFER_SIZE_MIN 32 // minimum size for safe operation
|
||||
#endif
|
||||
|
||||
class TwoWire : public HardwareI2C {
|
||||
@@ -97,6 +105,8 @@ public:
|
||||
bool getTimeoutFlag(void);
|
||||
void clearTimeoutFlag(void);
|
||||
|
||||
size_t setBufferSize(size_t bSize); // set buffer size (call prior to 'begin()')
|
||||
|
||||
// IRQ callback
|
||||
void onIRQ();
|
||||
|
||||
@@ -115,7 +125,9 @@ private:
|
||||
bool _reset_with_timeout;
|
||||
void _handleTimeout(bool reset);
|
||||
|
||||
uint8_t _buff[WIRE_BUFFER_SIZE];
|
||||
uint8_t *_buff; // pointer to i2c buffer
|
||||
size_t _buffSize; // current buffer size
|
||||
|
||||
int _buffLen;
|
||||
int _buffOff;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "framework-arduinopico",
|
||||
"version": "1.40503.0",
|
||||
"version": "1.40504.0",
|
||||
"description": "Arduino Wiring-based Framework (RPi Pico RP2040, RP2350)",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
||||
+2
-1
@@ -20,7 +20,7 @@
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=Raspberry Pi RP2040/RP2350 Boards
|
||||
version=4.5.3
|
||||
version=4.5.4
|
||||
|
||||
# Required discoveries and monitors
|
||||
# ---------------------------------
|
||||
@@ -203,6 +203,7 @@ tools.uf2conv-network.cmd={runtime.platform.path}/system/python3/python3
|
||||
tools.uf2conv-network.upload.protocol=uf2
|
||||
tools.uf2conv-network.upload.params.verbose=
|
||||
tools.uf2conv-network.upload.params.quiet=
|
||||
tools.uf2conv-network.upload.field.password=Password
|
||||
tools.uf2conv-network.upload.pattern="{cmd}" -I "{runtime.platform.path}/tools/espota.py" -i "{upload.port.address}" -p "{upload.port.properties.port}" "--auth={upload.field.password}" -f "{build.path}/{build.project_name}.bin"
|
||||
|
||||
#tools.picotool.cmd={runtime.tools.pqt-picotool.path}
|
||||
|
||||
+2
-2
@@ -112,7 +112,7 @@ def BuildStackProtect(name):
|
||||
print("%s.menu.stackprotect.Disabled=Disabled" % (name))
|
||||
print("%s.menu.stackprotect.Disabled.build.flags.stackprotect=" % (name))
|
||||
print("%s.menu.stackprotect.Enabled=Enabled" % (name))
|
||||
print("%s.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector" % (name))
|
||||
print("%s.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector-all" % (name))
|
||||
|
||||
def BuildExceptions(name):
|
||||
print("%s.menu.exceptions.Disabled=Disabled" % (name))
|
||||
@@ -364,7 +364,7 @@ def MakeBoard(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine,
|
||||
# Optional, user needs to solder themselves
|
||||
BuildPSRAM(name)
|
||||
BuildPSRAMFreq(name)
|
||||
elif name == "adafruit_feather_rp2350_hstx":
|
||||
elif (name == "adafruit_feather_rp2350_hstx") or (name == "adafruit_metro_rp2350"):
|
||||
# Optional, user needs to solder themselves
|
||||
BuildPSRAM(name)
|
||||
else:
|
||||
|
||||
@@ -1 +1,40 @@
|
||||
#include "../generic/pins_arduino.h"
|
||||
#pragma once
|
||||
|
||||
// Pin definitions taken from:
|
||||
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
|
||||
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (19u)
|
||||
|
||||
// Serial
|
||||
#define PIN_SERIAL1_TX (0u)
|
||||
#define PIN_SERIAL1_RX (1u)
|
||||
|
||||
#define PIN_SERIAL2_TX (8u)
|
||||
#define PIN_SERIAL2_RX (9u)
|
||||
|
||||
// SPI
|
||||
// Default SPI0 pins are used internally and are unavailable on this board. To use SPI0 other peripherals must be sacrificed.
|
||||
#define PIN_SPI0_MISO (2u) // 16u is connected to the buck-boost converted.
|
||||
#define PIN_SPI0_MOSI (3u) // 19u is connected to USERLED, defined as PIN_LED.
|
||||
#define PIN_SPI0_SCK (4u) // 18u is connected to a voltage divider on VBUS.
|
||||
#define PIN_SPI0_SS (5u) // 17u doesn't even show up in the schematics.
|
||||
|
||||
#define PIN_SPI1_MISO (12u)
|
||||
#define PIN_SPI1_MOSI (15u)
|
||||
#define PIN_SPI1_SCK (14u)
|
||||
#define PIN_SPI1_SS (13u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (4u)
|
||||
#define PIN_WIRE0_SCL (5u)
|
||||
|
||||
#define PIN_WIRE1_SDA (26u)
|
||||
#define PIN_WIRE1_SCL (27u)
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (2u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
|
||||
Reference in New Issue
Block a user