Skip to content

Commit f6973fc

Browse files
Add RISC-V support, GCC 14 move (#2491)
* Adds RISC-V compilation option to the IDE and Platform.IO. * Build RP2350-RISCV libpico, libbearssl * Fix RP2350 BearSSL library (was copied from RP2040, now built for M33) * New GCC 14.2 toolchain is required (12.4 RISC-V support is borked) * Newlib locking fixed prototypes * Manually force all runtime init code into RP2350 binaries * Add RISC-V to CI * Remove RP2350 BOOT2.S files, binaries (not used) * Clean up minor GCC 14.x warnings * Add RP2350-RISCV OTA build, link * Add RISC-V FreeRTOS files (configuration still not running, but builds) * Add basic documentation
1 parent f49d058 commit f6973fc

File tree

89 files changed

+11240
-457
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

+11240
-457
lines changed

.github/workflows/pull-request.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
submodules: false
1919
- name: Run codespell
20-
uses: codespell-project/actions-codespell@master
20+
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
2323
ignore_words_list: ser,dout,shiftIn,acount
@@ -101,6 +101,37 @@ jobs:
101101
cd ..
102102
bash ./tests/build-rp2350.sh
103103
104+
# Build all rp2350-riscv examples on linux (core and Arduino IDE)
105+
build-rp2350-riscv-linux:
106+
name: Build RP2350-RISCV ${{ matrix.chunk }}
107+
runs-on: ubuntu-latest
108+
strategy:
109+
matrix:
110+
chunk: [0, 1, 2, 3, 4, 5]
111+
steps:
112+
- uses: actions/checkout@v4
113+
with:
114+
submodules: true
115+
- uses: actions/setup-python@v5
116+
with:
117+
python-version: '3.x'
118+
- name: Cache Linux toolchain
119+
id: cache-linux
120+
uses: actions/cache@v4
121+
with:
122+
path: ./tools/dist
123+
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
124+
- name: Build Sketches
125+
env:
126+
BUILD_PARITY: custom
127+
mod: 6
128+
rem: ${{ matrix.chunk }}
129+
run: |
130+
cd pico-sdk
131+
git submodule update --init
132+
cd ..
133+
bash ./tests/build-rp2350-riscv.sh
134+
104135
# Build TinyUSB examples, requires custom build command line
105136
build-tinyusb:
106137
name: Build TinyUSB Examples

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
66

7-
This is a port of Arduino to the RP2040 (Raspberry Pi Pico processor) and RP2350 (Raspberry Pi Pico 2 processor). It uses the bare Raspberry Pi Pico SDK and a custom GCC 12.3/Newlib 4.0 toolchain.
7+
This is a port of Arduino to the RP2040 (Raspberry Pi Pico processor) and RP2350 (Raspberry Pi Pico 2 processor). It uses the bare Raspberry Pi Pico SDK and a custom GCC 14.2/Newlib 4.3 toolchain and supports ARM and RISC-V cores.
88

99
# Documentation
1010
See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for more detailed usage information.
@@ -126,6 +126,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
126126
* Peripherals: SPI master/slave, Wire(I2C) master/slave, dual UART, emulated EEPROM, I2S audio input/output, Servo
127127
* printf (i.e. debug) output over USB serial
128128
* Transparent use of PSRAM globals and heap (RP2350 only)
129+
* ARM or RISC-V (Hazard3) support for The RP2350
129130

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

boards.txt

Lines changed: 155 additions & 74 deletions
Large diffs are not rendered by default.

boot2/rp2350-riscv/none.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.section .boot2, "ax"
2+
3+
.global __boot2_entry_point
4+
__boot2_entry_point:

boot2/rp2350/boot2_generic_03h_2_padded_checksum.S

Lines changed: 0 additions & 25 deletions
This file was deleted.

boot2/rp2350/boot2_generic_03h_4_padded_checksum.S

Lines changed: 0 additions & 25 deletions
This file was deleted.

boot2/rp2350/boot2_w25q080_2_padded_checksum.S

Lines changed: 0 additions & 25 deletions
This file was deleted.

boot2/rp2350/boot2_w25q080_4_padded_checksum.S

Lines changed: 0 additions & 25 deletions
This file was deleted.

boot2/rp2350/none.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.section .boot2, "ax"
2+
3+
.global __boot2_entry_point
4+
__boot2_entry_point:

cores/rp2040/Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#ifdef abs
3838
#undef abs
3939
#endif // abs
40-
#ifdef __cplusplus
40+
#if defined(__cplusplus) && !defined(__riscv)
4141
using std::abs;
4242
using std::round;
4343
#else

0 commit comments

Comments
 (0)