Skip to content

Commit ebe82e6

Browse files
committed
Merge branch 'master' into feature/add-sparkfun-iotnode-lorawan-board
2 parents 31bdaf4 + 8caa590 commit ebe82e6

File tree

89 files changed

+3750
-393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3750
-393
lines changed

.github/workflows/pull-request.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: codespell-project/actions-codespell@v2
2121
with:
2222
skip: ./ArduinoCore-API,./libraries/ESP8266SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst,./cores/rp2040/api,./libraries/FreeRTOS,./tools/libbearssl/bearssl,./include,./libraries/WiFi/examples/BearSSL_Server,./ota/uzlib,./libraries/http-parser/lib,./libraries/WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino,./libraries/HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino,./.git,./libraries/FatFS/lib/fatfs,./libraries/FatFS/src/diskio.h,./libraries/FatFS/src/ff.cpp,./libraries/FatFS/src/ffconf.h,./libraries/FatFS/src/ffsystem.cpp,./libraries/FatFS/src/ff.h,./libraries/lwIP_WINC1500/src/driver,./libraries/lwIP_WINC1500/src/common,./libraries/lwIP_WINC1500/src/bus_wrapper,./libraries/lwIP_WINC1500/src/spi_flash
23-
ignore_words_list: ser,dout,shiftIn,acount
23+
ignore_words_list: ser,dout,shiftIn,acount,froms
2424
- name: Get submodules for following tests
2525
run: git submodule update --init
2626
- name: Check package references
@@ -196,7 +196,7 @@ jobs:
196196
name: Mac
197197
strategy:
198198
matrix:
199-
os: [macOS-12, macOS-14]
199+
os: [macOS-13, macOS-14]
200200
runs-on: ${{ matrix.os }}
201201
steps:
202202
- uses: actions/checkout@v4

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ system
33
tools/dist
44
docs/_build
55
ota/build
6+
ota/build-rp2350
7+
ota/build-rp2350-riscv
68
tools/libpico/build
79
platform.local.txt

.readthedocs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ sphinx:
2929
# fail_on_warning: true
3030

3131
# Optionally build your docs in additional formats such as PDF and ePub
32-
# formats:
33-
# - pdf
32+
formats:
33+
- pdf
3434
# - epub
3535

3636
# Optional but recommended, declare the Python requirements required

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,16 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
6868
* Melopero Cookie RP2040
6969
* Melopero Shake RP2040
7070
* METE HOCA Akana R1
71+
* MyMakers RP2040
7172
* Neko Systems BL2040 Mini
72-
* Olimex RP2040-Pico30
7373
* Newsan Archi
7474
* nullbits Bit-C PRO
75+
* Olimex RP2040-Pico30
7576
* Pimoroni PGA2040
7677
* Pimoroni Pico Plus 2
7778
* Pimoroni Pico Plus 2W
7879
* Pimoroni Plasma2040
80+
* Pimoroni Plasma2350
7981
* Pimoroni Tiny2040
8082
* Pimoroni Tiny2350
8183
* Pintronix PinMax
@@ -137,6 +139,8 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
137139
* printf (i.e. debug) output over USB serial
138140
* Transparent use of PSRAM globals and heap (RP2350 only)
139141
* ARM or RISC-V (Hazard3) support for the RP2350
142+
* Semihosted serial and file system access
143+
* GPROF profiling support
140144

141145
The RP2040 PIO state machines (SMs) are used to generate jitter-free:
142146
* Servos

boards.txt

+1,537-233
Large diffs are not rendered by default.

cores/rp2040/Arduino.h

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ extern const String emptyString;
126126
#endif
127127

128128
#include "SerialUART.h"
129+
#include "SerialSemi.h"
129130
#include "RP2040Support.h"
130131
#include "SerialPIO.h"
131132
#include "Bootsel.h"

cores/rp2040/AudioOutputBase.h

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Abstract class for audio output devices to allow easy swapping between output devices
2+
3+
#pragma once
4+
5+
#include <Print.h>
6+
7+
class AudioOutputBase : public Print {
8+
public:
9+
virtual ~AudioOutputBase() { }
10+
virtual bool setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample = 0) = 0;
11+
virtual bool setBitsPerSample(int bps) = 0;
12+
virtual bool setFrequency(int freq) = 0;
13+
virtual bool setStereo(bool stereo = true) = 0;
14+
virtual bool begin() = 0;
15+
virtual bool end() = 0;
16+
virtual bool getUnderflow() = 0;
17+
virtual void onTransmit(void(*)(void *), void *) = 0;
18+
// From Print
19+
virtual size_t write(const uint8_t *buffer, size_t size) = 0;
20+
virtual int availableForWrite() = 0;
21+
};

cores/rp2040/RP2040Support.cpp

