Skip to content

Commit 1c9c0b6

Browse files
committed
Add support for RP2040 and RP-PICO
2 parents d017602 + 65ac60a commit 1c9c0b6

Some content is hidden

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

91 files changed

+5551
-162
lines changed

.github/workflows/linux.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ jobs:
8080
if: always()
8181
run: |
8282
(cd examples && ../tools/scripts/examples_compile.py samv)
83+
- name: Examples RP20 Devices
84+
if: always()
85+
run: |
86+
(cd examples && ../tools/scripts/examples_compile.py rp_pico)
8387
- name: Execute Python Scripts
8488
if: always()
8589
run: |
@@ -225,7 +229,7 @@ jobs:
225229
- name: Quick compile HAL for Cortex-M Part 1
226230
if: always()
227231
run: |
228-
(cd test/all && python3 run_all.py stm32 sam --quick --split 4 --part 0)
232+
(cd test/all && python3 run_all.py stm32 sam rp --quick --split 4 --part 0)
229233
- name: Upload log artifacts
230234
uses: actions/upload-artifact@v2
231235
with:
@@ -245,7 +249,7 @@ jobs:
245249
- name: Quick compile HAL for Cortex-M Part 2
246250
if: always()
247251
run: |
248-
(cd test/all && python3 run_all.py stm32 sam --quick --split 4 --part 1)
252+
(cd test/all && python3 run_all.py stm32 sam rp --quick --split 4 --part 1)
249253
- name: Upload log artifacts
250254
uses: actions/upload-artifact@v2
251255
with:
@@ -265,7 +269,7 @@ jobs:
265269
- name: Quick compile HAL for Cortex-M Part 3
266270
if: always()
267271
run: |
268-
(cd test/all && python3 run_all.py stm32 sam --quick --split 4 --part 2)
272+
(cd test/all && python3 run_all.py stm32 sam rp --quick --split 4 --part 2)
269273
- name: Upload log artifacts
270274
uses: actions/upload-artifact@v2
271275
with:
@@ -285,7 +289,7 @@ jobs:
285289
- name: Quick compile HAL for Cortex-M Part 4
286290
if: always()
287291
run: |
288-
(cd test/all && python3 run_all.py stm32 sam --quick --split 4 --part 3)
292+
(cd test/all && python3 run_all.py stm32 sam rp --quick --split 4 --part 3)
289293
- name: Upload log artifacts
290294
uses: actions/upload-artifact@v2
291295
with:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@
3737
[submodule "ext/etlcpp/etl"]
3838
path = ext/etlcpp/etl
3939
url = https://github.com/modm-ext/etl-partial.git
40+
[submodule "ext/rp/pico-sdk"]
41+
path = ext/rp/pico-sdk
42+
url = https://github.com/modm-ext/pico-sdk-partial.git

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
101101
<th align="center"></th>
102102
<th align="center" colspan="13">STM32</th>
103103
<th align="center" colspan="3">SAM</th>
104+
<th align="center" colspan="1">RP</th>
104105
<th align="center" colspan="3">AT</th>
105106
</tr><tr>
106107
<th align="left">Peripheral</th>
@@ -120,6 +121,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
120121
<th align="center">D21</th>
121122
<th align="center">G55</th>
122123
<th align="center">V70</th>
124+
<th align="center">20</th>
123125
<th align="center">90</th>
124126
<th align="center">Mega</th>
125127
<th align="center">Tiny</th>
@@ -142,6 +144,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
142144
<td align="center">✅</td>
143145
<td align="center">○</td>
144146
<td align="center">○</td>
147+
<td align="center">○</td>
145148
<td align="center">✅</td>
146149
<td align="center">✅</td>
147150
</tr><tr>
@@ -162,6 +165,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
162165
<td align="center">✕</td>
163166
<td align="center">✕</td>
164167
<td align="center">○</td>
168+
<td align="center">✕</td>
165169
<td align="center">○</td>
166170
<td align="center">○</td>
167171
<td align="center">✕</td>
@@ -183,6 +187,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
183187
<td align="center">○</td>
184188
<td align="center">✕</td>
185189
<td align="center">○</td>
190+
<td align="center">✕</td>
186191
<td align="center">○</td>
187192
<td align="center">○</td>
188193
<td align="center">○</td>
@@ -205,6 +210,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
205210
<td align="center">✕</td>
206211
<td align="center">○</td>
207212
<td align="center">✕</td>
213+
<td align="center">✕</td>
208214
<td align="center">○</td>
209215
<td align="center">✕</td>
210216
</tr><tr>
@@ -225,6 +231,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
225231
<td align="center">○</td>
226232
<td align="center">✕</td>
227233
<td align="center">○</td>
234+
<td align="center">✅</td>
228235
<td align="center">✕</td>
229236
<td align="center">✕</td>
230237
<td align="center">✕</td>
@@ -249,6 +256,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
249256
<td align="center">✕</td>
250257
<td align="center">✕</td>
251258
<td align="center">✕</td>
259+
<td align="center">✕</td>
252260
</tr><tr>
253261
<td align="left">External Interrupt</td>
254262
<td align="center">✅</td>
@@ -267,6 +275,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
267275
<td align="center">✅</td>
268276
<td align="center">○</td>
269277
<td align="center">○</td>
278+
<td align="center">○</td>
270279
<td align="center">✅</td>
271280
<td align="center">✅</td>
272281
<td align="center">✅</td>
@@ -288,6 +297,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
288297
<td align="center">✕</td>
289298
<td align="center">✕</td>
290299
<td align="center">○</td>
300+
<td align="center">○</td>
291301
<td align="center">✕</td>
292302
<td align="center">✕</td>
293303
<td align="center">✕</td>
@@ -312,6 +322,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
312322
<td align="center">✅</td>
313323
<td align="center">✅</td>
314324
<td align="center">✅</td>
325+
<td align="center">✅</td>
315326
</tr><tr>
316327
<td align="left">I<sup>2</sup>C</td>
317328
<td align="center">✅</td>
@@ -330,6 +341,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
330341
<td align="center">○</td>
331342
<td align="center">○</td>
332343
<td align="center">○</td>
344+
<td align="center">○</td>
333345
<td align="center">✅</td>
334346
<td align="center">✅</td>
335347
<td align="center">✅</td>
@@ -354,6 +366,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
354366
<td align="center">✕</td>
355367
<td align="center">✕</td>
356368
<td align="center">✕</td>
369+
<td align="center">✕</td>
357370
</tr><tr>
358371
<td align="left">Random Generator</td>
359372
<td align="center">✕</td>
@@ -375,6 +388,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
375388
<td align="center">✕</td>
376389
<td align="center">✕</td>
377390
<td align="center">✕</td>
391+
<td align="center">✕</td>
378392
</tr><tr>
379393
<td align="left">SPI</td>
380394
<td align="center">✅</td>
@@ -396,6 +410,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
396410
<td align="center">✅</td>
397411
<td align="center">✅</td>
398412
<td align="center">✅</td>
413+
<td align="center">✅</td>
399414
</tr><tr>
400415
<td align="left">System Clock</td>
401416
<td align="center">✅</td>
@@ -412,8 +427,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
412427
<td align="center">✅</td>
413428
<td align="center">✅</td>
414429
<td align="center">✅</td>
415-
<td align="center">✕</td>
416-
<td align="center">✕</td>
430+
<td align="center">✅</td>
431+
<td align="center">✅</td>
432+
<td align="center">✅</td>
417433
<td align="center">✕</td>
418434
<td align="center">✕</td>
419435
<td align="center">✕</td>
@@ -438,6 +454,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
438454
<td align="center">○</td>
439455
<td align="center">○</td>
440456
<td align="center">○</td>
457+
<td align="center">○</td>
441458
</tr><tr>
442459
<td align="left">UART</td>
443460
<td align="center">✅</td>
@@ -458,6 +475,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
458475
<td align="center">○</td>
459476
<td align="center">✅</td>
460477
<td align="center">✅</td>
478+
<td align="center">✅</td>
461479
<td align="center">○</td>
462480
</tr><tr>
463481
<td align="left">Unique ID</td>
@@ -480,6 +498,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
480498
<td align="center">✕</td>
481499
<td align="center">✕</td>
482500
<td align="center">✕</td>
501+
<td align="center">✕</td>
483502
</tr><tr>
484503
<td align="left">USB</td>
485504
<td align="center">✅</td>
@@ -498,6 +517,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
498517
<td align="center">✅</td>
499518
<td align="center">✅</td>
500519
<td align="center">○</td>
520+
<td align="center">✅</td>
501521
<td align="center">✕</td>
502522
<td align="center">✕</td>
503523
<td align="center">✕</td>
@@ -585,13 +605,15 @@ We have out-of-box support for many development boards including documentation.
585605
<td align="center"><a href="https://modm.io/reference/module/modm-board-nucleo-l552ze-q">NUCLEO-L552ZE-Q</a></td>
586606
</tr><tr>
587607
<td align="center"><a href="https://modm.io/reference/module/modm-board-olimexino-stm32">OLIMEXINO-STM32</a></td>
608+
<td align="center"><a href="https://modm.io/reference/module/modm-board-rp-pico">RP-PICO</a></td>
588609
<td align="center"><a href="https://modm.io/reference/module/modm-board-raspberrypi">Raspberry Pi</a></td>
589610
<td align="center"><a href="https://modm.io/reference/module/modm-board-samd21-mini">SAMD21-MINI</a></td>
590-
<td align="center"><a href="https://modm.io/reference/module/modm-board-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
591611
</tr><tr>
612+
<td align="center"><a href="https://modm.io/reference/module/modm-board-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
592613
<td align="center"><a href="https://modm.io/reference/module/modm-board-stm32_f4ve">STM32-F4VE</a></td>
593614
<td align="center"><a href="https://modm.io/reference/module/modm-board-stm32f030_demo">STM32F030-DEMO</a></td>
594615
<td align="center"><a href="https://modm.io/reference/module/modm-board-srxe">Smart Response XE</a></td>
616+
</tr><tr>
595617
</tr>
596618
</table>
597619
<!--/bsptable-->

