Compare commits

...
49 Commits
Author SHA1 Message Date
Earle F. Philhower, III 7eb176c0b4 Update version 2023-06-07 18:06:55 -07:00
hreintke 3f475ac68c CoreMutex add portYieldFromISR for FreeRTOS (#1484) 2023-06-07 06:59:10 -07:00
Earle F. Philhower, III 5204dab99b Fix CoreMutex FreeRTOS ISR logic (#1510) 2023-06-07 00:15:41 -07:00
Earle F. Philhower, III 273fb84dc5 Update to Adafruit TinyUSB 2.2.1 (#1511)
Fixes #1509
2023-06-07 00:05:12 -07:00
LinusHeu fe3af4d98b Update i2s.rst + typo (#1504) 2023-06-05 13:10:04 -07:00
Earle F. Philhower, III 9aade5bb24 Update adc.rst (#1502) 2023-06-05 02:15:09 -07:00
Earle F. Philhower, III 3c408dab7c AudioBufferManager(I2s, PWMAudio, ADCInput) clicking fix (#1500)
The ABM had an off-by-one error in the DMA buffer swapover.  Instead of
setting the DMA address to the newly added buffer in active[], it set it
to the buffer that was currently running.

This would effectively disable the ping-pong and cause clicks/lost data.

Fixes #1491
2023-06-04 18:40:29 -07:00
Earle F. Philhower, III 2888f4d03d I2S::available/availableForWrite() returns bytes (#1499)
Per the Arduino documentation, I2s::available should return bytes free,
not samples.  Adjust accordingly.
2023-06-04 16:38:12 -07:00
Earle F. Philhower, III f57b5bc762 Add I2S::getOverUnderflow() (#1497)
See #1491.  Thanks @LinusHeu
2023-06-04 14:21:02 -07:00
Earle F. Philhower, III 35a4d57360 Fix I2s::available/availableForWrite() (#1496)
Return the actual number of samples that can be read/written, not the
number of 32-bit values there is space for.
2023-06-04 14:10:53 -07:00
Earle F. Philhower, III 579e366bcf Fix serial reset hang under FreeRTOS (#1495)
The serial port reset logic was calling `sleep_ms()` which ended up doing
a task switch...while the other core was frozen and everything was supposed
to be locked.

Use `busy_wait_ms()` which is a tight loop to delay in the reset portion.

Fixes #1486
2023-06-04 13:28:11 -07:00
hreintke db4f79448d CoreMutex freeRTOS Mutex acquire properly (#1481)
Since FreeRTOS has real tasks and mutexes with support for priority bumping, actually always try and take a `CoreMutex` instead of seeing if someone else already has it and aborting immediately.

This fix helps ensure things like Serial output in a multi-task system won't get lost.
2023-06-04 13:12:30 -07:00
LinusHeu 45bbcca207 AudioBufferManager: Make dma_claim_unused_channel() not panic (#1487) 2023-05-30 15:51:07 -07:00
Dominic PearmanandDominic Pearman 8e961a5667 Added setup overload to pass name. (#1483)
Co-authored-by: Dominic Pearman <dominic@phymorous.de>
2023-05-27 10:40:24 -07:00
Ivan Kravets 64ad69c247 Temporary disable publishing to the PIO registry (#1476)
See RPI's CEO comment https://github.com/platformio/platform-raspberrypi/pull/36#issuecomment-1560504425
2023-05-26 10:24:28 -07:00
Jan 4def2f219c Implement the BD_ADDR(char * address_string) constructor. (#1440)
* Implement the BD_ADDR(char * address_string) constructor.

* Updating implementation to use sscanf.

There is an extra step after the sscanf that checks that we got
six bytes back and if we did not, it will set all bytes in the
address to zero.

* Example using BD_ADDR(const char * address_string)

This example shows how BD_ADDR(const char * address_string) can
be used to create BD_ADDR objects to use for comparisons etc.

* Update LEDeviceScanner.ino formatting
2023-05-25 06:54:24 -07:00
Earle F. Philhower, III b2b4b2d71d Update version 2023-05-23 17:57:38 -07:00
Earle F. Philhower, III e93bd14ef5 Generate warnings if Pico STDIO init called (#1467)
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
2023-05-23 17:28:57 -07:00
Earle F. Philhower, III 652f9f9eda Fix FreeRTOS CoreMutex shim to handle ISRs (#1442)
* Fix FreeRTOS CoreMutex shim to handle ISRs

Automatically check, when in FreeRTOS, if we're in an ISR and
if so call the correct mutex grab.

Thanks to @caveman99 for finding and proposing a solution!

Fixes #1441

* Fix the CoreMutex destructor, too
2023-05-23 10:12:52 -07:00
Earle F. Philhower, III cac9eb0cd7 BREAKING: Swap Wire1 and Wire in Adafruit Feather (#1468)
Fixes #1465

The Adafruit Feather came onboard before the Wire swapping was supported
in the core, so it's backwards from the real definition.  Now that swapping is
supported, fix it to match the rest of the boards.
2023-05-23 09:57:28 -07:00
LinusHeu 3b4fb295ea Fix I2S::write(const uint8_t *buffer, size_t size) (#1461)
According to this: https://github.com/earlephilhower/arduino-pico/discussions/1450
2023-05-20 11:33:50 -07:00
Jean-Luc Béchennec a1ae61b5b1 BT Serial connection docs for Mac (#1459) 2023-05-20 10:56:06 -07:00
355abd8c57 Add setInverted() options to SerialPIO (#1451)
Call `SerialPIO::setInverted(txinv, rxinv)` before `SerialPIO::begin()` to enable.

---------

Co-authored-by: Mykle Hansen <mykle@mykle.com>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2023-05-19 16:30:26 -07:00
Earle F. Philhower, III b57ac66815 Cleanup legacy includes (#1452) 2023-05-16 23:47:17 -07:00
Earle F. Philhower, III a851a928d2 Merge latest FreeRTOS/SMP upstream branch (#1449)
Update to head of upstream FreeRTOS/SMP branch.  Very minor changes.

Remove the custom getreent implementation, use the one that was defined
in the upstream FreeRTOS/smp branch (callback related vs. static vars).
2023-05-16 12:13:51 -07:00
Earle F. Philhower, III 16c2e8e454 Clean up FreeRTOS, remove core freeze hacks (#1448) 2023-05-15 19:52:38 -07:00
Earle F. Philhower, III ae908c8e9b Use real FreeRTOS tasks to idle core during flash (#1444)
Fixes #1439

Use a real FreeRTOS task, at the highest priority, to idle the other core
while doing flash accesses.

The USB stack seems to have some timing dependent bits which get broken
if FreeRTOS switches out the current task when it's running.  Avoid any
issue by disabling preemption on the core for all tud_task calls.

The PendSV handler disable flag can live completely inside the FreeRTOS
variant port, so remove any reference to it in the main core.

Tested using Multicode-FreeRTOS, #1402 and #1441

The USB FIFO interrupts were still being serviced even when the core was
frozen, leading to crashes.  Explicitly shut off IRQs on both the victim
and the initiator core when freezing.

Removed the need for hack __holdUpPendSV flag
2023-05-15 18:10:30 -07:00
Earle F. Philhower, III 723c81470a Update contrib.rst 2023-05-15 10:09:30 -07:00
Alessandro Ranellucci a7905fba3e Add Arduino CLI installation instructions (#1447) 2023-05-15 09:29:12 -07:00
Earle F. Philhower, III 6e52b72523 Update macro for detecting this core in contributing docs (#1436) 2023-05-11 09:45:34 -07:00
git2212 ef4ec4185a Add dummy Serial implementation when NO_USB defined (#1438)
Fixes #1434
2023-05-11 09:45:01 -07:00
Earle F. Philhower, III 3dee0a276b Update version 2023-05-05 09:00:07 -07:00
Maximilian Gerhardt e95248a787 Support and Document pico-debug in PlatformIO (#1427) 2023-05-05 07:32:41 -07:00
Earle F. Philhower, III 414ff23141 Remove circular dependency on WiFi/LWIP_Ethernet (#1415)
Fixes #1408

The wl_* types are required in multiple libraries which in turn seem
to have a circular dependency that Platform.IO has issues with in certain
modes.

Avoid the issue by moving the common headers into the core directories
so they will be accessible by all libs.

Move StackThunk to core directory, too
2023-05-04 19:54:24 -07:00
Paint Your Dragon 2c0ce6f416 Add Feathers: CAN and Prop-Maker (#1421) 2023-05-02 15:41:05 -07:00
Earle F. Philhower, III 89fe754a9f Fix USB Mouse/Joystick HID report ID (#1418)
Fixes #1410

The USB Keyboard now has 2 reports (keyboard + consumer control), so when both
Keyboard and Mouse libraries are included, the Mouse must be report 3, not 2.

Update the Mouse and Joystick report IDs appropriately.
2023-05-01 21:14:11 -07:00
Earle F. Philhower, III 01ee673dc2 Protect the HW random generation from FreeRTOS (#1395)
Fixes #1394

The Pico_Rand SDK calls gather bits from the HW ROSC at precise intervals.
If there is jitter in the sleep_until() call then the ROSC bit collection
will always think it's failed to acquire the right bit and retry infintitely.

Avoid by wrapping the HW random number calls and the sleep_until() routine.
Only when in FreeRTOS set a flag to silently make sleep_until() into a
busy wait loop while in a random number generation step.  When not in the
random code, do the normal sleep_until call.
2023-05-01 19:42:21 -07:00
Earle F. Philhower, III 5a949443a5 Fix USB crashes in FreeRTOS (#1419)
Fixes #1402

The global USB mutex is auto-shadowed with a FreeRTOS semaphore while in
FreeRTOS mode.  Unfortunately, while the core was using the proper
FreeRTOS semaphore to lock access to the USB port, the actual FreeRTOS
USB task was using the naked Pico SDK mutex, leading to cases where it
could acquire the mutex even though some other FreeRTOS task actually
owned the shadowed mutex.

Properly lock the shadowed Semaphore, not mutex_t, in the FreeRTOS
USB periodic task.
2023-05-01 19:34:46 -07:00
Maximilian Gerhardt a916695155 Add PICO_FLASH_SIZE_BYTES to PIO (#1416) 2023-05-01 11:48:28 -07:00
Earle F. Philhower, III 611547ee97 Add PICO_FLASH_SIZE_BYTES define (#1414)
Matches the flash size defined in the menus.

Fixes #1399
2023-05-01 11:02:01 -07:00
Earle F. Philhower, III ff9f228e1b FreeRTOS compilation fix when no LED present (#1413)
Fixes #1412
2023-05-01 10:46:23 -07:00
Earle F. Philhower, III f33dfd2313 Don't delete first cert, taken from ESP8266 repo (#1392)
See https://github.com/esp8266/Arduino/pull/8907
2023-04-22 15:34:59 -07:00
Earle F. Philhower, III 7ef00c8761 Update to Adafruit_TinyUSB 2.1.0 (#1387)
Fixes #1382
2023-04-21 10:20:14 -07:00
Maximilian Gerhardt 437d03583a Sync macros used in PlatformIO and platform.txt (#1386) 2023-04-21 09:57:50 -07:00
Wvirgil123 0322a6871c Add board Seeed Indicator RP2040 (#1375) 2023-04-21 09:48:38 -07:00
Maximilian Gerhardt 4f643d27d9 Enable BlackMagicProbe for PlatformIO (#1378) 2023-04-15 12:35:45 -07:00
Earle F. Philhower, III 3dcb4bbf8b Clear compile errors if BT needed but not on (#1371)
Fixes #1370

Adds a simple helper assertion to tell the user how to enable BT if it's
not enabled, instead of some odd compilation warnings about undefined
functions.
2023-04-12 08:21:24 -07:00
Paint Your Dragon 59981aed7f Rename USB HOST pins (#1367)
Change “N” to “M” and add “HOST” in the USB pins. Only two pins are actually affected; diff appears large to maintain the pleasant aligned-columns format.
2023-04-10 10:53:28 -07:00
Earle F. Philhower, III 07781e9cf5 Rename BTstack lib to BTstackLib (#1360)
Fixes #1356

Mac and Windows have case-insensitive filesystems, so the will find
the internal (all-lowercase) "btstack.h" and not the library's "BTstack.h",
causing compilation errors.

Rename the library and header to avoid the issue.
2023-04-06 17:09:07 -07:00
132 changed files with 2490 additions and 309 deletions
+12 -12
View File
@@ -19,18 +19,18 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
python-version: '3.x'
# - name: Cache PlatformIO
# uses: actions/cache@v3
# with:
# path: ~/.platformio
# key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
# - name: Install PlatformIO
# run: |
# python -m pip install --upgrade pip
# pip install --upgrade platformio
- name: Deploy updated JSON
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -43,5 +43,5 @@ jobs:
curl -L -o package_rp2040_index.json "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/$TAG/package_rp2040_index.json"
./package/update_release.py --token ${CI_GITHUB_API_KEY} --repo "$GITHUB_REPOSITORY" --tag global package_rp2040_index.json
# Upload to Platform.IO
curl -LO $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/$TAG/rp2040-$TAG.zip
pio package publish rp2040-$TAG.zip --non-interactive
# curl -LO $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/$TAG/rp2040-$TAG.zip
# pio package publish rp2040-$TAG.zip --non-interactive
+1
View File
@@ -47,6 +47,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* Neko Systems BL2040 Mini
* nullbits Bit-C PRO
* Pimoroni PGA2040
* Seeed Indicator RP2040
* Seeed XIAO RP2040
* Solder Party RP2040 Stamp
* SparkFun ProMicro RP2040
+1316
View File
File diff suppressed because it is too large Load Diff
+12 -1
View File
@@ -28,7 +28,7 @@
#include "api/ArduinoAPI.h"
#include "api/itoa.h" // ARM toolchain doesn't provide itoa etc, provide them
#include <pins_arduino.h>
#include "hardware/gpio.h" // Required for the port*Register macros
#include <hardware/gpio.h> // Required for the port*Register macros
#include "debug_internal.h"
#include <RP2040.h> // CMSIS
@@ -129,3 +129,14 @@ constexpr uint32_t __bitset(const int (&a)[N], size_t i = 0U) {
return i < N ? (1L << a[i]) | __bitset(a, i + 1) : 0;
}
#endif
// Warn users trying to use Pico SDK's STDIO implementation
#include <pico/stdio.h> // Ensure it won't be re-included elsewhere
#undef stdio_uart_init
#define stdio_uart_init(...) static_assert(0, "stdio_uart_init is not supported or needed. Either use Serial.printf() or set the debug port in the IDE to Serial/1/2 and use printf(). See https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1540354673 and https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1546783109")
#undef stdio_init_all
#define stdio_init_all(...) static_assert(0, "stdio_init_all is not supported or needed. Either use Serial.printf() or set the debug port in the IDE to Serial/1/2 and use printf(). See https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1540354673 and https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1546783109")
#undef stdio_usb_init
#define stdio_usb_init(...) static_assert(0, "stdio_usb_init is not supported or needed. Either use Serial.printf() or set the debug port in the IDE to Serial/1/2 and use printf(). See https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1540354673 and https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1546783109")
+5 -5
View File
@@ -4,11 +4,11 @@
SPDX-License-Identifier: BSD-3-Clause
*/
#include <Arduino.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
#include "hardware/sync.h"
#include "hardware/structs/ioqspi.h"
#include "hardware/structs/sio.h"
#include <pico/stdlib.h>
#include <hardware/gpio.h>
#include <hardware/sync.h>
#include <hardware/structs/ioqspi.h>
#include <hardware/structs/sio.h>
// This example blinks the Pico LED when the BOOTSEL button is pressed.
//
+10 -4
View File
@@ -28,11 +28,17 @@ CoreMutex::CoreMutex(mutex_t *mutex, uint8_t option) {
_mutex = mutex;
_acquired = false;
_option = option;
_pxHigherPriorityTaskWoken = 0; // pdFALSE
if (__isFreeRTOS) {
auto m = __get_freertos_mutex_for_ptr(mutex);
if (_option & FromISR) {
__freertos_mutex_take_from_isr(m);
if (__freertos_check_if_in_isr()) {
if (!__freertos_mutex_take_from_isr(m, &_pxHigherPriorityTaskWoken)) {
return;
}
// At this point we have the mutex in ISR
} else {
// Grab the mutex normally, possibly waking other tasks to get it
__freertos_mutex_take(m);
}
} else {
@@ -54,8 +60,8 @@ CoreMutex::~CoreMutex() {
if (_acquired) {
if (__isFreeRTOS) {
auto m = __get_freertos_mutex_for_ptr(_mutex);
if (_option & FromISR) {
__freertos_mutex_give_from_isr(m);
if (__freertos_check_if_in_isr()) {
__freertos_mutex_give_from_isr(m, &_pxHigherPriorityTaskWoken);
} else {
__freertos_mutex_give(m);
}
+3 -3
View File
@@ -23,12 +23,11 @@
#pragma once
#include "pico/mutex.h"
#include <pico/mutex.h>
#include "_freertos.h"
enum {
DebugEnable = 1,
FromISR = 1 << 1,
DebugEnable = 1
};
class CoreMutex {
@@ -44,4 +43,5 @@ private:
mutex_t *_mutex;
bool _acquired;
uint8_t _option;
BaseType_t _pxHigherPriorityTaskWoken;
};
+7 -10
View File
@@ -91,15 +91,14 @@ public:
if (!_multicore) {
return;
}
__holdUpPendSV = 1;
if (__isFreeRTOS) {
vTaskPreemptionDisable(nullptr);
vTaskSuspendAll();
__freertos_idle_other_core();
} else {
mutex_enter_blocking(&_idleMutex);
__otherCoreIdled = false;
multicore_fifo_push_blocking(_GOTOSLEEP);
while (!__otherCoreIdled) { /* noop */ }
}
mutex_enter_blocking(&_idleMutex);
__otherCoreIdled = false;
multicore_fifo_push_blocking(_GOTOSLEEP);
while (!__otherCoreIdled) { /* noop */ }
}
void resumeOtherCore() {
@@ -109,10 +108,8 @@ public:
mutex_exit(&_idleMutex);
__otherCoreIdled = false;
if (__isFreeRTOS) {
xTaskResumeAll();
vTaskPreemptionEnable(nullptr);
__freertos_resume_other_core();
}
__holdUpPendSV = 0;
// Other core will exit busy-loop and return to operation
// once __otherCoreIdled == false.
+65 -13
View File
@@ -25,17 +25,16 @@
#include "CoreMutex.h"
#include "RP2040USB.h"
#include "tusb.h"
#include "class/hid/hid_device.h"
#include "class/audio/audio.h"
#include "class/midi/midi.h"
#include "pico/time.h"
#include "hardware/irq.h"
#include "pico/mutex.h"
#include "pico/unique_id.h"
#include "pico/usb_reset_interface.h"
#include "hardware/watchdog.h"
#include "pico/bootrom.h"
#include <tusb.h>
#include <class/hid/hid_device.h>
#include <class/audio/audio.h>
#include <pico/time.h>
#include <hardware/irq.h>
#include <pico/mutex.h>
#include <pico/unique_id.h>
#include <pico/usb_reset_interface.h>
#include <hardware/watchdog.h>
#include <pico/bootrom.h>
#include "sdkoverride/tusb_absmouse.h"
#include <device/usbd_pvt.h>
@@ -130,13 +129,13 @@ int __USBGetKeyboardReportID() {
}
int __USBGetMouseReportID() {
return __USBInstallKeyboard ? 2 : 1;
return __USBInstallKeyboard ? 3 : 1;
}
int __USBGetJoystickReportID() {
int i = 1;
if (__USBInstallKeyboard) {
i++;
i += 2;
}
if (__USBInstallMouse || __USBInstallAbsoluteMouse) {
i++;
@@ -550,6 +549,59 @@ usbd_class_driver_t const *usbd_app_driver_get_cb(uint8_t *driver_count) {
*driver_count = 1;
return &_resetd_driver;
}
#elif defined NO_USB
// will ensure backward compatibility with existing code when using pico-debug
#warning "NO_USB selected. No output to Serial will occur!"
#include <Arduino.h>
void SerialUSB::begin(unsigned long baud) {
}
void SerialUSB::end() {
}
int SerialUSB::peek() {
return 0;
}
int SerialUSB::read() {
return -1;
}
int SerialUSB::available() {
return 0;
}
int SerialUSB::availableForWrite() {
return 0;
}
void SerialUSB::flush() {
}
size_t SerialUSB::write(uint8_t c) {
(void) c;
return 0;
}
size_t SerialUSB::write(const uint8_t *buf, size_t length) {
(void) buf;
(void) length;
return 0;
}
SerialUSB::operator bool() {
return false;
}
SerialUSB Serial;
#endif
+1 -1
View File
@@ -19,7 +19,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "pico/mutex.h"
#include <pico/mutex.h>
// Weak function definitions for each type of endpoint
extern void __USBInstallSerial() __attribute__((weak));
+3 -3
View File
@@ -1,5 +1,5 @@
#pragma once
#define ARDUINO_PICO_MAJOR 3
#define ARDUINO_PICO_MINOR 1
#define ARDUINO_PICO_REVISION 1
#define ARDUINO_PICO_VERSION_STR "3.1.1"
#define ARDUINO_PICO_MINOR 2
#define ARDUINO_PICO_REVISION 2
#define ARDUINO_PICO_VERSION_STR "3.2.2"
+21 -14
View File
@@ -46,22 +46,24 @@ static pio_program_t *pio_make_uart_prog(int repl, const pio_program_t *pg) {
return p;
}
static PIOProgram *_getTxProgram(int bits) {
auto f = _txMap.find(bits);
static PIOProgram *_getTxProgram(int bits, bool inverted) {
int key = inverted ? -bits : bits;
auto f = _txMap.find(key);
if (f == _txMap.end()) {
pio_program_t * p = pio_make_uart_prog(bits, &pio_tx_program);
_txMap.insert({bits, new PIOProgram(p)});
f = _txMap.find(bits);
pio_program_t * p = pio_make_uart_prog(bits, inverted ? &pio_tx_inv_program : &pio_tx_program);
_txMap.insert({key, new PIOProgram(p)});
f = _txMap.find(key);
}
return f->second;
}
static PIOProgram *_getRxProgram(int bits) {
auto f = _rxMap.find(bits);
static PIOProgram *_getRxProgram(int bits, bool inverted) {
int key = inverted ? -bits : bits;
auto f = _rxMap.find(key);
if (f == _rxMap.end()) {
pio_program_t * p = pio_make_uart_prog(bits, &pio_rx_program);
_rxMap.insert({bits, new PIOProgram(p)});
f = _rxMap.find(bits);
pio_program_t * p = pio_make_uart_prog(bits, inverted ? &pio_rx_inv_program : &pio_rx_program);
_rxMap.insert({key, new PIOProgram(p)});
f = _rxMap.find(key);
}
return f->second;
}
@@ -96,7 +98,7 @@ void __not_in_flash_func(SerialPIO::_handleIRQ)() {
return;
}
while (!pio_sm_is_rx_fifo_empty(_rxPIO, _rxSM)) {
uint32_t decode = _rxPIO->rxf[_rxSM];
uint32_t decode = _rxPIO->rxf[_rxSM] ^ (_rxInverted ? 0xffffffff : 0);
decode >>= 33 - _rxBits;
uint32_t val = 0;
for (int b = 0; b < _bits + 1; b++) {
@@ -189,7 +191,7 @@ void SerialPIO::begin(unsigned long baud, uint16_t config) {
if (_tx != NOPIN) {
_txBits = _bits + _stop + (_parity != UART_PARITY_NONE ? 1 : 0) + 1/*start bit*/;
_txPgm = _getTxProgram(_txBits);
_txPgm = _getTxProgram(_txBits, _txInverted);
int off;
if (!_txPgm->prepare(&_txPIO, &_txSM, &off)) {
DEBUGCORE("ERROR: Unable to allocate PIO TX UART, out of PIO resources\n");
@@ -216,7 +218,7 @@ void SerialPIO::begin(unsigned long baud, uint16_t config) {
_reader = 0;
_rxBits = 2 * (_bits + _stop + (_parity != UART_PARITY_NONE ? 1 : 0) + 1) - 1;
_rxPgm = _getRxProgram(_rxBits);
_rxPgm = _getRxProgram(_rxBits, _rxInverted);
int off;
if (!_rxPgm->prepare(&_rxPIO, &_rxSM, &off)) {
DEBUGCORE("ERROR: Unable to allocate PIO RX UART, out of PIO resources\n");
@@ -346,6 +348,11 @@ void SerialPIO::flush() {
delay((1000 * (_txBits + 1)) / _baud);
}
void SerialPIO::setInverted(bool invTx, bool invRx) {
_txInverted = invTx;
_rxInverted = invRx;
}
size_t SerialPIO::write(uint8_t c) {
CoreMutex m(&_mutex);
if (!_running || !m || (_tx == NOPIN)) {
@@ -364,7 +371,7 @@ size_t SerialPIO::write(uint8_t c) {
}
val <<= 1; // Start bit = low
pio_sm_put_blocking(_txPIO, _txSM, val);
pio_sm_put_blocking(_txPIO, _txSM, _txInverted ? ~val : val);
return 1;
}
+4
View File
@@ -41,6 +41,8 @@ public:
void begin(unsigned long baud, uint16_t config) override;
void end() override;
void setInverted(bool invTx = true, bool invRx = true);
virtual int peek() override;
virtual int read() override;
virtual int available() override;
@@ -63,6 +65,8 @@ protected:
int _stop;
bool _overflow;
mutex_t _mutex;
bool _txInverted = false;
bool _rxInverted = false;
PIOProgram *_txPgm;
PIO _txPIO;
+13 -12
View File
@@ -25,15 +25,15 @@
#include <Arduino.h>
#include "CoreMutex.h"
#include "tusb.h"
#include "pico/time.h"
#include "pico/binary_info.h"
#include "pico/bootrom.h"
#include "hardware/irq.h"
#include "pico/mutex.h"
#include "hardware/watchdog.h"
#include "pico/unique_id.h"
#include "hardware/resets.h"
#include <tusb.h>
#include <pico/time.h>
#include <pico/binary_info.h>
#include <pico/bootrom.h>
#include <hardware/irq.h>
#include <pico/mutex.h>
#include <hardware/watchdog.h>
#include <pico/unique_id.h>
#include <hardware/resets.h>
#ifndef DISABLE_USB_SERIAL
// Ensure we are installed in the USB chain
@@ -177,8 +177,10 @@ static bool _rts = false;
static int _bps = 115200;
static bool _rebooting = false;
static void CheckSerialReset() {
__holdUpPendSV = 1; // Ensure we don't get swapped out by FreeRTOS
if (!_rebooting && (_bps == 1200) && (!_dtr)) {
if (__isFreeRTOS) {
__freertos_idle_other_core();
}
_rebooting = true;
// Disable NVIC IRQ, so that we don't get bothered anymore
irq_set_enabled(USBCTRL_IRQ, false);
@@ -186,11 +188,10 @@ static void CheckSerialReset() {
reset_block(RESETS_RESET_USBCTRL_BITS);
unreset_block(RESETS_RESET_USBCTRL_BITS);
// Delay a bit, so the PC can figure out that we have disconnected.
sleep_ms(3);
busy_wait_ms(3);
reset_usb_boot(0, 0);
while (1); // WDT will fire here
}
__holdUpPendSV = 0;
}
extern "C" void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
+2 -2
View File
@@ -16,8 +16,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "stdlib.h"
#include "stdint.h"
#include <stdlib.h>
#include <stdint.h>
void randomSeed(uint32_t dwSeed) {
if (dwSeed != 0) {
+44 -1
View File
@@ -19,8 +19,9 @@
*/
#include "_freertos.h"
#include "pico/mutex.h"
#include <pico/mutex.h>
#include <stdlib.h>
#include "Arduino.h"
typedef struct {
mutex_t *src;
@@ -59,3 +60,45 @@ SemaphoreHandle_t __get_freertos_mutex_for_ptr(mutex_t *m, bool recursive) {
}
return nullptr; // Need to make space for more mutex maps!
}
// The HW Random code needs a precise sleep_until() in order to assure it
// grabs the ROSC bit when it wants. Unfortunately, under FreeRTOS the
// sleep_until() becomes imprecise and the "did I get the bit when I wanted"
// check in the pico_rand code always fails and you get an infinite loop.
// This block wraps the 2 get_rand calls to set a flag to convert
// sleep_until() (which can do a task swap and cause bad timing) into a
// busy wait.
extern "C" {
static bool __inRand = false;
extern uint64_t __real_get_rand_64();
uint64_t __wrap_get_rand_64() {
if (__isFreeRTOS) {
rp2040.idleOtherCore();
__inRand = true;
auto r = __real_get_rand_64();
__inRand = false;
rp2040.resumeOtherCore();
return r;
} else {
return __real_get_rand_64();
}
}
uint32_t __wrap_get_rand_32() {
return (uint32_t) __wrap_get_rand_64();
}
extern void __real_sleep_until(absolute_time_t t);
void __wrap_sleep_until(absolute_time_t t) {
if (__inRand) {
busy_wait_until(t);
} else {
__real_sleep_until(t);
}
}
}
+9 -15
View File
@@ -19,7 +19,7 @@
*/
#pragma once
#include "pico/mutex.h"
#include <pico/mutex.h>
// Cannot include refs to FreeRTOS's actual semaphore calls because they
// are implemented as macros, so we have a wrapper in our variant hook
@@ -35,32 +35,26 @@ extern "C" {
struct QueueDefinition; /* Using old naming convention so as not to break kernel aware debuggers. */
typedef struct QueueDefinition * QueueHandle_t;
typedef QueueHandle_t SemaphoreHandle_t;
typedef int32_t BaseType_t;
#endif
extern bool __freertos_check_if_in_isr() __attribute__((weak));
extern SemaphoreHandle_t __freertos_mutex_create() __attribute__((weak));
extern SemaphoreHandle_t _freertos_recursive_mutex_create() __attribute__((weak));
extern void __freertos_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
extern void __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx) __attribute__((weak));
extern int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
extern int __freertos_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
extern void __freertos_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx) __attribute__((weak));
extern void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) __attribute__((weak));
extern void __freertos_recursive_mutex_take(SemaphoreHandle_t mtx) __attribute__((weak));
extern int __freertos_recursive_mutex_try_take(SemaphoreHandle_t mtx) __attribute__((weak));
extern void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) __attribute__((weak));
#ifndef INC_FREERTOS_H
extern void vTaskSuspendAll() __attribute__((weak));
extern int32_t xTaskResumeAll() __attribute__((weak));
typedef struct tskTaskControlBlock * TaskHandle_t;
extern void vTaskPreemptionDisable(TaskHandle_t p) __attribute__((weak));
extern void vTaskPreemptionEnable(TaskHandle_t p) __attribute__((weak));
#endif
extern void __freertos_idle_other_core() __attribute__((weak));
extern void __freertos_resume_other_core() __attribute__((weak));
}
extern SemaphoreHandle_t __get_freertos_mutex_for_ptr(mutex_t *m, bool recursive = false);
// Halt the FreeRTOS PendSV task switching magic
extern "C" int __holdUpPendSV;
+7
View File
@@ -0,0 +1,7 @@
// Simple helper header to ensure pico libs support ?BT
#ifndef ENABLE_CLASSIC
#define ENABLE_CLASSIC 0
#endif
static_assert(ENABLE_CLASSIC, "This library needs Bluetooth enabled. Use the 'Tools->IP/Bluetooth Stack' menu in the IDE to enable it.");
+4 -4
View File
@@ -19,12 +19,12 @@
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
#include "lwip/netif.h"
#include <lwip/netif.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
+1 -1
View File
@@ -1,7 +1,7 @@
/*
LWIP wrappers to protect against timer-based re-entrancy
Copyright (c) 202s Earle F. Philhower, III <earlephilhower@yahoo.com>
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
+1 -1
View File
@@ -27,7 +27,6 @@
RP2040 rp2040;
extern "C" {
volatile bool __otherCoreIdled = false;
int __holdUpPendSV = 0;
};
mutex_t _pioMutex;
@@ -163,6 +162,7 @@ extern "C" void __register_impure_ptr(struct _reent *p) {
}
}
extern "C" struct _reent *__wrap___getreent() __attribute__((weak));
extern "C" struct _reent *__wrap___getreent() {
if (get_core_num() == 0) {
return _impure_ptr;
+43 -2
View File
@@ -29,7 +29,7 @@
; We shift out the start and stop bit as part of the FIFO
set x, 9
pull side 1 ; Force stop bit
pull side 1 ; Force stop bit high
; Send the bits
bitloop:
@@ -41,6 +41,26 @@ wait_bit:
; inverted-logic version (inverts the stop bit)
.program pio_tx_inv
.side_set 1 opt
; We shift out the start and stop bit as part of the FIFO
set x, 9
pull side 0 ; Force stop bit low
; Send the bits
bitloop:
out pins, 1
mov y, isr ; ISR is loaded by the setup routine with the period-1 count
wait_bit:
jmp y-- wait_bit
jmp x-- bitloop
% c-sdk {
static inline void pio_tx_program_init(PIO pio, uint sm, uint offset, uint pin_tx) {
@@ -68,7 +88,7 @@ static inline void pio_tx_program_init(PIO pio, uint sm, uint offset, uint pin_t
}
%}
.program pio_rx
@@ -91,6 +111,27 @@ wait_half:
push ; Stuff it and wait for next start
.program pio_rx_inv
; IN pin 0 and JMP pin are both mapped to the GPIO used as UART RX.
start:
set x, 18 ; Preload bit counter...we'll shift in the start bit and stop bit, and each bit will be double-recorded (to be fixed by RP2040 code)
wait 1 pin 0 ; Stall until start bit is asserted
bitloop:
; Delay until 1/2 way into the bit time
mov y, osr
wait_half:
jmp y-- wait_half
; Read in the bit
in pins, 1 ; Shift data bit into ISR
jmp x-- bitloop ; Loop all bits
push ; Stuff it and wait for next start
% c-sdk {
static inline void pio_rx_program_init(PIO pio, uint sm, uint offset, uint pin) {
pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, false);
+68
View File
@@ -2,6 +2,8 @@
// This file is autogenerated by pioasm; do not edit! //
// -------------------------------------------------- //
#pragma once
#if !PICO_NO_HARDWARE
#include "hardware/pio.h"
#endif
@@ -37,6 +39,39 @@ static inline pio_sm_config pio_tx_program_get_default_config(uint offset) {
sm_config_set_sideset(&c, 2, true, false);
return c;
}
#endif
// ---------- //
// pio_tx_inv //
// ---------- //
#define pio_tx_inv_wrap_target 0
#define pio_tx_inv_wrap 5
static const uint16_t pio_tx_inv_program_instructions[] = {
// .wrap_target
0xe029, // 0: set x, 9
0x90a0, // 1: pull block side 0
0x6001, // 2: out pins, 1
0xa046, // 3: mov y, isr
0x0084, // 4: jmp y--, 4
0x0042, // 5: jmp x--, 2
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program pio_tx_inv_program = {
.instructions = pio_tx_inv_program_instructions,
.length = 6,
.origin = -1,
};
static inline pio_sm_config pio_tx_inv_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + pio_tx_inv_wrap_target, offset + pio_tx_inv_wrap);
sm_config_set_sideset(&c, 2, true, false);
return c;
}
static inline void pio_tx_program_init(PIO pio, uint sm, uint offset, uint pin_tx) {
// Tell PIO to initially drive output-high on the selected pin, then map PIO
@@ -90,6 +125,39 @@ static inline pio_sm_config pio_rx_program_get_default_config(uint offset) {
sm_config_set_wrap(&c, offset + pio_rx_wrap_target, offset + pio_rx_wrap);
return c;
}
#endif
// ---------- //
// pio_rx_inv //
// ---------- //
#define pio_rx_inv_wrap_target 0
#define pio_rx_inv_wrap 6
static const uint16_t pio_rx_inv_program_instructions[] = {
// .wrap_target
0xe032, // 0: set x, 18
0x20a0, // 1: wait 1 pin, 0
0xa047, // 2: mov y, osr
0x0083, // 3: jmp y--, 3
0x4001, // 4: in pins, 1
0x0042, // 5: jmp x--, 2
0x8020, // 6: push block
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program pio_rx_inv_program = {
.instructions = pio_rx_inv_program_instructions,
.length = 7,
.origin = -1,
};
static inline pio_sm_config pio_rx_inv_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + pio_rx_inv_wrap_target, offset + pio_rx_inv_wrap);
return c;
}
static inline void pio_rx_program_init(PIO pio, uint sm, uint offset, uint pin) {
pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, false);
+1 -1
View File
@@ -77,7 +77,7 @@ static std::map<pin_size_t, CBInfo> _map;
void _gpioInterruptDispatcher(uint gpio, uint32_t events) {
(void) events;
// Only need to lock around the std::map check, not the whole IRQ callback
CoreMutex m(&_irqMutex, (FromISR | DebugEnable));
CoreMutex m(&_irqMutex);
if (m) {
auto irq = _map.find(gpio);
if (irq != _map.end()) {
+2 -2
View File
@@ -12,7 +12,7 @@ need to be periodically sampled to be read by applications, easily, such as:
* Light dependent resistors (LDR), etc.
Up to 4 analog samples can be recorded by the hardware (``A0`` ... ``A4``), and all
Up to 4 analog samples can be recorded by the hardware (``A0`` ... ``A3``), and all
recording is done at 16-bit levels (but be aware that the ADC in the Pico will only
ever return values between 0...4095).
@@ -29,7 +29,7 @@ ADC Input API
ADCInput(pin0 [, pin1, pin2, pin3])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creates an ADC input object which will record the pins specified in the code.
Only pins ``A0`` ... ``A4`` can be used, and they must be specified in increasing
Only pins ``A0`` ... ``A3`` can be used, and they must be specified in increasing
order (i.e. ``ADCInput(A0, A1);`` is valid, but ``ADCInput(A1, A0)`` is not.
bool setBuffers(size_t buffers, size_t bufferWords)
+2 -2
View File
@@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
# built documents.
#
# The short X.Y version.
version = u'3.1.1'
version = u'3.2.2'
# The full version, including alpha/beta/rc tags.
release = u'3.1.1'
release = u'3.2.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+3 -2
View File
@@ -10,7 +10,8 @@ Contributing to the Core (Pull Requests)
----------------------------------------
We use the standard GitHub Pull Request model. If you're unfamiliar with it,
this `guide <https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/>` gives a simple overview of the process.
this `guide <https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/>`__
gives a simple overview of the process.
All pull requests have to pass a set of Continuous Integration (CI) checks
which help make sure the code compiles under different configurations and has
@@ -84,7 +85,7 @@ code that only runs on this core, use the following define.
.. code:: cpp
#if defined(ARDUINO_ARCH_RP2040)
#if defined(ARDUINO_ARCH_RP2040) && !defined(__MBED__)
~~~ your changes ~~~
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
HTTPClient Library
==================
A simple HTTP requestor that can handle both HTTP and HTTP requests is
A simple HTTP requestor 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,
+6 -1
View File
@@ -84,6 +84,11 @@ void flush()
~~~~~~~~~~~~
Waits until all the I2S buffers have been output.
void getOverUnderflow()
~~~~~~~~~~~~~~~~~~~~~~~
Returns a flag indicating if the I2S system ran our of data to send on output,
or had to throw away data on input.
size_t write(uint8_t/int8_t/int16_t/int32_t)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Writes a single sample of ``bitsPerSample`` to the buffer. It is up to the
@@ -112,7 +117,7 @@ many bytes were actually written.
int availableForWrite()
~~~~~~~~~~~~~~~~~~~~~~~
Returns the number of L/R samples that can be written without
Returns the amount of bytes that can be written without
potentially blocking.
int read()
+16
View File
@@ -38,6 +38,22 @@ prevent the Arduino IDE from accessing. For Arduino IDE V2, override the filesys
restriction using ``flatpak override --user --filesystem=host cc.arduino.IDE2`` . For
For Arduino IDE < V2, use ``flatpak override --user --filesystem=host cc.arduino.arduinoide``.
Installing via Arduino CLI
--------------------------
To install using the Arduino command line tool (arduino-cli):
.. code:: bash
arduino-cli config add board_manager.additional_urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
arduino-cli core update-index
arduino-cli core install rp2040:rp2040
To list the supported boards:
.. code:: bash
arduino-cli board listall | grep rp2040
Installing via GIT
------------------
To install via GIT (for latest and greatest versions):
+34 -1
View File
@@ -341,10 +341,15 @@ To specify the debugging adapter, use ``debug_tool`` (`documentation <https://do
* ``cmsis-dap``
* ``jlink``
* ``raspberrypi-swd``
* ``blackmagic``
* ``pico-debug``
These values can also be used in ``upload_protocol`` if you want PlatformIO to upload the regular firmware through this method, which you likely want.
Especially the PicoProbe method is convenient when you have two Raspberry Pi Pico boards. One of them can be flashed with the PicoProbe firmware (`documentation <https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico>`_) and is then connected to the target Raspberry Pi Pico board (see `documentation <https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf>`_ chapter "Picoprobe Wiring"). Remember that on Windows, you have to use `Zadig <https://zadig.akeo.ie/>`_ to also load "WinUSB" drivers for the "Picoprobe (Interface 2)" device so that OpenOCD can speak to it.
Especially the PicoProbe method is convenient when you have two Raspberry Pi Pico boards. One of them can be flashed with the PicoProbe firmware (`documentation <https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico>`__) and is then connected to the target Raspberry Pi Pico board (see `documentation <https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf>`__ chapter "Picoprobe Wiring"). Remember that on Windows, you have to use `Zadig <https://zadig.akeo.ie/>`_ to also load "WinUSB" drivers for the "Picoprobe (Interface 2)" device so that OpenOCD can speak to it.
.. note::
Newer PicoProbe firmware versions have dropped the proprietary "PicoProbe" USB communication protocol and emulate a **CMSIS-DAP** instead. Meaning, you have to use ``debug_tool = cmsis-dap`` for these newer firmwares, such as those obtained from `raspberrypi/picoprobe <https://github.com/raspberrypi/picoprobe/releases>`__
With that set up, debugging can be started via the left debugging sidebar and works nicely: Setup breakpoints, inspect the value of variables in the code, step through the code line by line. When a breakpoint is hit or execution is halted, you can even see the execution state both Cortex-M0+ cores of the RP2040.
@@ -352,6 +357,30 @@ With that set up, debugging can be started via the left debugging sidebar and wo
For further information on customizing debug options, like the initial breakpoint or debugging / SWD speed, consult `the documentation <https://docs.platformio.org/en/latest/projectconf/section_env_debug.html>`_.
.. note::
For the BlackMagicProbe debugging probe (as can be e.g., created by simply flashing a STM32F103C8 "Bluepill" board), you currently have to use the branch ``fix/rp2040-flash-reliability`` (or at least commit ``1d001bc``) **and** use the `official ARM provided toolchain <https://github.com/blackmagic-debug/blackmagic/issues/1364#issuecomment-1503393266>`_.
You can obtain precompiled binaries from `here <https://github.com/blackmagic-debug/blackmagic/issues/1364#issuecomment-1503372723>`__. A flashing guide is available `here <https://primalcortex.wordpress.com/2017/06/13/building-a-black-magic-debug-probe/>`__. You then have to configure the target serial port ("GDB port") in your project per `documentation <https://docs.platformio.org/en/latest/plus/debug-tools/blackmagic.html#debugging-tool-blackmagic>`__.
.. note::
For the pico-debug (`download <https://github.com/majbthrd/pico-debug/releases>`__) debugging way, *which needs to no additional debug probe*, add this snippet to your ``platformio.ini`` and follow the given procedure:
.. code:: ini
upload_protocol = pico-debug
debug_tool = pico-debug
build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB
1. Build your firmware normally
2. Plug in the Pico in BOOTSEL mode
3. Drag and drop your ``.pio/build/<env>/firmware.uf2`` onto the boot drive
4. Unplug and replug your Pico back into BOOTSEL mode for the second time
5. Drag and drop the downloaded ``pico-debug-gimmecache.uf2`` file onto the boot drive
6. A CMSIS-DAP device should now appear on your computer
7. Start debugging via the debug sidebar as normal
Note the restrictions: The second core cannot be used, the USB port cannot be used (no USB serial, only UART serial), 16KB less RAM is available.
Filesystem Uploading
--------------------
@@ -366,3 +395,7 @@ The files you want to upload should be placed in a folder called ``data`` inside
The task "Build Filesystem Image" will take all files in the data directory and create a ``littlefs.bin`` file from it using the ``mklittlefs`` tool.
The task "Upload Filesystem Image" will upload the filesystem image to the Pico via the specified ``upload_protocol``.
.. note::
Set the space available for the filesystem in the ``platformio.ini`` using e.g., ``board_build.filesystem_size = 0.5m``, or filesystem
creation will fail!
+4
View File
@@ -207,3 +207,7 @@
-Wl,--wrap=cyw43_tcpip_link_status
-Wl,--wrap=cyw43_cb_tcpip_init
-Wl,--wrap=cyw43_cb_tcpip_deinit
-Wl,--wrap=get_rand_64
-Wl,--wrap=get_rand_32
-Wl,--wrap=sleep_until
@@ -114,7 +114,7 @@ bool AudioBufferManager::begin(int dreq, volatile void *pioFIFOAddr) {
// Get ping and pong DMA channels
for (auto i = 0; i < 2; i++) {
_channelDMA[i] = dma_claim_unused_channel(true);
_channelDMA[i] = dma_claim_unused_channel(false);
if (_channelDMA[i] == -1) {
if (i == 1) {
dma_channel_unclaim(_channelDMA[0]);
@@ -257,7 +257,7 @@ void __not_in_flash_func(AudioBufferManager::_dmaIRQ)(int channel) {
_active[1] = _takeFromList(&_filled);
}
_overunderflow = _overunderflow | (_active[1] == _silence);
dma_channel_set_read_addr(channel, _active[0]->buff, false);
dma_channel_set_read_addr(channel, _active[1]->buff, false);
} else {
if (_empty) {
_addToList(&_filled, _active[0]);
@@ -266,7 +266,7 @@ void __not_in_flash_func(AudioBufferManager::_dmaIRQ)(int channel) {
} else {
_overunderflow = true;
}
dma_channel_set_write_addr(channel, _active[0]->buff, false);
dma_channel_set_write_addr(channel, _active[1]->buff, false);
}
dma_channel_set_trans_count(channel, _wordsPerBuffer * (_dmaSize == DMA_SIZE_16 ? 2 : 1), false);
dma_channel_acknowledge_irq0(channel);
@@ -1,4 +1,4 @@
#include <BTstack.h>
#include <BTstackLib.h>
#include <stdio.h>
#include "ble/att_server.h"
#include "ble/gatt_client.h"
@@ -1,4 +1,4 @@
#include <BTstack.h>
#include <BTstackLib.h>
#include <SPI.h>
/*
@@ -0,0 +1,68 @@
#include <BTstackLib.h>
#include <SPI.h>
/*
EXAMPLE_START(LEDeviceScanner): LE Device Scanner
@text The LE Device Scanner monitors BLE device advertisements,
keeping track of one or more known devices as they appear.
*/
// Application state
int counter[2] = {0, 0};
BD_ADDR known_devices[2] = {BD_ADDR("DB:88:B6:70:9E:EB"),
BD_ADDR("C9:60:BD:F2:B4:9D")
};
/*
@section Setup
@text After BTstack.setup(), BTstack is configured to call
advertisementCallback whenever an Advertisement was received.
*/
/* LISTING_START(LEDeviceScannerSetup): LE Device Scanner Setup */
void setup(void) {
Serial.begin(9600);
BTstack.setBLEAdvertisementCallback(advertisementCallback);
BTstack.setup();
BTstack.bleStartScanning();
}
/* LISTING_END(LEDeviceScannerSetup): LE Device Scanner Setup */
/*
@section Loop
@text In the standard Arduino loop() function, BTstack's loop() is called.
*/
/* LISTING_START(LEDeviceScannerLoop): Loop */
void loop(void) {
BTstack.loop();
}
/* LISTING_END(LEDeviceScannerLoop): Loop */
/*
@section Advertisement Callback
@text Whenever an Advertisement is received, isIBeacon() checks if
it contains an iBeacon.
If it's not an iBeacon, the BD_ADDR is compared to the address we are
looking for and the counter is incremented.
*/
/* LISTING_START(LEDeviceScannerAdvertisementCallback): Advertisement Callback
*/
void advertisementCallback(BLEAdvertisement *bleAdvertisement) {
if (!(bleAdvertisement->isIBeacon())) {
Serial.print("Device discovered: ");
Serial.println(bleAdvertisement->getBdAddr()->getAddressString());
for (size_t i = 0; i < sizeof(counter) / sizeof(int); i++) {
if (memcmp(bleAdvertisement->getBdAddr()->getAddress(),
known_devices[i].getAddress(), sizeof(known_devices[i])) == 0) {
counter[i]++;
Serial.printf("Known device: %s, has been discovered %d times.\n",
known_devices[i].getAddressString(), counter[i]);
}
}
}
}
/* LISTING_END(LEDeviceScannerAdvertisementCallback): Advertisement Callback */
@@ -1,5 +1,5 @@
// LE Peripheral Example - not working yet
#include <BTstack.h>
#include <BTstackLib.h>
#include <SPI.h>
/*
@@ -1,4 +1,4 @@
#include <BTstack.h>
#include <BTstackLib.h>
#include <stdio.h>
#include <SPI.h>
@@ -1,5 +1,4 @@
#include <BTstack.h>
#include <BTstackLib.h>
#include <SPI.h>
/* EXAMPLE_START(iBeaconScanner): iBeacon Scanner
@@ -13,7 +13,7 @@
//#include <Reset.h> // also provides NVIC_SystemReset
#endif
#include "BTstack.h"
#include "BTstackLib.h"
#include "btstack_memory.h"
#include "hal_tick.h"
@@ -396,9 +396,13 @@ BD_ADDR::BD_ADDR(void) {
}
BD_ADDR::BD_ADDR(const char * address_string, BD_ADDR_TYPE address_type) : address_type(address_type) {
(void) address_string;
// TODO: implement
// log_error("BD_ADDR::BD_ADDR(const char *, BD_ADDR_TYPE) not implemented yet!");
int processed = sscanf(address_string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", address, address + 1,
address + 2, address + 3, address + 4, address + 5);
if (processed != 6) { // Set address to zeroes if we did not get six bytes back.
for (int i = 0; i < 6; i++) {
address[i] = 0;
}
}
}
BD_ADDR::BD_ADDR(const uint8_t address[6], BD_ADDR_TYPE address_type) : address_type(address_type) {
@@ -774,6 +778,10 @@ static hci_transport_config_uart_t config = {
static btstack_packet_callback_registration_t hci_event_callback_registration;
void BTstackManager::setup(void) {
setup("BTstack LE Shield");
}
void BTstackManager::setup(const char * name) {
//#ifdef PIN_LED
// pinMode(PIN_LED, OUTPUT);
@@ -822,7 +830,6 @@ void BTstackManager::setup(void) {
const uint8_t flags[] = { 0x02, 0x01, 0x02 };
memcpy(&adv_data[pos], flags, sizeof(flags));
pos += sizeof(flags);
const char * name = "BTstack LE Shield";
adv_data[pos++] = strlen(name) + 1;
adv_data[pos++] = 0x09;
memcpy(&adv_data[pos], name, strlen(name));
@@ -1,6 +1,9 @@
/**
Arduino Wrapper for BTstack
*/
#include <_needsbt.h>
#ifndef __ARDUINO_BTSTACK_H
#define __ARDUINO_BTSTACK_H
@@ -132,6 +135,7 @@ extern "C" {
public:
BTstackManager(void);
void setup(void);
void setup(const char * name);
void loop(void);
void setPublicBdAddr(bd_addr_t addr);
@@ -198,4 +202,4 @@ extern "C" {
}
#endif
#endif // __ARDUINO_BTSTACK_H
#endif // __ARDUINO_BTSTACK_H
+4
View File
@@ -2,6 +2,8 @@
# https://arduino.github.io/arduino-cli/library-specification/#keywords
# Formatted by a single true tab (not spaces)
FreeRTOS KEYWORD1
# Datatypes (KEYWORD1)
StackType_t KEYWORD1
BaseType_t KEYWORD1
@@ -34,6 +36,7 @@ pcTaskGetName KEYWORD2
ulTaskNotifyTake KEYWORD2
vTaskNotifyGiveFromISR KEYWORD2
taskYIELD KEYWORD2
vTaskCoreAffinitySet KEYWORD2
vTaskSuspend KEYWORD2
vTaskResume KEYWORD2
xTaskResumeFromISR KEYWORD2
@@ -41,6 +44,7 @@ xTaskGetTickCount KEYWORD2
xTaskGetTickCountFromISR KEYWORD2
uxTaskGetNumberOfTasks KEYWORD2
uxTaskGetStackHighWaterMark KEYWORD2
uxTaskGetSystemState KEYWORD2
# Instances (KEYWORD2)
+1 -4
View File
@@ -29,10 +29,7 @@
#define configUSE_TASK_PREEMPTION_DISABLE 1
#define configUSE_NEWLIB_REENTRANT 1
#define configNEWLIB_REENTRANT_IS_DYNAMIC 0 /* Note that we have a different config option, portSET_IMPURE_PTR */
#include <reent.h>
extern void __register_impure_ptr(struct _reent *p);
#define portSET_IMPURE_PTR(x) __register_impure_ptr(x)
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
/* Run time stats related definitions. */
void vMainConfigureTimerForRunTimeStats(void);
+13
View File
@@ -1 +1,14 @@
#include "../lib/FreeRTOS-Kernel/tasks.c"
//See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/496
struct _reent* __wrap___getreent(void) {
// No lock needed because if this changes, we won't be running anymore.
TCB_t *pxCurTask = xTaskGetCurrentTaskHandle();
if (pxCurTask == NULL) {
// No task running. Return global struct.
return _GLOBAL_REENT;
} else {
// We have a task; return its reentrant struct.
return &pxCurTask->xNewLib_reent;
}
}
+102 -52
View File
@@ -40,7 +40,59 @@
#include <pico.h>
#include <pico/time.h>
#include "_freertos.h"
#include <_freertos.h>
// Interfaces for the main core to use FreeRTOS mutexes
extern "C" {
extern volatile bool __otherCoreIdled;
SemaphoreHandle_t __freertos_mutex_create() {
return xSemaphoreCreateMutex();
}
SemaphoreHandle_t _freertos_recursive_mutex_create() {
return xSemaphoreCreateRecursiveMutex();
}
void __freertos_mutex_take(SemaphoreHandle_t mtx) {
xSemaphoreTake(mtx, portMAX_DELAY);
}
int __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) {
return xSemaphoreTakeFromISR(mtx, pxHigherPriorityTaskWoken);
}
int __freertos_mutex_try_take(SemaphoreHandle_t mtx) {
return xSemaphoreTake(mtx, 0);
}
void __freertos_mutex_give(SemaphoreHandle_t mtx) {
xSemaphoreGive(mtx);
}
void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx, BaseType_t* pxHigherPriorityTaskWoken) {
BaseType_t hiPrio = pxHigherPriorityTaskWoken ? *pxHigherPriorityTaskWoken : pdFALSE;
xSemaphoreGiveFromISR(mtx, &hiPrio);
portYIELD_FROM_ISR(hiPrio);
}
void __freertos_recursive_mutex_take(SemaphoreHandle_t mtx) {
xSemaphoreTakeRecursive(mtx, portMAX_DELAY);
}
int __freertos_recursive_mutex_try_take(SemaphoreHandle_t mtx) {
return xSemaphoreTakeRecursive(mtx, 0);
}
void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) {
xSemaphoreGiveRecursive(mtx);
}
bool __freertos_check_if_in_isr() {
return portCHECK_IF_IN_ISR();
}
}
/*-----------------------------------------------------------*/
@@ -108,6 +160,40 @@ extern "C" void yield() {
taskYIELD();
}
static TaskHandle_t __idleCoreTask[2];
static void __no_inline_not_in_flash_func(IdleThisCore)(void *param) {
(void) param;
while (true) {
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
vTaskPreemptionDisable(nullptr);
portDISABLE_INTERRUPTS();
__otherCoreIdled = true;
while (__otherCoreIdled) {
/* noop */
}
portENABLE_INTERRUPTS();
vTaskPreemptionEnable(nullptr);
}
}
extern "C" void __no_inline_not_in_flash_func(__freertos_idle_other_core)() {
vTaskPreemptionDisable(nullptr);
xTaskNotifyGive(__idleCoreTask[ 1 ^ sio_hw->cpuid ]);
while (!__otherCoreIdled) {
/* noop */
}
portDISABLE_INTERRUPTS();
vTaskSuspendAll();
}
extern "C" void __no_inline_not_in_flash_func(__freertos_resume_other_core)() {
__otherCoreIdled = false;
portENABLE_INTERRUPTS();
xTaskResumeAll();
vTaskPreemptionEnable(nullptr);
}
extern mutex_t __usb_mutex;
static TaskHandle_t __usbTask;
static void __usb(void *param);
@@ -124,6 +210,12 @@ void startFreeRTOS(void) {
vTaskCoreAffinitySet(c1, 1 << 1);
}
// Create the idle-other-core tasks (for when flash is being written)
xTaskCreate(IdleThisCore, "IdleCore0", 128, 0, configMAX_PRIORITIES - 1, __idleCoreTask + 0);
vTaskCoreAffinitySet(__idleCoreTask[0], 1 << 0);
xTaskCreate(IdleThisCore, "IdleCore1", 128, 0, configMAX_PRIORITIES - 1, __idleCoreTask + 1);
vTaskCoreAffinitySet(__idleCoreTask[1], 1 << 1);
// Initialise and run the freeRTOS scheduler. Execution should never return here.
__freeRTOSinitted = true;
vTaskStartScheduler();
@@ -216,16 +308,20 @@ void vApplicationTickHook(void) {
Private function to enable board led to use it in application hooks
*/
void prvSetMainLedOn(void) {
#ifdef LED_BUILTIN
gpio_init(LED_BUILTIN);
gpio_set_dir(LED_BUILTIN, true);
gpio_put(LED_BUILTIN, true);
#endif
}
/**
Private function to blink board led to use it in application hooks
*/
void prvBlinkMainLed(void) {
#ifdef LED_BUILTIN
gpio_put(LED_BUILTIN, !gpio_get(LED_BUILTIN));
#endif
}
#endif
@@ -376,9 +472,10 @@ static void __usb(void *param) {
__usbInitted = true;
while (true) {
if (mutex_try_enter(&__usb_mutex, NULL)) {
auto m = __get_freertos_mutex_for_ptr(&__usb_mutex);
if (xSemaphoreTake(m, 0)) {
tud_task();
mutex_exit(&__usb_mutex);
xSemaphoreGive(m);
}
vTaskDelay(1 / portTICK_PERIOD_MS);
}
@@ -393,54 +490,7 @@ void __USBStart() {
__SetupDescHIDReport();
__SetupUSBDescriptor();
// Make highest prio and locked to core 0
xTaskCreate(__usb, "USB", 256, 0, configMAX_PRIORITIES - 1, &__usbTask);
// Make high prio and locked to core 0
xTaskCreate(__usb, "USB", 256, 0, configMAX_PRIORITIES - 2, &__usbTask);
vTaskCoreAffinitySet(__usbTask, 1 << 0);
}
// Interfaces for the main core to use FreeRTOS mutexes
extern "C" {
SemaphoreHandle_t __freertos_mutex_create() {
return xSemaphoreCreateMutex();
}
SemaphoreHandle_t _freertos_recursive_mutex_create() {
return xSemaphoreCreateRecursiveMutex();
}
void __freertos_mutex_take(SemaphoreHandle_t mtx) {
xSemaphoreTake(mtx, portMAX_DELAY);
}
void __freertos_mutex_take_from_isr(SemaphoreHandle_t mtx) {
xSemaphoreTakeFromISR(mtx, NULL);
}
int __freertos_mutex_try_take(SemaphoreHandle_t mtx) {
return xSemaphoreTake(mtx, 0);
}
void __freertos_mutex_give(SemaphoreHandle_t mtx) {
xSemaphoreGive(mtx);
}
void __freertos_mutex_give_from_isr(SemaphoreHandle_t mtx) {
xSemaphoreGiveFromISR(mtx, NULL);
}
void __freertos_recursive_mutex_take(SemaphoreHandle_t mtx) {
xSemaphoreTakeRecursive(mtx, portMAX_DELAY);
}
int __freertos_recursive_mutex_try_take(SemaphoreHandle_t mtx) {
return xSemaphoreTakeRecursive(mtx, 0);
}
void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) {
xSemaphoreGiveRecursive(mtx);
}
}
@@ -21,6 +21,7 @@
#pragma once
#include <_needsbt.h>
#include <Arduino.h>
#include <functional>
#include <pico/cyw43_arch.h>
@@ -21,6 +21,7 @@
#pragma once
#include <_needsbt.h>
#include <Arduino.h>
#include <functional>
#include <pico/cyw43_arch.h>
+20 -10
View File
@@ -48,7 +48,7 @@ I2S::I2S(PinMode direction) {
_freq = 48000;
_arb = nullptr;
_cb = nullptr;
_buffers = 8;
_buffers = 6;
_bufferWords = 0;
_silenceSample = 0;
_isLSBJ = false;
@@ -138,6 +138,7 @@ void I2S::onReceive(void(*fn)(void)) {
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);
@@ -163,7 +164,7 @@ bool I2S::begin() {
_silenceSample = (a << 16) | a;
}
if (!_bufferWords) {
_bufferWords = 16 * (_bps == 32 ? 2 : 1);
_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]);
@@ -187,10 +188,18 @@ void I2S::end() {
int I2S::available() {
if (!_running) {
return 0;
} else if (_isOutput) {
return availableForWrite(); // Do what I mean, not what I say
} else {
return _arb->available();
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;
}
}
return avail;
}
}
@@ -219,7 +228,7 @@ int I2S::read() {
case 16:
ret = _holdWord >> 16;
_holdWord <<= 16;
_isHolding -= 32;
_isHolding -= 16;
return ret;
case 24:
case 32:
@@ -376,13 +385,14 @@ bool I2S::read32(int32_t *l, int32_t *r) {
size_t I2S::write(const uint8_t *buffer, size_t size) {
// We can only write 32-bit chunks here
if (size & 0x3) {
if (size & 0x3 || !_running || !_isOutput) {
return 0;
}
size_t writtenSize = 0;
int32_t *p = (int32_t *)buffer;
uint32_t *p = (uint32_t *)buffer;
while (size) {
if (!write((int32_t)*p)) {
if (!_arb->write(*p, false)) {
// Blocked, stop write here
return writtenSize;
} else {
@@ -398,5 +408,5 @@ int I2S::availableForWrite() {
if (!_running || !_isOutput) {
return 0;
}
return _arb->available();
return available();
}
+9
View File
@@ -54,6 +54,15 @@ public:
virtual size_t write(const uint8_t *buffer, size_t size) override;
virtual int availableForWrite() override;
// From the AR
bool getOverUnderflow() {
if (!_running) {
return false;
} else {
return _arb->getOverUnderflow();
}
}
// Try and make I2S::write() do what makes sense, namely write
// one sample (L or R) at the I2S configured bit width
virtual size_t write(uint8_t s) override {
@@ -13,7 +13,10 @@
// 3. Open up COMX: in your favorite terminal application and type away
// Under Mac to connect to the PicoW
// 1. Sorry, you're on your own. If you have a Mac and can update this demo with a Pull Request it would be appreciated!
// 1. Open System Preferences and go in the bluetooth section. You should find a bluetooth device called
// PicoW Serial XX:XX:... Click Connect button.
// 2. A /dev/tty.PicoWSerialXXXX becomes available.
// 3. Connect to this device with your favorite terminal application.
#include <SerialBT.h>
+1
View File
@@ -20,6 +20,7 @@
#pragma once
#include <_needsbt.h>
#include <Arduino.h>
#include <api/HardwareSerial.h>
#include <stdarg.h>
@@ -47,7 +47,6 @@ for row in csvReader:
if item.startswith("'-----BEGIN CERTIFICATE-----"):
pems.append(item)
del names[0] # Remove headers
del pems[0] # Remove headers
# Try and make ./data, skip if present
try:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "framework-arduinopico",
"version": "1.30101.0",
"version": "1.30202.0",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
"keywords": [
"framework",
+9
View File
@@ -44,6 +44,12 @@
{
"name": "Adafruit Feather RP2040 USB Host"
},
{
"name": "Adafruit Feather RP2040 CAN"
},
{
"name": "Adafruit Feather RP2040 Prop-Maker"
},
{
"name": "Adafruit ItsyBitsy RP2040"
},
@@ -146,6 +152,9 @@
{
"name": "uPesy RP2040 DevKit"
},
{
"name": "Seeed INDICATOR RP2040"
},
{
"name": "Seeed XIAO RP2040"
},
+3 -2
View File
@@ -20,7 +20,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Raspberry Pi RP2040 Boards
version=3.1.1
version=3.2.2
runtime.tools.pqt-gcc.path={runtime.platform.path}/system/arm-none-eabi
runtime.tools.pqt-python3.path={runtime.platform.path}/system/python3
@@ -43,7 +43,7 @@ compiler.warning_flags.more=-Wall -Werror=return-type -Wno-ignored-qualifiers
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualifiers
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
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}
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt" "-I{runtime.platform.path}/include"
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect} {build.flags.cmsis} {build.picodebugflags}
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
@@ -82,6 +82,7 @@ compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=
# Board configuration, set in boards.txt. Present here to ensure substitution works
build.flash_total=
build.flash_length=
build.eeprom_start=
build.flags.optimize=-Os
+1 -1
View File
@@ -10,7 +10,7 @@ for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S ./libraries/SingleF
./libraries/Updater ./libraries/HTTPClient ./libraries/HTTPUpdate \
./libraries/WebServer ./libraries/HTTPUpdateServer ./libraries/DNSServer \
./libraries/Joystick ./libraries/Keyboard ./libraries/Mouse \
./libraries/JoystickBT ./libraries/KeyboardBT ./variants ./libraries/BTstack \
./libraries/JoystickBT ./libraries/KeyboardBT ./variants ./libraries/BTstackLib \
./libraries/MouseBT ./libraries/SerialBT ./libraries/HID_Bluetooth \
./libraries/JoystickBLE ./libraries/KeyboardBLE ./libraries/MouseBLE ; do
find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" \) -a \! -path '*api*' -exec astyle --suffix=none --options=./tests/astyle_core.conf \{\} \;
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+56
View File
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239A",
"usb_pid": "0x812F"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_FEATHER_RP2040_CAN -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x239A",
"0x812F"
]
],
"mcu": "rp2040",
"variant": "adafruit_feather_can"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Feather RP2040 CAN",
"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": "Adafruit"
}
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
"usb_vid": "0x239A",
"usb_pid": "0x8131"
}
},
"core": "earlephilhower",
"cpu": "cortex-m0plus",
"extra_flags": "-D ARDUINO_ADAFRUIT_FEATHER_RP2040_PROP_MAKER -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
"f_cpu": "133000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x239A",
"0x8131"
]
],
"mcu": "rp2040",
"variant": "adafruit_feather_prop_maker"
},
"debug": {
"jlink_device": "RP2040_M0_0",
"openocd_target": "rp2040.cfg",
"svd_path": "rp2040.svd"
},
"frameworks": [
"arduino"
],
"name": "Feather RP2040 Prop-Maker",
"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": "Adafruit"
}
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
+3 -1
View File
@@ -42,11 +42,13 @@
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
"picoprobe",
"pico-debug"
]
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",

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