Skip to content

Commit

Permalink
[sam] Add support for SAMx5x and SAMx7x devices
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Sep 30, 2022
2 parents ce8ad5c + 83fbc1c commit 8230fef
Show file tree
Hide file tree
Showing 71 changed files with 2,770 additions and 791 deletions.
58 changes: 55 additions & 3 deletions .github/workflows/compile-all.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
name: avr-compile-all
path: test/all/log

sam-compile-all:
sam-d0x-d1x-d2x-compile-all:
if: github.event.label.name == 'ci:hal'
runs-on: ubuntu-20.04
container:
Expand All @@ -47,9 +47,61 @@ jobs:
- name: Update lbuild
run: |
pip3 install --upgrade --upgrade-strategy=eager modm
- name: Compile HAL for all SAM
- name: Compile HAL for SAMD0x, SAMD1x, SAMD2x
run: |
(cd test/all && python3 run_all.py sam --quick-remaining)
(cd test/all && python3 run_all.py samd0 samd1 samd2 --quick-remaining)
- name: Upload log artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: sam-compile-all
path: test/all/log

sam-x5x-compile-all:
if: github.event.label.name == 'ci:hal'
runs-on: ubuntu-20.04
container:
image: ghcr.io/modm-ext/modm-build-cortex-m:2022-09-27
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Fix Git permission/ownership problem
run: |
git config --global --add safe.directory /__w/modm/modm
- name: Update lbuild
run: |
pip3 install --upgrade --upgrade-strategy=eager modm
- name: Compile HAL for SAMD5x, SAME5x, SAMG5x
run: |
(cd test/all && python3 run_all.py samd5 same5 samg5 --quick-remaining)
- name: Upload log artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: sam-compile-all
path: test/all/log

sam-x7x-compile-all:
if: github.event.label.name == 'ci:hal'
runs-on: ubuntu-20.04
container:
image: ghcr.io/modm-ext/modm-build-cortex-m:2022-09-27
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Fix Git permission/ownership problem
run: |
git config --global --add safe.directory /__w/modm/modm
- name: Update lbuild
run: |
pip3 install --upgrade --upgrade-strategy=eager modm
- name: Compile HAL for SAME7x, SAMS7x, SAMV7x
run: |
(cd test/all && python3 run_all.py same7 sams7 samv7 --quick-remaining)
- name: Upload log artifacts
if: always()
uses: actions/upload-artifact@v2
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/linux.yml
Expand Up @@ -92,15 +92,19 @@ jobs:
- name: Examples SAMD Devices
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py samd)
(cd examples && ../tools/scripts/examples_compile.py samd samd21_xplained_pro)
- name: Examples SAMG Devices
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py samg55_xplained_pro)
- name: Examples SAME5x Devices
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py same54_xplained_pro)
- name: Examples SAMV Devices
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py samv)
(cd examples && ../tools/scripts/examples_compile.py samv samv71_xplained_ultra)
- name: Examples RP20 Devices
if: always()
run: |
Expand Down
57 changes: 40 additions & 17 deletions README.md
Expand Up @@ -80,10 +80,10 @@ git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git

## Microcontrollers

modm can create a HAL for <!--allcount-->3304<!--/allcount--> devices of these vendors:
modm can create a HAL for <!--allcount-->3534<!--/allcount--> devices of these vendors:

- STMicroelectronics STM32: <!--stmcount-->2729<!--/stmcount--> devices.
- Microchip SAM: <!--samcount-->186<!--/samcount--> devices.
- Microchip SAM: <!--samcount-->416<!--/samcount--> devices.
- Microchip AVR: <!--avrcount-->388<!--/avrcount--> devices.
- Raspberry Pi: <!--rpicount-->1<!--/rpicount--> device.