examples/generic/delay/project.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<!-- <extends>modm:nucleo-l432kc</extends> -->
1818
<!-- <extends>modm:nucleo-l476rg</extends> -->
1919
<!-- <extends>modm:samd21-mini</extends> -->
20+
<!-- <extends>modm:rp-pico</extends> -->
2021
<options>
2122
<option name="modm:build:build.path">../../../build/generic/delay</option>
2223
<option name="modm:io:with_printf">true</option>

examples/generic/usb/project.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<!-- <extends>modm:disco-f303vc</extends> -->
1010
<!-- <extends>modm:disco-f407vg</extends> -->
1111
<!-- <extends>modm:disco-f746ng</extends> -->
12+
<!-- <extends>modm:rp-pico</extends> -->
1213
<options>
1314
<option name="modm:build:build.path">../../../build/generic/usb</option>
1415
<option name="modm:build:openocd.cfg">openocd.cfg</option>

examples/rp_pico/blink/main.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2016, Sascha Schade
3+
* Copyright (c) 2017, Niklas Hauser
4+
*
5+
* This file is part of the modm project.
6+
*
7+
* This Source Code Form is subject to the terms of the Mozilla Public
8+
* License, v. 2.0. If a copy of the MPL was not distributed with this
9+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
10+
*/
11+
// ----------------------------------------------------------------------------
12+
13+
#include <modm/board.hpp>
14+
15+
using namespace Board;
16+
17+
/*
18+
* Blinks the green user LED with 1 Hz.
19+
* It is on for 90% of the time and off for 10% of the time.
20+
*/
21+
22+
int
23+
main()
24+
{
25+
Board::initialize();
26+
27+
LedGreen::setOutput();
28+
29+
while (true)
30+
{
31+
LedGreen::set();
32+
modm::delay(900ms);
33+
34+
LedGreen::reset();
35+
modm::delay(100ms);
36+
}
37+
38+
return 0;
39+
}

examples/rp_pico/blink/project.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<library>
2+
<extends>modm:rp-pico</extends>
3+
<options>
4+
<option name="modm:build:build.path">../../../build/rp_pico/blink</option>
5+
<option name="modm:platform:cortex-m:vector_table_location">ram</option>
6+
</options>
7+
<modules>
8+
<module>modm:build:scons</module>
9+
</modules>
10+
</library>

0 commit comments

Comments
 (0)