+17-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#include <Arduino.h>
22+
#include <pico/runtime.h>
23+
2124
#ifdef PICO_RP2040
2225

23-
#include <Arduino.h>
2426
#include <hardware/structs/psm.h>
2527

2628
extern "C" void boot_double_tap_check();
@@ -35,3 +37,17 @@ void RP2040::enableDoubleResetBootloader() {
3537
}
3638

3739
#endif
40+
41+
#ifdef __PROFILE
42+
Stream *__profileFile;
43+
int __writeProfileCB(const void *data, int len) {
44+
return __profileFile->write((const char *)data, len);
45+
}
46+
47+
#ifdef __PROFILE
48+
extern "C" void runtime_init_setup_profiling();
49+
#define PICO_RUNTIME_INIT_PROFILING "11011" // Towards the end, after PSRAM
50+
PICO_RUNTIME_INIT_FUNC_RUNTIME(runtime_init_setup_profiling, PICO_RUNTIME_INIT_PROFILING);
51+
#endif
52+
53+
#endif

cores/rp2040/RP2040Support.h

+30-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#pragma once
22+
2123
#include <hardware/clocks.h>
2224
#include <hardware/irq.h>
2325
#include <hardware/pio.h>
@@ -45,6 +47,13 @@
4547

4648
extern "C" volatile bool __otherCoreIdled;
4749

50+
extern "C" {
51+
#ifdef __PROFILE
52+
typedef int (*profileWriteCB)(const void *data, int len);
53+
extern void _writeProfile(profileWriteCB writeCB);
54+
#endif
55+
}
56+
4857
class _MFIFO {
4958
public:
5059
_MFIFO() { /* noop */ };
@@ -180,7 +189,7 @@ class RP2040 {
180189

181190
void begin() {
182191
_epoch = 0;
183-
#if !defined(__riscv)
192+
#if !defined(__riscv) && !defined(__PROFILE)
184193
if (!__isFreeRTOS) {
185194
// Enable SYSTICK exception
186195
exception_set_exclusive_handler(SYSTICK_EXCEPTION, _SystickHandler);
@@ -193,7 +202,7 @@ class RP2040 {
193202
_ccountPgm->prepare(&_pio, &_sm, &off);
194203
ccount_program_init(_pio, _sm, off);
195204
pio_sm_set_enabled(_pio, _sm, true);
196-
#if !defined(__riscv)
205+
#if !defined(__riscv) && !defined(__PROFILE)
197206
}
198207
#endif
199208
}
@@ -217,7 +226,7 @@ class RP2040 {
217226
// Get CPU cycle count. Needs to do magic to extens 24b HW to something longer
218227
volatile uint64_t _epoch = 0;
219228
inline uint32_t getCycleCount() {
220-
#if !defined(__riscv)
229+
#if !defined(__riscv) && !defined(__PROFILE)
221230
if (!__isFreeRTOS) {
222231
uint32_t epoch;
223232
uint32_t ctr;
@@ -229,13 +238,13 @@ class RP2040 {
229238
} else {
230239
#endif
231240
return ccount_read(_pio, _sm);
232-
#if !defined(__riscv)
241+
#if !defined(__riscv) && !defined(__PROFILE)
233242
}
234243
#endif
235244
}
236245

237246
inline uint64_t getCycleCount64() {
238-
#if !defined(__riscv)
247+
#if !defined(__riscv) && !defined(__PROFILE)
239248
if (!__isFreeRTOS) {
240249
uint64_t epoch;
241250
uint64_t ctr;
@@ -247,7 +256,7 @@ class RP2040 {
247256
} else {
248257
#endif
249258
return ccount_read(_pio, _sm);
250-
#if !defined(__riscv)
259+
#if !defined(__riscv) && !defined(__PROFILE)
251260
}
252261
#endif
253262
}
@@ -473,6 +482,21 @@ class RP2040 {
473482
#endif
474483
}
475484

485+
#ifdef __PROFILE
486+
void writeProfiling(Stream *f) {
487+
extern Stream *__profileFile;
488+
extern int __writeProfileCB(const void *data, int len);
489+
__profileFile = f;
490+
_writeProfile(__writeProfileCB);
491+
}
492+
493+
size_t getProfileMemoryUsage() {
494+
extern int __profileMemSize;
495+
return (size_t) __profileMemSize;
496+
}
497+
#endif
498+
499+
476500

477501
private:
478502
static void _SystickHandler() {

cores/rp2040/RP2040Version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
22
#define ARDUINO_PICO_MAJOR 4
3-
#define ARDUINO_PICO_MINOR 3
3+
#define ARDUINO_PICO_MINOR 4
44
#define ARDUINO_PICO_REVISION 1
5-
#define ARDUINO_PICO_VERSION_STR "4.3.1"
5+
#define ARDUINO_PICO_VERSION_STR "4.4.1"

0 commit comments

Comments
 (0)