Expand All @@ -103,7 +103,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<tr>
<th align="center"></th>
<th align="center" colspan="13">STM32</th>
<th align="center" colspan="3">SAM</th>
<th align="center" colspan="4">SAM</th>
<th align="center" colspan="1">RP</th>
<th align="center" colspan="3">AT</th>
</tr><tr>
Expand All @@ -121,9 +121,10 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<th align="center">L1</th>
<th align="center">L4</th>
<th align="center">L5</th>
<th align="center">D21</th>
<th align="center">G55</th>
<th align="center">V70</th>
<th align="center">D1x<br/>D2x<br/>DAx</th>
<th align="center">D5x<br/>E5x</th>
<th align="center">E7x<br/>S7x<br/>V7x</th>
<th align="center">G5x</th>
<th align="center">20</th>
<th align="center">90</th>
<th align="center">Mega</th>
Expand All @@ -144,8 +145,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
Expand All @@ -166,8 +168,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
Expand All @@ -188,8 +191,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
Expand All @@ -210,10 +214,11 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">✕</td>
</tr><tr>
Expand All @@ -232,8 +237,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✅</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand All @@ -254,7 +260,8 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand All @@ -278,6 +285,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -300,6 +308,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand All @@ -326,6 +335,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
</tr><tr>
<td align="left">I<sup>2</sup>C</td>
<td align="center">✅</td>
Expand All @@ -344,6 +354,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -366,6 +377,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand All @@ -386,8 +398,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand All @@ -408,8 +421,9 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -433,6 +447,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand All @@ -452,9 +467,10 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
Expand All @@ -475,7 +491,8 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -502,6 +519,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
</tr><tr>
<td align="left">USB</td>
<td align="center">✅</td>
Expand All @@ -521,6 +539,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✕</td>
<td align="center">✕</td>
<td align="center">✕</td>
Expand Down Expand Up @@ -613,11 +632,15 @@ We have out-of-box support for many development boards including documentation.
<td align="center"><a href="https://modm.io/reference/config/modm-rp-pico">Raspberry Pi Pico</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-mini">SAMD21-MINI</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-samd21-xplained-pro">SAMD21-XPLAINED-PRO</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-same54-xplained-pro">SAME54-XPLAINED-PRO</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-samg55-xplained-pro">SAMG55-XPLAINED-PRO</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-samv71-xplained-ultra">SAMV71-XPLAINED-ULTRA</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-srxe">Smart Response XE</a></td>
<td align="center"><a href="https://modm.io/reference/config/modm-stm32_f4ve">STM32-F4VE</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-stm32f030_demo">STM32F030-DEMO</a></td>
</tr><tr>
<td align="center"><a href="https://modm.io/reference/config/modm-thingplus-rp2040">THINGPLUS-RP2040</a></td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion examples/samd/interrupt/main.cpp
Expand Up @@ -27,7 +27,7 @@ int
main()
{
Board::initialize();
ExternalInterrupt::initialize();
ExternalInterrupt::initialize(Board::SystemClock::ClockGen32kHz);
ExtInt<3>::initialize(&isr);
ExtInt<3>::connect<D12>();
while (1)
Expand Down
39 changes: 39 additions & 0 deletions examples/samd21_xplained_pro/blink/main.cpp
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2016-2017, Niklas Hauser
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

#include <modm/board.hpp>

using namespace Board;

int
main()
{
Board::initialize();

// Use the logging streams to print some messages.
// Change MODM_LOG_LEVEL above to enable or disable these messages
MODM_LOG_DEBUG << "debug" << modm::endl;
MODM_LOG_INFO << "info" << modm::endl;
MODM_LOG_WARNING << "warning" << modm::endl;
MODM_LOG_ERROR << "error" << modm::endl;

uint32_t counter(0);

while (true)
{
Led0::toggle();
modm::delay(Button::read() ? 500ms : 100ms);

MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
}

return 0;
}
9 changes: 9 additions & 0 deletions examples/samd21_xplained_pro/blink/project.xml
@@ -0,0 +1,9 @@
<library>
<extends>modm:samd21-xplained-pro</extends>
<options>
<option name="modm:build:build.path">../../../build/samd21_xplained_pro/blink</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>

0 comments on commit 8230fef

Please sign in to comment.