1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge branch 'master' into rust-gcoap-add-saul

Makefile.ci was completely removed, pending regeneration
This commit is contained in:
chrysn 2024-03-19 22:05:07 +10:00
commit 3abedbbb19
10223 changed files with 1418143 additions and 341826 deletions

9
.cargo/config.toml Normal file
View File

@ -0,0 +1,9 @@
# Between RIOT releases, this file points all projects in the tree to git
# versions (still respecting Cargo.lock).
#
# Authors of out-of-tree applications can use the same lines in their
# Cargo.toml, copy this file over, or just use the released versions.
[patch.crates-io]
riot-sys = { git = "https://github.com/RIOT-OS/rust-riot-sys" }
riot-wrappers = { git = "https://github.com/RIOT-OS/rust-riot-wrappers" }

View File

@ -1,25 +0,0 @@
# CircleCI configuration file used to build and get a preview of the generated
# Doxygen documentation.
# Note that the job on CircleCI takes around 30 minutes to complete because
# copying +19k individual files to their cloud storage is very slow.
version: 2
jobs:
doc-build:
docker:
- image: riot/static-test-tools
steps:
- checkout
- run: make doc
- run:
command: |
cp -R doc/doxygen/html /doc
- store_artifacts:
path: /doc
workflows:
version: 2
doc-build:
jobs:
- doc-build

View File

@ -1,16 +0,0 @@
pipeline:
run_tests:
image: riot/riotbuild:latest
environment:
- CLICOLOR_FORCE=1
- NPROC_MAX=4
commands:
- pwd
- printenv
- git status
- git remote -v
- ./dist/tools/ci/build_and_test.sh
matrix:
BUILDTEST_MCU_GROUP:
- static-tests
- host

View File

@ -38,7 +38,7 @@ Please paste or specifically describe the actual output.
#### Versions
<!--
Operating system: Mac OSX, Linux, Vagrant VM
Operating system: macOS, Linux, Vagrant VM
Build environment: GCC, CLang versions (you can run the following command from
the RIOT base directory: make print-versions).
-->

9
.github/labeler.yml vendored
View File

@ -17,9 +17,10 @@
- "**/*.mk"
"Area: CI":
- ".circleci/**/*"
- ".github/**/*.yml"
- ".murdock"
- ".murdock.yml"
- "bors.toml"
"Area: CoAP":
- "sys/net/application_layer/*coap/**/*"
@ -117,7 +118,9 @@
"Platform: native":
- "boards/native/**/*"
- "boards/native64/**/*"
- "cpu/native/**/*"
- "makefiles/arch/native.inc.mk"
"Platform: ARM":
- "cpu/arm7_common/**/*"
@ -142,10 +145,6 @@
"Platform: ESP":
- "cpu/esp*/**/*"
"Platform: MIPS":
- "cpu/mips*/**/*"
- "makefiles/arch/mips.inc.mk"
"Platform: MSP":
- "cpu/msp*/**/*"
- "makefiles/arch/msp430.inc.mk"

37
.github/workflows/check-commits.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: check-commits
on:
pull_request:
types: [opened, reopened, synchronize]
merge_group:
jobs:
check-commits:
runs-on: ubuntu-latest
if: ${{ github.base_ref }}
strategy:
fail-fast: false
matrix:
check: [commit-msg, pr_check]
steps:
- uses: actions/checkout@main
with:
# Use the SHA of the PR branch as-is, not the PR branch merged
# in master (default behavior in GH actions)
# See https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Fetch base branch
run:
git fetch origin '${{ github.base_ref }}:${{ github.base_ref }}'
- name: Run checks
run: |
./dist/tools/${{ matrix.check }}/check.sh "${{ github.base_ref }}"
check-commits-success:
needs: check-commits
if: always() && github.event_name != 'merge_group'
runs-on: ubuntu-latest
steps:
- name: check-commits succeeded
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

20
.github/workflows/check-labels.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: check-labels
on:
pull_request_target:
types: [opened, reopened, labeled, unlabeled, synchronize]
pull_request_review:
types: [submitted, dismissed]
merge_group:
jobs:
check-labels:
if: github.event_name != 'merge_group'
runs-on: ubuntu-latest
steps:
- uses: RIOT-OS/check-labels-action@v1.1.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
unset_labels: 'CI: needs squashing,State: waiting for CI update,State: waiting for other PR,Process: blocked by feature freeze'
cond_labels: '(Process: needs >1 ACK,review.approvals>1),(Area: RDM,review.approvals>2)'
missing_approvals_label: 'Process: missing approvals'
pull_request: ${{ github.event.pull_request.number }}

View File

@ -1,36 +0,0 @@
name: check-pr
on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
pull_request_review:
types: [submitted, dismissed]
jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- uses: RIOT-OS/check-labels-action@v1.0.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
unset_labels: 'CI: needs squashing,State: waiting for other PR,Process: blocked by feature freeze'
cond_labels: '(Process: needs >1 ACK,review.approvals>1),(Area: RDM,review.approvals>2)'
check-commits:
runs-on: ubuntu-latest
if: ${{ github.base_ref }}
strategy:
fail-fast: false
matrix:
check: [commit-msg, pr_check]
steps:
- uses: actions/checkout@master
with:
# Use the SHA of the PR branch as-is, not the PR branch merged
# in master (default behavior in GH actions)
# See https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Fetch base branch
run:
git fetch origin '${{ github.base_ref }}:${{ github.base_ref }}'
- name: Run checks
run: |
./dist/tools/${{ matrix.check }}/check.sh "${{ github.base_ref }}"

View File

@ -1,13 +0,0 @@
name: doc-build-artifact
on: [status]
jobs:
circleci_artifacts_redirector_job:
runs-on: ubuntu-latest
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: 0/doc/index.html
circleci-jobs: doc-build

View File

@ -3,12 +3,14 @@ name: pr-labeler
on:
pull_request_target:
types: [opened, synchronize, reopened]
merge_group:
jobs:
triage:
runs-on: ubuntu-latest
if: github.event_name != 'merge_group'
steps:
- uses: actions/labeler@main
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true

View File

@ -44,7 +44,7 @@ env:
# to hit Github Limit of 6h per job.
jobs:
tasks:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 360
strategy:
fail-fast: false
@ -78,20 +78,28 @@ jobs:
ssh -oStrictHostKeyChecking=accept-new \
${IOTLAB_USER}@saclay.iot-lab.info exit
- name: Fetch host key from IoT-LAB lille site
# Not being used in the most recent release specs but kept in for
# backwords compatibility
if: ${{ matrix.pytest_mark == 'iotlab_creds' }}
run: |
IOTLAB_USER=$(cat ~/.iotlabrc | cut -f1 -d:)
ssh -oStrictHostKeyChecking=accept-new \
${IOTLAB_USER}@lille.iot-lab.info exit
- name: Fetch host key from IoT-LAB strasbourg site
if: ${{ matrix.pytest_mark == 'iotlab_creds' }}
run: |
IOTLAB_USER=$(cat ~/.iotlabrc | cut -f1 -d:)
ssh -oStrictHostKeyChecking=accept-new \
${IOTLAB_USER}@strasbourg.iot-lab.info exit
- name: Checkout Release-Specs
uses: actions/checkout@v2
uses: actions/checkout@main
with:
repository: RIOT-OS/Release-Specs
path: Release-Specs
fetch-depth: 1
ref: ${{ github.event.inputs.release_specs_version }}
- name: Checkout RIOT
uses: actions/checkout@v2
uses: actions/checkout@main
with:
repository: RIOT-OS/RIOT
path: RIOT
@ -116,7 +124,13 @@ jobs:
if: ${{ matrix.pytest_mark == 'not iotlab_creds' }}
run: |
sudo RIOT/dist/tools/tapsetup/tapsetup -c 11
- name: Install native dependencies
if: ${{ matrix.pytest_mark == 'not iotlab_creds' }}
run: |
sudo apt-get update
sudo apt-get install lib32asan6
- name: Run release tests
id: tests
timeout-minutes: 350
run: |
RIOTBASE="$GITHUB_WORKSPACE/RIOT"
@ -168,6 +182,27 @@ jobs:
mkdir test-reports/
junit2html ${REPORT_XML} ${REPORT_NAME}.html
cp ${REPORT_XML} ${REPORT_NAME}.xml
- name: Generate result message
if: always()
id: generate_results
run: |
if [ "${{ steps.tests.conclusion }}" == "success" ]; then
nice_str="&#x2705; **PASSED**"
elif [ "${{ steps.tests.conclusion }}" == "failure" ]; then
nice_str="&#x274C; **FAILED**"
fi
echo "nice_str=${nice_str}" >> ${GITHUB_OUTPUT}
- name: Report to Matrix channel
if: ${{ always() && steps.generate_results.outputs.nice_str != '' }}
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.RIOT_CI_RELEASE_REPORT_CHANNEL }}
access_token: ${{ secrets.MATRIX_RIOT_CI_ACCESS_TOKEN }}
server: "matrix.org"
message: >
${{ steps.generate_results.outputs.nice_str}}: Release tests
`[${{ join(matrix.*, ', ') }}]` on `${{ github.event_name }}`:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- uses: actions/upload-artifact@v2
if: always()
with:

View File

@ -4,6 +4,8 @@ on:
push:
branches:
- master
- staging
- trying
tags:
- '[0-9][0-9][0-9][0-9].[0-9][0-9]-RC[0-9]*'
- '[0-9][0-9][0-9][0-9].[0-9][0-9]'
@ -11,19 +13,27 @@ on:
pull_request:
branches:
- '*'
merge_group:
jobs:
static-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: set CI_BASE_BRANCH
run: |
if [ -n "${{ github.base_ref }}" ]; then
echo "CI_BASE_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
elif [ -n "${{ github.event.merge_group.base_ref }}" ]; then
echo "CI_BASE_BRANCH=${{ github.event.merge_group.base_ref }}" | sed s.=refs/heads/.=. >> $GITHUB_ENV
fi
- name: Setup git
run: |
# Note: ${{ github.base_ref }} is empty when not in a PR
if [ -n "${{ github.base_ref }}" ]; then
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} --no-tags
# Note: CI_BASE_BRANCH is empty when not in a PR
if [ -n "${CI_BASE_BRANCH}" ]; then
git fetch origin ${CI_BASE_BRANCH}:${CI_BASE_BRANCH} --no-tags
else
git config diff.renameLimit 16384
fi
@ -32,9 +42,9 @@ jobs:
run: docker pull riot/static-test-tools:latest
- name: Run static-tests
run: |
# Note: ${{ github.base_ref }} is empty when not in a PR
# Note: ${CI_BASE_BRANCH} is empty when not in a PR
docker run --rm \
-e CI_BASE_BRANCH=${{ github.base_ref }} \
-e CI_BASE_BRANCH \
-e GITHUB_RUN_ID=${GITHUB_RUN_ID} \
-v $(pwd):/data/riotbuild \
riot/static-test-tools:latest \

View File

@ -36,15 +36,11 @@ jobs:
- riot: dwm1001
iotlab:
archi: dwm1001:dw1000
site: saclay
site: toulouse
- riot: iotlab-m3
iotlab:
archi: m3:at86rf231
site: saclay
- riot: nrf51dk
iotlab:
archi: nrf51dk:ble
site: saclay
- riot: nrf52dk
iotlab:
archi: nrf52dk:ble
@ -53,10 +49,6 @@ jobs:
iotlab:
archi: nrf52840dk:multi
site: saclay
- riot: nrf52832-mdk
iotlab:
archi: nrf52832mdk:ble
site: saclay
- riot: nucleo-wl55jc
iotlab:
archi: nucleo-wl55jc:stm32wl
@ -85,12 +77,12 @@ jobs:
COMPILE_AND_TEST_FOR_BOARD: ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py
COMPILE_AND_TEST_ARGS: --with-test-only --jobs=2 --report-xml
# Exclude applications that are expected to fail or cannot run on iotlab
# - tests/periph_timer_short_relative_set is expected to fail
# - tests/periph/timer_short_relative_set is expected to fail
# - tests/riotboot requires the riotboot feature and provides a test
# but flashing at a specific offset is not (yet) supported on IoT-LAB
# so it will always fail because of that limitation
APPLICATIONS_EXCLUDE: tests/periph_timer_short_relative_set tests/riotboot
# Increase tolerance error with `tests/periph_timer_periodic` because
APPLICATIONS_EXCLUDE: tests/periph/timer_short_relative_set tests/riotboot
# Increase tolerance error with `tests/periph/timer_periodic` because
# of timing issues with the test script when running in the github
# actions environment
TEST_PERIPH_TIMER_PERIODIC_PRECISION: 0.30
@ -102,7 +94,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install iotlabcli pexpect riotctrl[rapidjson] junit-xml
pip install iotlabcli pexpect riotctrl[rapidjson] junit-xml scapy
- name: Configure credentials
run: echo '${{ secrets.IOTLABRC }}' > ~/.iotlabrc
- name: Setup SSH agent
@ -118,7 +110,7 @@ jobs:
run: |
docker pull riot/riotbuild:latest
- name: Checkout RIOT
uses: actions/checkout@v2
uses: actions/checkout@main
with:
ref: ${{ github.event.inputs.riot_version }}
- name: Launch IoT-LAB experiment

View File

@ -1,105 +0,0 @@
---
# Run 'compile_and_test_for_board.py' on connected boards.
#
# This workflow will run on a RYOT (Run Your Own Test) machine and launch
# all tests on all boards currently connected to that machine. This
# workflow relies on self-hosted runners, this means building and
# flashing happens on the self-hosted runner (all in docker). An alternative
# approach was used in https://github.com/RIOT-OS/RIOT/pull/14600, where
# the RYOT machine was only used for remote flashing, this is a better
# alternative if ssh access is possible.
#
# Documentation:
#
# * Setup a RYOT machine:
# https://github.com/fjmolinas/riot-ryot/blob/master/setup.md
#
# * Requirements (already filled by a RYOT machine):
# * Add one or more self-hosted runners:
# https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
# * All required flashing tools installed
# * udev rules that map all BOARD to /dev/riot/tty-$(BOARD), see
# http://riot-os.org/api/advanced-build-system-tricks.html#multiple-boards-udev
# * RIOT_MAKEFILES_GLOBAL_PRE that sets PORT and DEBUG_ADAPTER_ID for each
# BOARD
# * A list of connected BOARDs in JSON format so that fromJSON can be used
# to dynamically setup the matrix, e.g. make target providing this:
# https://github.com/fjmolinas/riot-ryot/blob/72fc9ad710a2219e942c5965a014e934822e9da5/template/conf/makefiles.pre#L19-L24
# * RYOT: https://github.com/fjmolinas/riot-ryot
name: test-on-ryot
on:
# Schedule weekly runs Saturday at 00:00 on master
schedule:
- cron: '0 0 * * 6'
push:
# Run on all new release candidates
tags:
- '[0-9][0-9][0-9][0-9].[0-9][0-9]-RC[0-9]*'
- '[0-9][0-9][0-9][0-9].[0-9][0-9]'
- '[0-9][0-9][0-9][0-9].[0-9][0-9].*'
env:
# self-hosted runners are started by a systemd which is not a "login" shell
# this means that no local environment variables are loaded (e.g. /etc/environment)
# when the runner is started. So explicitly set RIOT_MAKEFILES_GLOBAL_PRE
# to set PORT and DEBUG_ADAPTER_ID per BOARD
RIOT_MAKEFILES_GLOBAL_PRE: '/builds/conf/makefiles.pre'
jobs:
connected_boards:
name: Get Connected Boards
runs-on: self-hosted
outputs:
boards: ${{ steps.ci-connected-boards.outputs.boards }}
steps:
# Get all currently connected boards if not passed through an input
- id: ci-connected-boards
run: echo "::set-output name=boards::$(make -C /builds/boards/ list-boards-json --no-print-directory)"
# Runs all tests on connected boards
compile_and_test_for_board:
name: ${{ matrix.board }}
runs-on: self-hosted
needs: connected_boards
# ci-riot-tribe has 8 cores, parallelism will depend on actually configured
# runners
strategy:
max-parallel: 7
fail-fast: false
matrix:
board: ${{ fromJson(needs.connected_boards.outputs.boards) }}
env:
BUILD_IN_DOCKER: 1
COMPILE_AND_TEST_FOR_BOARD: /builds/boards/RIOT/dist/tools/compile_and_test_for_board/compile_and_test_for_board.py
# args for compile_and_test_for_board script
COMPILE_AND_TEST_ARGS: --with-test-only --report-xml --incremental
# environment vars for compile_and_test_for_board script to pass
# USEMODULE and CFLAGS use:
# DOCKER_ENVIRONMENT_CMDLINE=\'-e USEMODULE=<name>\'
# DOCKER_ENVIRONMENT_CMDLINE=\'-e CFLAGS=-D<flag>\'
COMPILE_AND_TEST_VARS: ''
APPLICATIONS: ''
# Exclude 'tests/periph_timer_short_relative_set' since its expected
# to fail on most BOARDs
APPLICATIONS_EXCLUDE: 'tests/periph_timer_short_relative_set'
steps:
- name: Checkout RIOT
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.riot_version }}
# Make sure it runs git clean -xdff before fetching
clean: true
- name: Run compile_and_test_for_board.py
run: |
${COMPILE_AND_TEST_VARS} ${COMPILE_AND_TEST_FOR_BOARD} . \
${{ matrix.board }} results-${{ matrix.board }} \
${COMPILE_AND_TEST_ARGS} \
--applications="${APPLICATIONS}" \
--applications-exclude="${APPLICATIONS_EXCLUDE}"
- name: Archive results
if: always()
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.board }}
path: results-${{ matrix.board }}

View File

@ -4,78 +4,67 @@ on:
push:
branches:
- master
- staging
- trying
tags:
- '*'
pull_request:
branches:
- '*'
merge_group:
jobs:
tools-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 16
matrix:
tools: # List of tools sorted by name in alphabetical order
- name: benchmark_udp
path: dist/tools
- name: bossa-1.8
path: dist/tools
- name: bossa-1.9
path: dist/tools
- name: bossa-nrf52
path: dist/tools
- name: calc_spi_scalers
path: cpu/kinetis/dist
- name: clk_conf
path: cpu/stm32/dist
- name: edbg
path: dist/tools
- name: ethos
path: dist/tools
- name: fixdep
path: dist/tools
- name: flatc
path: dist/tools
- name: lpc2k_pgm
path: dist/tools
- name: mosquitto_rsmb
path: dist/tools
- name: riotboot_serial
path: dist/tools
- name: setsid
path: dist/tools
- name: uhcpd
path: dist/tools
- name: zep_dispatch
path: dist/tools
steps:
- uses: actions/checkout@master
- name: Build flatc standalone
uses: aabadie/riot-action@v1
- uses: actions/checkout@main
- name: Build ${{ matrix.tools.name }} in ${{ matrix.tools.path }}
uses: aabadie/riot-action@main
with:
cmd: make -C dist/tools/flatc
- name: Build mosquitto_rsmb standalone
uses: aabadie/riot-action@v1
cmd: make -C ${{ matrix.tools.path }}/${{ matrix.tools.name }}
tools-build-success:
if: always()
needs: tools-build
runs-on: ubuntu-latest
steps:
- name: tools-build succeeded
uses: re-actors/alls-green@release/v1
with:
cmd: make -C dist/tools/mosquitto_rsmb
- name: Build bossa-1.8 standalone
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/bossa-1.8
- name: Build bossa-1.9 standalone
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/bossa-1.9
- name: Build bossa-nrf52 standalone
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/bossa-nrf52
- name: Build edbg standalone
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/edbg
- name: Build pic32prog standalone
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/pic32prog
- name: Build setsid standalone
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/setsid
- name: Build ethos
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/ethos
- name: Build uhcpd
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/uhcpd
- name: Build stm32 clk_conf
uses: aabadie/riot-action@v1
with:
cmd: make -C cpu/stm32/dist/clk_conf
- name: Build kinetis calc_spi_scalers
uses: aabadie/riot-action@v1
with:
cmd: make -C cpu/kinetis/dist/calc_spi_scalers
- name: Build fixdep tool
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/fixdep
- name: Build lpc2k_pgm tool
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/lpc2k_pgm
- name: Build riotboot_serial tool
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/riotboot_serial
- name: Build ZEP dispatcher & topology generator
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/zep_dispatch
jobs: ${{ toJSON(needs) }}

View File

@ -9,12 +9,14 @@ on:
pull_request:
branches:
- '*'
merge_group:
jobs:
python-tests:
if: github.event_name != 'merge_group'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
@ -24,6 +26,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install kconfiglib
sudo apt-get update
sudo apt-get install gcc-multilib
- name: Test backport_pr
run: cd dist/tools/backport_pr && tox
@ -35,3 +38,5 @@ jobs:
run: cd dist/pythonlibs/riotctrl_shell && tox
- name: Test kconfig script
run: cd dist/tools/kconfiglib/tests && ./test.sh
- name: Test compile_like_murdock script
run: cd dist/tools/compile_test/tests && ./test.sh

7
.gitignore vendored
View File

@ -37,7 +37,8 @@ cachegrind.out*
# Codelite (among others) project files
*.project
# Visual Studio Code user settings
.vscode/
.vscode/*
!.vscode/settings.json
# ctags index files
tags
# GDB initialization scripts
@ -93,3 +94,7 @@ keys/
# custom clang-tidy flags, also used when using clangd language server
.clang-tidy
# Environments
.venv
venv/

View File

@ -25,3 +25,4 @@ Peter Kietzmann <peter.kietzmann@haw-hamburg.de>
René Kijewski <rene.kijewski@fu-berlin.de>
René Kijewski <rene.kijewski@fu-berlin.de> <kijewski@mi.fu-berlin.de>
Sebastian Meiling <s@mlng.net>
Marian Buschsieweke <marian.buschsieweke@posteo.net> <marian.buschsieweke@ovgu.de>

383
.murdock
View File

@ -5,126 +5,43 @@
# and / or
#export APPS="examples/hello-world tests/unittests"
#
: ${TEST_BOARDS_AVAILABLE:="esp32-wroom-32 samr21-xpro"}
QUICKBUILD_BOARDS="
adafruit-itsybitsy-m4
atmega256rfr2-xpro
esp32-wroom-32
esp32s3-devkit
frdm-k64f
hifive1b
msb-430
msba2
native
native64
nrf52840dk
qn9080dk
samr21-xpro
stk3200
stm32f429i-disc1"
# this configures boards that are available via pifleet
case "${CI_MURDOCK_PROJECT}" in
riot)
: ${TEST_BOARDS_AVAILABLE:="esp32-wroom-32 samr21-xpro"}
;;
riot-staging)
: ${TEST_BOARDS_AVAILABLE:=""}
;;
*)
: ${TEST_BOARDS_AVAILABLE:=""}
;;
esac
#: ${EMULATED_BOARDS_AVAILABLE:="microbit"}
# temporarily disabling llvm builds until https://github.com/RIOT-OS/RIOT/pull/15595
# is in
#: ${TEST_BOARDS_LLVM_COMPILE:="iotlab-m3 native nrf52dk mulle nucleo-f401re samr21-xpro slstk3402a"}
: ${TEST_BOARDS_LLVM_COMPILE:=""}
: ${TEST_BOARDS_LLVM_COMPILE:="iotlab-m3 native native64 nrf52dk mulle nucleo-f401re samr21-xpro slstk3402a"}
: ${TEST_KCONFIG_BOARDS_AVAILABLE:="
adafruit-itsybitsy-m4
arduino-due
arduino-leonardo
arduino-mkrzero
arduino-mega2560
arduino-nano
atxmega-a1-xplained
atxmega-a3bu-xplained
avr-rss2
avsextrem
bastwan
bluepill
b-l475e-iot01a
cc1352-launchpad
cc2650-launchpad
derfmega128
dwm1001
esp32-ci
esp32-heltec-lora32-v2
esp8266-ci
esp8266-esp-12x
hamilton
hifive1
mbed_lpc1768
mega-xplained
microbit
mulle
native
nrf52840dk
nrf9160dk
nucleo-f072rb
nucleo-f103rb
nucleo-f207zg
nucleo-f334r8
nucleo-f429zi
nucleo-f767zi
nucleo-g071rb
nucleo-g474re
nucleo-l011k4
nucleo-l073rz
nucleo-l152re
nucleo-l433rc
nucleo-l552ze-q
p-nucleo-wb55
qn9080dk
remote-revb
same54-xpro
samr21-xpro
seeedstudio-gd32
slstk3400a
sltb001a
slwstk6220a
stm32f723e-disco
stm32mp157c-dk2
waspmote-pro
weact-f401ce
z1
"}
: ${TEST_KCONFIG_ENFORCE_APP_GROUPS:="
tests/cb_mux*
tests/congure_*
tests/driver_b*
tests/driver_f*
tests/driver_g*
tests/driver_h*
tests/driver_i*
tests/driver_j*
tests/driver_l*
tests/driver_o*
tests/driver_p*
tests/driver_q*
tests/driver_r*
tests/driver_s*
tests/driver_t*
tests/driver_u*
tests/driver_v*
tests/external_board_dirs
tests/periph_*
tests/pkg_elk
tests/pkg_uzlib
tests/prng_*
tests/trace
tests/xtimer_*
tests/ztimer_*
examples/hello-world
tests/ieee802154_hal
"}
# This list prevents boards from being tested by the TEST_KCONFIG_TEST_ALLOWLIST
# This should only be used for boards that require a lot of work, such as,
# requiring modelling of a clock tree.
# As a rule of thumb, only add boards here if there are not differences in
# modules or packages.
# Eventually this list will be removed...
#
: ${TEST_KCONFIG_BOARD_BLOCKLIST:="
6lowpan-clicker
pic32-wifire
"}
# This list will force all boards that are not in the TEST_KCONFIG_BOARD_BLOCKLIST
# to be tested on the apps. The purpose is to prevent new boards from skipping
# the kconfig implementations.
: ${TEST_KCONFIG_TEST_ALLOWLIST:="
examples/hello-world
tests/saul
tests/mtd_mapper
"}
: ${TEST_WITH_CONFIG_SUPPORTED:="examples/suit_update tests/driver_at86rf2xx_aes"}
: ${TEST_WITH_CONFIG_SUPPORTED:="examples/suit_update tests/drivers/at86rf2xx_aes"}
export RIOT_CI_BUILD=1
export CC_NOCOLOR=1
@ -133,9 +50,60 @@ export CFLAGS_DBG=""
export DLCACHE_DIR=${DLCACHE_DIR:-~/.dlcache}
export ENABLE_TEST_CACHE=${ENABLE_TEST_CACHE:-1}
export MURDOCK_REDIS_HOST=${MURDOCK_REDIS_HOST:-127.0.0.1}
NIGHTLY=${NIGHTLY:-0}
RUN_TESTS=${RUN_TESTS:-${NIGHTLY}}
FULL_BUILD=${FULL_BUILD:-${NIGHTLY}}
check_label() {
local label="${1}"
[ -z "${CI_PULL_LABELS}" ] && return 1
echo "${CI_PULL_LABELS}" | grep -q "${label}"
return $?
}
# true if "$2" starts with "$1", false otherwise
startswith() {
case "${2}" in
${1}*) true ;;
*) false ;;
esac
}
# this function returns 0 when this build is building a merge queue branch.
is_merge_queue_build() {
startswith "gh-readonly-queue/" "${CI_BUILD_BRANCH}"
}
# fullbuild logic
# non-full-builds are those where can_fast_ci_run might reduce the build
# automatically
if [ -z "${FULL_BUILD}" ]; then
if [ "${NIGHTLY}" = 1 ]; then
FULL_BUILD=1
elif check_label "CI: full build"; then
# full build if requested by label
FULL_BUILD=1
else
FULL_BUILD=0
fi
export FULL_BUILD
fi
# quickbuild logic
# a "quickbuild" is only building a representative subset of all build
# configurations.
if [ -z "${QUICK_BUILD}" ]; then
export QUICK_BUILD=0
if is_merge_queue_build; then
# always do full build for merge queue' branches
true
elif [ ${FULL_BUILD} -eq 1 ]; then
# full build if building nightly or full build requested by label
true
else
export QUICK_BUILD=1
fi
fi
# This is a work around for a bug in CCACHE which interacts very badly with
# some features of RIOT and of murdock. The result is that ccache is
@ -156,7 +124,8 @@ export OPTIONAL_CFLAGS_BLACKLIST="-gz"
DWQ_ENV="-E BOARDS -E APPS -E NIGHTLY -E RUN_TESTS -E ENABLE_TEST_CACHE
-E TEST_HASH -E CI_PULL_LABELS -ECI_BASE_BRANCH -ECI_BASE_COMMIT
-EPKG_USE_MIRROR -EAPPS_CHANGED -EBOARDS_CHANGED -ESTATIC_TESTS"
-EPKG_USE_MIRROR -EAPPS_CHANGED -EBOARDS_CHANGED -ESTATIC_TESTS
-E CI_MURDOCK_PROJECT -EFULL_BUILD -EQUICK_BUILD"
if [ ${NIGHTLY} -eq 1 ]; then
export PKG_USE_MIRROR=0
@ -164,64 +133,16 @@ fi
CFCR_ARGS="--upstreambranch ${CI_BASE_COMMIT}"
get_supported_kconfig_board_app() {
local board=$1
local appdir=$2
if is_in_list "${board}" "${TEST_KCONFIG_BOARD_BLOCKLIST}"; then
return 1
# if RUN_TESTS is unset (e.g., not passed from the outside),
# set to 1 if NIGHTLY=1 or if the label "CI: run tests" is set,
# otherwise set 0.
if [ -z "$RUN_TESTS" ]; then
if [ "$NIGHTLY" = "1" ] || check_label "CI: run tests" ; then
RUN_TESTS=1
else
RUN_TESTS=0
fi
# On nightlies run all possible kconfig tests on all boards
# Normally we don't want to do this as it adds quite a bit to build time
# and the subset of boards we are testing for are pretty good at catching
# any bugs...
# This will be over one day, I promise.
if [ ${NIGHTLY} -eq 1 ]; then
if is_in_list "${appdir}" "${TEST_KCONFIG_ENFORCE_APP_GROUPS}"; then
return 0
fi
if [ -f "${appdir}/app.config.test" ]; then
return 0
fi
fi
if is_in_list "${appdir}" "${TEST_KCONFIG_TEST_ALLOWLIST}"; then
return 0
fi
if is_in_list "${board}" "${TEST_KCONFIG_BOARDS_AVAILABLE}"; then
if is_in_list "${appdir}" "${TEST_KCONFIG_ENFORCE_APP_GROUPS}"; then
return 0
fi
if [ -f "${appdir}/app.config.test" ]; then
return 0
fi
fi
return 1
}
kconfig_module_packages_diff() {
local board=$1
local appdir=$2
make clean --no-print-directory -C ${appdir} BOARD=${board}
mmp=$(make --no-print-directory info-modules info-packages -C ${appdir} BOARD=${board})
make clean --no-print-directory -C ${appdir} BOARD=${board}
kmp=$(TEST_KCONFIG=1 make --no-print-directory info-modules info-packages -C ${appdir} BOARD=${board})
bash -c "diff <(echo \"${mmp}\") <(echo \"${kmp}\")"
}
check_label() {
local label="${1}"
[ -z "${CI_PULL_LABELS}" ] && return 1
echo "${CI_PULL_LABELS}" | grep -q "${label}"
return $?
}
[ "$RUN_TESTS" != "1" ] && {
check_label "CI: run tests" && RUN_TESTS=1
}
fi
[ "$ENABLE_TEST_CACHE" = "1" ] && {
check_label "CI: disable test cache" && export ENABLE_TEST_CACHE=0
@ -232,14 +153,6 @@ error() {
exit 1
}
# true if "$2" starts with "$1", false otherwise
startswith() {
case "${2}" in
${1}*) true ;;
*) false ;;
esac
}
# if MURDOCK_HOOK is set, this function will execute it and pass on all it's
# parameters. should the hook script exit with negative exit code, hook() makes
# this script exit with error, too.
@ -318,9 +231,14 @@ get_supported_boards() {
fi
fi
BOARDS_=${BOARDS}
if [ $only_changed -eq 1 ]; then
BOARDS_=${BOARDS}
# if can_fast_ci_run figured out changes to specific boards,
# only consider those
export BOARDS="$BOARDS_CHANGED"
elif [ -z "${BOARDS}" -a ${QUICK_BUILD} -eq 1 ]; then
# quickbuild board filter is applied here
export BOARDS="${QUICKBUILD_BOARDS}"
fi
local boards="$(make --no-print-directory -C$appdir info-boards-supported 2>/dev/null || echo broken)"
@ -362,7 +280,7 @@ get_app_board_toolchain_pairs() {
local prefix="$*"
if [ "$boards" = makefile_broken ]; then
echo "$appdir makefile_broken"
echo "$0 error \"error: ${DWQ_WORKER}: get_supported_boards failed in $appdir\""
return
fi
@ -442,50 +360,44 @@ compile() {
[ $# -ne 2 ] && error "$0: compile: invalid parameters (expected \$appdir \$board:\$toolchain)"
[ ! -d "$appdir" ] && error "$0: compile: error: application directory \"$appdir\" doesn't exist"
# We compile a first time with Kconfig based dependency
# resolution for regression purposes. $TEST_KCONFIG contains a
# list of board-application tuples that are currently modeled to
# run with Kconfig
# use our checkout as ccache temporary folder.
# On CI, this is a tmpfs, so using that instead of the `/cache/.ccache` volume
# reduces disk IO.
export CCACHE_TEMPDIR="$(pwd)/.ccache/tmp"
should_check_kconfig_hash=0
if get_supported_kconfig_board_app "${board}" "${appdir}"; then
should_check_kconfig_hash=1
BOARD=${board} make -C${appdir} clean
CCACHE_BASEDIR="$(pwd)" BOARD=${board} TOOLCHAIN=${toolchain} RIOT_CI_BUILD=1 TEST_KCONFIG=1 \
make -C${appdir} all test-input-hash -j${JOBS:-4}
RES=$?
if [ $RES -eq 0 ]; then
kconfig_test_hash=$(test_hash_calc "${BINDIR}")
else
kconfig_test_hash=0
echo "An error occurred while compiling using Kconfig";
fi
fi
# compile without Kconfig
BOARD=${board} make -C${appdir} clean
CCACHE_BASEDIR="$(pwd)" BOARD=$board TOOLCHAIN=$toolchain RIOT_CI_BUILD=1 \
make -C${appdir} clean all test-input-hash -j${JOBS:-4}
make -C${appdir} all test-input-hash -j${JOBS:-4}
RES=$?
# test hash is used to cache test results
test_hash=$(test_hash_calc "$BINDIR")
if [ ${should_check_kconfig_hash} != 0 ]; then
if [ ${kconfig_test_hash} != ${test_hash} ]; then
echo "Hashes of binaries with and without Kconfig mismatch for ${appdir} with ${board}";
echo "Please check that all used modules are modelled in Kconfig and enabled";
kconfig_module_packages_diff ${board} ${appdir}
RES=1
fi
fi
# run tests
if [ $RES -eq 0 ]; then
if [ $RUN_TESTS -eq 1 -o "$board" = "native" ]; then
if is_in_list "$board" "$EMULATED_BOARDS_AVAILABLE"; then
EMULATED=1
else
EMULATED=0
fi
if [ $RUN_TESTS -eq 1 -o "$board" = "native" -o "$board" = "native64" -o "$EMULATED" = "1" ]; then
if [ -f "${BINDIR}/.test" ]; then
if [ "$board" = "native" ]; then
BOARD=$board make -C${appdir} test
RES=$?
if [ "$board" = "native" -o "$board" = "native64" -o "${EMULATED}" = "1" ]; then
# For native, we can run the test on the worker that also
# compiled it (`make -C${appdir} test`).
# "dwq-localjob" allows using some (locally run) command's
# output as if it was its own CI job.
# We use this here so the output shows up in the Murdock UI
# under the "Tests" tab and not inlined with the "Build"
# output.
# "--command-override" is a hack that makes the job fake the
# command. This is currently needed for the Murdock UI to
# properly categorize the job result.
EMULATE=${EMULATED} BOARD=$board TOOLCHAIN=$toolchain \
dwq-localjob \
--command-override "./.murdock run_test ${appdir} ${board}:${toolchain}" \
-- make -C${appdir} test
elif is_in_list "$board" "$TEST_BOARDS_AVAILABLE"; then
echo "-- test_hash=$test_hash"
if test_cache_get $test_hash; then
@ -500,10 +412,10 @@ compile() {
fi
fi
# log some build stats
if [ -d ${BINDIR} ]
then
echo "-- build directory size: $(du -sh ${BINDIR} | cut -f1)"
echo "{\"build/\": $(du -s ${BINDIR} | cut -f1)}"
# cleanup
rm -rf ${BINDIR}
fi
@ -516,24 +428,23 @@ test_job() {
local board=$(echo $2 | cut -f 1 -d':')
local toolchain=$(echo $2 | cut -f 2 -d':')
# this points to the dwq checkout root folder
local basedir="$(pwd)"
# interpret any extra arguments as file names.
# They will be sent along with the job to the test worker
# and stored in the application's binary folder.
shift 2
local files=""
for filename in "$@"; do
# check if the file is within $(BINDIR)
if startswith "${BINDIR}" "${filename}"; then
# get relative (to $(BINDIR) path
local relpath="$(realpath --relative-to ${BINDIR} ${filename})"
# check if the file is within $(basedir)
if startswith "${basedir}" "${filename}"; then
filename="$(realpath --relative-to ${basedir} ${filename})"
else
error "$0: error: extra test files not within \${BINDIR}!"
error "$0: error: extra test files not within \${basedir}!"
fi
# set remote file path.
# currently, the test workers build in the default build path.
local remote_bindir="${appdir}/bin/${board}"
files="${files} --file ${filename}:${remote_bindir}/${relpath}"
files="${files} --file ${filename}"
done
dwqc \
@ -549,12 +460,20 @@ run_test() {
local appdir=$1
local board=$(echo $2 | cut -f 1 -d':')
local toolchain=$(echo $2 | cut -f 2 -d':')
# set build directory to match the builder
export BINDIR="$(pwd)/build"
print_worker
echo "-- executing tests for $appdir on $board (compiled with $toolchain toolchain):"
hook run_test_pre
# do flashing and building of termdeps simultaneously
BOARD=$board TOOLCHAIN=${toolchain} make -C$appdir flash-only termdeps -j2
RES=$?
if [ $RES -ne 0 ]; then
error "- flashing failed!"
fi
# now run the actual test
if is_in_list "${appdir}" "${TEST_WITH_CONFIG_SUPPORTED}"; then

21
.murdock.yml Normal file
View File

@ -0,0 +1,21 @@
push:
branches:
# these two enable potential bors support:
- '^staging$'
- '^trying$'
# github merge trains:
- '^gh-readonly-queue/'
pr:
enable_comments: true
sticky_comment: true
comment_artifacts:
- name: doc-preview/
readable_name: Documentation preview
commit:
skip_keywords: ["ci_skip", "murdock_skip", "[ci skip]" ]
artifacts:
- output.txt
- doc-preview/

11
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"configurations": [
{
"name": "RIOT",
"cStandard": "c11",
"cppStandard": "c++17",
"compileCommands": "${workspaceFolder}/compile_commands.json"
}
],
"version": 4
}

20
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"editor.rulers": [
80,
100
],
"editor.detectIndentation": false,
"files.insertFinalNewline": true,
"files.associations": {
"Makefile.*": "makefile",
"*.mk": "makefile"
},
"[shellscript][c][cpp]": {
"editor.tabSize": 4,
"editor.insertSpaces": true,
},
"[makefile]": {
"editor.tabSize": 2,
"editor.insertSpaces": true,
},
}

View File

@ -11,18 +11,18 @@
/boards/common/atxmega/ @nandojve
/boards/common/esp*/ @gschorcht
/boards/common/nrf*/ @aabadie @haukepetersen
/boards/common/nrf*/ @aabadie
/boards/common/nucleo*/ @aabadie
/boards/common/silabs/ @basilfx
/boards/common/slwstk6000b/ @basilfx
/boards/common/stm32/ @aabadie @fjmolinas
/boards/common/stm32/ @aabadie
/boards/e180-zg120b-tb/ @basilfx
/boards/esp*/ @gschorcht @yegorich
/boards/hamilton/ @Hyungsin
/boards/ikea-tradfri/ @basilfx
/boards/lobaro-lorabox/ @leandrolanzieri
/boards/nrf*/ @aabadie @haukepetersen
/boards/nucleo*/ @aabadie @fjmolinas
/boards/nrf*/ @aabadie
/boards/nucleo*/ @aabadie
/boards/phynode-kw41z/ @jia200x
/boards/sam*-xpro/ @dylad
/boards/same54-xpro/ @benpicco
@ -43,26 +43,20 @@
/cpu/avr8_common/ @kYc0o @maribu @nandojve
/cpu/atmega*/ @kYc0o @maribu
/cpu/atxmega/ @nandojve
/cpu/cc2538/ @hexluthor @smlng @fjmolinas
/cpu/cc26x0/ @hexluthor @smlng
/cpu/cc26x2_cc13x2/ @hexluthor @smlng
/cpu/cc26xx_cc13xx/ @hexluthor @smlng
/cpu/cortexm_common/ @kaspar030 @bergzand
/cpu/efm32/ @basilfx
/cpu/esp*/ @gschorcht
/cpu/fe310/ @aabadie @kaspar030 @bergzand
/cpu/kinetis/ @fjmolinas
/cpu/lpc2387/ @benpicco @maribu
/cpu/mips*/ @kaspar030 @francois-berder
/cpu/msp430*/ @kaspar030 @gschorcht
/cpu/nrf*/ @aabadie @haukepetersen
/cpu/nrf52/radio/nrf802154/ @bergzand @SemjonKerner @jia200x
/cpu/nrf*/ @aabadie
/cpu/nrf52/radio/nrf802154/ @bergzand @jia200x
/cpu/sam0_common/ @benpicco @dylad @keestux
/cpu/samd21/ @dylad @biboc
/cpu/samd5x/ @benpicco @dylad
/cpu/saml1x/ @dylad
/cpu/saml21/ @dylad
/cpu/stm32*/ @aabadie @fjmolinas @DipSwitch @vincent-d
/cpu/stm32*/ @aabadie @vincent-d
/cpu/stm32/periph/eth* @maribu
/cpu/stm32/periph/ptp.c @maribu
@ -74,13 +68,12 @@
/drivers/ad7746/ @leandrolanzieri
/drivers/at24mac/ @benpicco
/drivers/at86rf215/ @benpicco
/drivers/at86rf2xx/ @daniel-k @Hyungsin @jia200x @smlng @miri64
/drivers/at86rf2xx/ @daniel-k @Hyungsin @jia200x @miri64
/drivers/bh1900nux/ @wosym
/drivers/bq2429x/ @jeandudey
/drivers/cc110x/ @maribu
/drivers/cc1xxx_common/ @maribu
/drivers/ccs811/ @gschorcht
/drivers/enc28j60/ @haukepetersen
/drivers/dcf77/ @daexel
/drivers/dht/ @wosym
/drivers/dose/ @jue89
@ -94,12 +87,13 @@
/drivers/slipdev/ @miri64
/drivers/sx127x/ @aabadie @jia200x
/drivers/ws281x/ @maribu
/drivers/xbee/ @haukepetersen @miri64
/drivers/xbee/ @miri64
/drivers/include/periph/ @MrKevinWeiss
/drivers/periph_common/ @MrKevinWeiss
/drivers/include/periph/ptp.h @maribu
/pkg/cryptoauthlib/ @Einhornhool @PeterKietzmann
/pkg/libschc/ @bartmoons @miri64
/pkg/lua/ @jcarrano
/pkg/lwip/ @miri64
/pkg/gecko_sdk/ @basilfx
@ -108,6 +102,7 @@
/pkg/openthread/ @Hyungsin @jia200x
/pkg/semtech-loramac/ @aabadie @jia200x
/pkg/tinydtls/ @rfuentess @leandrolanzieri
/pkg/tinyvcdiff/ @jue89
/pkg/u8g2/ @basilfx
/pkg/ucglib/ @basilfx
/pkg/wakaama/ @leandrolanzieri
@ -116,8 +111,8 @@
/sys/event/ @kaspar030
/sys/evtimer/ @kaspar030
/sys/fmt/ @kaspar030
/sys/net/application_layer/gcoap/ @haukepetersen @kb2ma @chrysn
/sys/net/application_layer/nanocoap/ @kaspar030 @haukepetersen @kb2ma @chrysn
/sys/net/application_layer/gcoap/ @chrysn
/sys/net/application_layer/nanocoap/ @kaspar030 @chrysn
/sys/include/net/sock* @maribu
/sys/net/netif/ @miri64 @jia200x
/sys/net/gnrc/network_layer/ @miri64
@ -125,12 +120,12 @@
/sys/net/gnrc/transport_layer/udp/ @miri64
/sys/net/gnrc/link_layer/lorawan/ @jia200x
/sys/net/gnrc/netif/ @miri64 @jia200x
/sys/net/gnrc/routing/rpl/ @cgundogan @emmanuelsearch
/sys/net/ @miri64 @haukepetersen @PeterKietzmann @cgundogan
/sys/net/gnrc/routing/rpl/ @emmanuelsearch
/sys/net/ @miri64 @PeterKietzmann
/sys/pm_layered/ @kaspar030
/sys/random/fortuna/ @basilfx
/sys/riotboot/ @kaspar030 @fjmolinas
/sys/suit @kaspar030 @fjmolinas @bergzand
/sys/riotboot/ @kaspar030
/sys/suit @kaspar030 @bergzand
/sys/tsrb/ @kaspar030
/sys/usb/ @bergzand @dylad @aabadie
/sys/xtimer/ @kaspar030 @MichelRottleuthner
@ -139,17 +134,18 @@
/sys/include/ztimer/ @kaspar030 @bergzand
/sys/ztimer/ @kaspar030 @bergzand
/tests/ @smlng @leandrolanzieri @aabadie @MichelRottleuthner @fjmolinas
/tests/candev/ @wosym
/tests/driver_bq2429x/ @jeandudey
/tests/driver_dht/ @wosym
/tests/gnrc* @miri64
/tests/lwip* @miri64
/tests/slip/ @miri64
/tests/ @leandrolanzieri @aabadie @MichelRottleuthner
/tests/drivers/candev/ @wosym
/tests/drivers/bq2429x/ @jeandudey
/tests/drivers/dht/ @wosym
/tests/net/gnrc* @miri64
/tests/pkg/lwip* @miri64
/tests/pkg/libschc/ @miri64
/tests/net/slip/ @miri64
/tests/unittests @miri64
/tests/*/tests/*.py @miri64
/tests/cpu_efm32_features/ @basilfx
/tests/cpu/efm32_features/ @basilfx
# KConfig maintainers will be notified about all KConfig changes
Kconfig @leandrolanzieri @jia200x @cgundogan
Kconfig @leandrolanzieri @jia200x @MrKevinWeiss
pm.c @kaspar030

View File

@ -257,7 +257,7 @@ Wrong:
functionality.
* Every function must be documented - including parameters and return value.
An examplary doxygen documentation in a header file can look like this.
An exemplary doxygen documentation in a header file can look like this.
```
/*
@ -301,9 +301,7 @@ Some solutions to correctly handle compilation warnings.
Solution for string formatting errors:
* When printing a `size_t`
* use `%u` and cast the variable to `(unsigned)` because `newlib-nano` does
not support `%zu`
[example](https://github.com/RIOT-OS/RIOT/blob/e19f6463c09fc22c76c5b855799054cf27a697f1/tests/sizeof_tcb/main.c#L34)
* use `PRIuSIZE` from `architecture.h` because `newlib-nano` does not support `%zu`
* When printing an `unsigned char/uint8_t`
* Use `%u` because `newlib-nano` does not support `%hu/PRIu8`
[example](https://github.com/RIOT-OS/RIOT/pull/4851)

View File

@ -195,15 +195,11 @@ into the source repository.
* Try to answer reviews as quickly as possible to speed up the review process
and avoid stalled PRs.
You can find more information about RIOT development procedure on this
[wiki page][development-procedures].
[about-pull-requests]: https://help.github.com/articles/about-pull-requests/
[development-models]: https://help.github.com/articles/creating-a-pull-request-from-a-fork
[existing-pull-requests]: https://github.com/RIOT-OS/RIOT/pulls
[archived-pull-requests]: https://github.com/RIOT-OS/RIOT/pulls?q=is:pr+label:"State:+archived"
[uncrustify]: http://uncrustify.sourceforge.net
[development-procedures]: https://github.com/RIOT-OS/RIOT/wiki/Development-procedures
## Writing Documentation
[writing-documentation]: #writing-documentation

View File

@ -18,16 +18,16 @@ rsource "kconfigs/Kconfig.errors"
# For now, get used modules as macros from this file (see kconfig.mk)
osource "$(KCONFIG_GENERATED_DEPENDENCIES)"
# Load first board configurations, which might override CPU's
# Load first the application configuration, as it may declare symbols in priority
osource "$(APPDIR)/Kconfig"
# Load board configurations, which might override CPU's
orsource "$(BOARDDIR)/Kconfig"
orsource "$(RIOTCPU)/$(CPU)/Kconfig"
rsource "$(RIOTBOARD)/Kconfig"
rsource "$(RIOTCPU)/Kconfig"
# The application may declare new symbols as well
osource "$(APPDIR)/Kconfig"
rsource "core/Kconfig"
rsource "drivers/Kconfig"
rsource "sys/Kconfig"

50
LICENSE
View File

@ -6,6 +6,10 @@
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
@ -452,3 +456,49 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -42,6 +42,15 @@ This way, their names are never removed from the RIOT repository.
# Removed Features
### cpu/mips* [6cad5d24771ba6199228351a11b5062cd2e9b36d]
Author:
- Neil Jones <Neil.Jones@imgtec.com>
Reasons for removal:
- Not maintained anymore
- Current state is not very useful and nobody claimed to use it
### pkg/libcoap [d83d08f0995a88f399e70a7d07b44dd780082436]
Author:

View File

@ -1,11 +1,11 @@
# RIOT Maintainer Guidelines
This list presents a series of guidelines for maintainers, including technical
and non-technical. The list is not exhaustive, and represents a baseline on
This list presents a series of technical and non-technical guidelines for maintainers.
The list is not exhaustive, it represents a baseline on
things that should be ensured for contributions.
Notes:
- Any of the items in this list might be skipped, if clearly and logically
- Any of the items in this list can be skipped, if clearly and logically
articulated reasons are presented.
- The order of the steps is meant to maximize efficiency and minimize
overhead, with the philosophy that failing in step n makes steps n+x
@ -14,9 +14,9 @@ Notes:
state (for example, due to poor code cleanliness or overall design), it
might be more efficient to give the contributor some broader comments for
improvement before further review.
- This is a working document and any changes, additions, or other discussions
- This is a working document: any changes, additions, or other discussions
are encouraged, via PRs raised against the document. Changes to this
document should however have at least two ACKs, to ensure these guidelines
document should have at least two ACKs, to ensure these guidelines
are well thought out, and that they reflect community consensus.
The [list of maintainers] gives information on the current maintainers and the
@ -54,7 +54,7 @@ the overall validity of the PR.
### 2. - Review the design of the code
The following list is not exhaustive and addresses the coding issues we have
The following list is not exhaustive, it addresses the coding issues we have
regularly seen in the past. In particular, check that the [Best Practices]
are followed. These checks can be aided (but not replaced) by a tool such as
Coccinelle, using the script found in dist/tools/coccinelle.
@ -99,7 +99,6 @@ complete that no input from the original developer or maintainer is required.
3. Are critical/hard to understand parts in the code documented?
4. Check grammar and spelling of documentation
## Non-technical guidelines
### Interaction with contributors
@ -116,7 +115,7 @@ complete that no input from the original developer or maintainer is required.
means we are investing in our community.
- Be friendly. Respect the original author, bearing in mind that their coding
style or their design may be just as valid as the way you would have done
it. And of course, always follow the [Code of Conduct].
it and of course, always follow the [Code of Conduct].
- If a contributor has opened a PR, the reviewer should attempt to
help the author of the contribution to get it to its best shape and
according to the RIOT Standard™. If there is disagreement, its important
@ -135,14 +134,14 @@ Rather, give your verbal ACK and describe what you reviewed. In addition, if you
processed or reasonably stepped over a whole section, mark the PR with the
according label from the "Reviewed:" category. If you set a label by stepping
over a section, please articulate your reasoning for this clearly, as noted in
the [introduction](#introduction). This will help other maintainers help to
the [introduction](#introduction). This will help other maintainers to
better understand your line of thought. If you disagree with the assessment of
a previous review, you may remove a certain "Reviewed:" label. Please state your
reasoning in this case as well.
When all "Reviewed:" labels are set you may give your approval for the PR.
As everything in this document this is a "CAN", not a "MUST": It might help
As for everything in this document this is a "CAN", not a "MUST": It might help
other maintainers to track your work, but if the overhead isn't justified, a
simple approving ACK might suffice.

View File

@ -7,6 +7,9 @@ all: welcome
@exit 1
doc:
@./dist/tools/features_yaml2mx/features_yaml2mx.py \
features.yaml \
--output-md doc/doxygen/src/feature_list.md
"$(MAKE)" -BC doc/doxygen
doc-man:
@ -30,22 +33,40 @@ distclean: docclean pkg-clean
@echo "Cleaning all build products"
@for dir in $(APPLICATION_DIRS); do "$(MAKE)" -C$$dir distclean; done
welcome:
@echo "Welcome to RIOT - The friendly OS for IoT!"
@echo ""
@echo "You executed 'make' from the base directory."
@echo "You should run 'make' in your application's directory instead."
@echo ""
@echo "Please see our Quick Start Guide at:"
@echo " https://doc.riot-os.org/getting-started.html"
@echo "You can ask questions or discuss with other users on our forum:"
@echo " https://forum.riot-os.org"
print-versions:
@./dist/tools/ci/print_toolchain_versions.sh
generate-features:
@./dist/tools/features_yaml2mx/features_yaml2mx.py \
features.yaml \
--output-makefile makefiles/features_existing.inc.mk
include makefiles/boards.inc.mk
include makefiles/app_dirs.inc.mk
include makefiles/tools/riotgen.inc.mk
-include makefiles/tests.inc.mk
include makefiles/color.inc.mk
welcome:
@echo "Welcome to RIOT - The friendly OS for IoT!"
@echo ""
@echo "You executed 'make' from the base directory."
@echo "Usually, you should run 'make' in your application's directory instead."
@echo ""
@echo "Please see our Quick Start Guide at:"
@echo " https://doc.riot-os.org/getting-started.html"
@echo "You can ask questions or discuss with other users on our forum:"
@echo " https://forum.riot-os.org"
@echo ""
@echo "Available targets for the RIOT base directory include:"
@echo " generate-{board,driver,example,module,pkg,test,features}"
@echo " info-{applications,boards,emulated-boards} info-applications-supported-boards"
@echo " print-versions"
@echo " clean distclean pkg-clean"
@echo " doc doc-{man,latex}"
@echo ""
@echo "==> tl;dr Try running:"
@echo " cd examples/default"
@echo " make BOARD=<INSERT_BOARD_NAME>"

View File

@ -19,6 +19,9 @@ include $(RIOTBASE)/drivers/Makefile.dep
# pull Makefile.dep of each driver modules if they exist
-include $(sort $(USEMODULE:%=$(RIOTBASE)/drivers/%/Makefile.dep))
# pull Makefile.dep of each sys modules if they exist
-include $(sort $(USEMODULE:%=$(RIOTBASE)/sys/%/Makefile.dep))
# pull dependencies from packages
-include $(PKG_PATHS:%=%Makefile.dep)
@ -30,6 +33,10 @@ ifneq (,$(filter mpu_noexec_ram,$(USEMODULE)))
FEATURES_REQUIRED += cortexm_mpu
endif
ifneq (,$(filter pmp_noexec_ram,$(USEMODULE)))
FEATURES_REQUIRED += periph_pmp
endif
ifneq (,$(filter lwip_%,$(USEMODULE)))
USEPKG += lwip
endif
@ -72,6 +79,11 @@ ifneq (,$(filter fatfs_vfs,$(USEMODULE)))
USEMODULE += vfs
endif
ifneq (,$(filter lwext%_vfs,$(USEMODULE)))
USEPKG += lwext4
USEMODULE += vfs
endif
ifneq (,$(filter nimble_%,$(USEMODULE)))
USEPKG += nimble
endif
@ -84,6 +96,14 @@ ifneq (,$(filter tinydtls_sock_dtls, $(USEMODULE)))
USEPKG += tinydtls
endif
ifneq (,$(filter flashdb_%,$(USEMODULE)))
USEPKG += flashdb
endif
ifneq (,$(filter tinyusb_%, $(USEMODULE)))
USEPKG += tinyusb
endif
# always select gpio (until explicit dependencies are sorted out)
FEATURES_OPTIONAL += periph_gpio

View File

@ -13,7 +13,7 @@ include $(BOARDDIR)/Makefile.features
# Sanity check
ifeq (,$(CPU))
$(error CPU must be defined by board / board_common Makefile.features)
$(error $(BOARD): CPU must be defined by board / board_common Makefile.features)
endif
include $(RIOTCPU)/$(CPU)/Makefile.features
@ -23,4 +23,11 @@ FEATURES_PROVIDED += cpu_$(CPU)
# Features that are conflicting for all architectures
FEATURES_CONFLICT += picolibc:newlib
FEATURES_CONFLICT_MSG += "Only one standard C library can be used"
FEATURES_CONFLICT_MSG += "Only one standard C library can be used."
FEATURES_CONFLICT += periph_gpio_irq:periph_gpio_ll_irq
FEATURES_CONFLICT_MSG += "Only one GPIO IRQ implementation can be used."
FEATURES_CONFLICT += periph_usbdev:tinyusb_device
FEATURES_CONFLICT += periph_usbdev:tinyusb_host
FEATURES_CONFLICT_MSG += "Package tinyUSB is not yet compatible with periph_usbdev."

View File

@ -56,7 +56,7 @@ BUILD_DIR ?= $(RIOTBASE)/build
APPDIR ?= $(CURDIR)
BINDIRBASE ?= $(APPDIR)/bin
BINDIR ?= $(BINDIRBASE)/$(BOARD)
PKGDIRBASE ?= $(RIOTBASE)/build/pkg
PKGDIRBASE ?= $(BUILD_DIR)/pkg
DLCACHE ?= $(RIOTTOOLS)/dlcache/dlcache.sh
DLCACHE_DIR ?= $(RIOTBASE)/.dlcache
RIOT_VERSION_DUMMY_CODE ?= RIOT_VERSION_NUM\(2042,5,23,0\)
@ -117,7 +117,6 @@ ifneq ($(RIOT_CI_BUILD),1)
ifeq ($(MAKELEVEL),0)
ifneq (,$(BOARDSDIR))
$(warning Using BOARDSDIR is deprecated use EXTERNAL_BOARD_DIRS instead)
$(info EXTERNAL_BOARD_DIRS can contain multiple folders separated by space)
endif
endif
endif
@ -172,6 +171,8 @@ CLEAN = $(filter clean, $(MAKECMDGOALS))
include $(RIOTMAKE)/utils/variables.mk
include $(RIOTMAKE)/utils/strings.mk
# include nimble makefile tools
include $(RIOTMAKE)/pkg/nimble.adv.mk
# UNAME is always needed so use simple variable expansion so only evaluated once
UNAME := $(shell uname -m -s)
@ -203,10 +204,11 @@ include $(RIOTMAKE)/boards.inc.mk
include $(RIOTMAKE)/dependencies_debug.inc.mk
# Use TOOLCHAIN environment variable to select the toolchain to use.
# If native, TOOLCHAIN for OSX is llvm
ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
ifeq ($(OS),Darwin)
TOOLCHAIN ?= llvm
$(shell $(COLOR_ECHO) "$(COLOR_RED)"Buildin on macOS is not supported."\
"We recommend vagrant for building:$(COLOR_RESET)"\
"https://github.com/RIOT-OS/RIOT/blob/master/dist/tools/vagrant/README.md 1>&2)
endif
endif
# Use override so that we can redefine a variable set on the command line (as
@ -232,7 +234,7 @@ GLOBAL_GOALS += buildtest \
info-boards-features-missing \
info-boards-supported \
info-buildsizes info-buildsizes-diff \
create-Makefile.ci \
generate-Makefile.ci \
#
ifneq (, $(filter $(GLOBAL_GOALS), $(MAKECMDGOALS)))
@ -393,11 +395,6 @@ ifneq (,$(IOTLAB_NODE))
PROGRAMMER ?= iotlab
# iotlab uses ELFFILE by default for flashing boards.
FLASHFILE ?= $(ELFFILE)
# RIOT_CI_BUILD disables the build of BINFILE which is required for flashing
# on IoT-LAB
ifeq (1,$(RIOT_CI_BUILD))
BUILD_FILES += $(BINFILE)
endif
# Disable IOTLAB_NODE if inside Docker to avoid including the
# iotlab.single.inc.mk file which is useless there: it's only useful for
# flashing and this is done outside of Docker.
@ -407,7 +404,10 @@ ifneq (,$(IOTLAB_NODE))
endif
# Add standard include directories
INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include
INCLUDES += -I$(RIOTBASE)/core/lib/include
INCLUDES += -I$(RIOTBASE)/core/include
INCLUDES += -I$(RIOTBASE)/drivers/include
INCLUDES += -I$(RIOTBASE)/sys/include
# process provided features
include $(RIOTBASE)/Makefile.features
@ -420,7 +420,7 @@ endif
# mandatory includes!
include $(RIOTMAKE)/pseudomodules.inc.mk
include $(RIOTMAKE)/defaultmodules.inc.mk
include $(RIOTMAKE)/defaultmodules_regular.inc.mk
# Include Kconfig functionalities
include $(RIOTMAKE)/kconfig.mk
@ -460,6 +460,11 @@ else
include $(RIOTMAKE)/dependency_resolution.inc.mk
endif
# Include dfu-util configuration when using riotboot_dfu bootloader before
# including the board's Makefile.include which could define dfu-util
# configuration for other DFU bootloaders in use.
include $(RIOTMAKE)/boot/riotboot_dfu-util.mk
# Include Board and CPU configuration
INCLUDES += $(addprefix -I,$(wildcard $(BOARDDIR)/include))
include $(BOARDDIR)/Makefile.include
@ -484,11 +489,13 @@ endif
# Check if programmer is supported by the board, only if PROGRAMMERS_SUPPORTED
# is set and if programmer is not iotlab
ifneq (iotlab,$(PROGRAMMER))
ifneq (,$(PROGRAMMERS_SUPPORTED))
ifeq (,$(filter $(PROGRAMMER),$(PROGRAMMERS_SUPPORTED)))
$(info '$(PROGRAMMER)' programmer is not supported by this board. \
Supported programmers: '$(PROGRAMMERS_SUPPORTED)')
ifneq ($(RIOT_CI_BUILD),1)
ifneq (iotlab,$(PROGRAMMER))
ifneq (,$(PROGRAMMERS_SUPPORTED))
ifeq (,$(filter $(PROGRAMMER),$(PROGRAMMERS_SUPPORTED)))
$(warning '$(PROGRAMMER)' programmer is not supported by this board. \
Supported programmers: '$(PROGRAMMERS_SUPPORTED)')
endif
endif
endif
endif
@ -516,17 +523,12 @@ include $(RIOTMAKE)/ubsan.inc.mk
# For more information, see http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
export CCACHE_CPP2=yes
ifeq ($(strip $(MCU)),)
MCU = $(CPU)
endif
# set some settings useful for continuous integration builds
ifeq ($(RIOT_CI_BUILD),1)
RIOT_VERSION ?= buildtest
# set a dummy version number
RIOT_VERSION_CODE ?= $(RIOT_VERSION_DUMMY_CODE)
ifneq ($(filter $(BOARD_INSUFFICIENT_MEMORY), $(BOARD)),)
$(info CI-build: skipping link step)
RIOTNOLINK:=1
endif
# be more quiet when building for CI
@ -542,11 +544,9 @@ endif
# if you want to publish the board into the sources as an uppercase #define
BOARDDEF = $(call uppercase_and_underscore,$(BOARD))
CPUDEF = $(call uppercase_and_underscore,$(CPU))
MCUDEF = $(call uppercase_and_underscore,$(MCU))
CFLAGS += -DRIOT_APPLICATION=\"$(APPLICATION)\"
CFLAGS += -DBOARD_$(BOARDDEF)=\"$(BOARD)\" -DRIOT_BOARD=BOARD_$(BOARDDEF)
CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF)
CFLAGS += -DMCU_$(MCUDEF)=\"$(MCU)\" -DRIOT_MCU=MCU_$(MCUDEF)
# Feature test default CFLAGS and LINKFLAGS for the set compiled.
include $(RIOTMAKE)/cflags.inc.mk
@ -617,7 +617,7 @@ include $(RIOTMAKE)/modules.inc.mk
.PHONY: all link clean flash flash-only termdeps term doc debug debug-server reset objdump help info-modules
.PHONY: print-size elffile binfile hexfile flashfile cosy
.PHONY: print-size elffile lstfile binfile hexfile flashfile cosy
.PHONY: ..in-docker-container
# Targets that depend on FORCE will always be rebuilt. Contrary to a .PHONY
@ -649,9 +649,11 @@ endif
ELFFILE ?= $(BINDIR)/$(APPLICATION).elf
HEXFILE ?= $(ELFFILE:.elf=.hex)
BINFILE ?= $(ELFFILE:.elf=.bin)
HASHFILE ?= $(BINFILE)
MAPFILE ?= $(ELFFILE:.elf=.map)
LSTFILE ?= $(ELFFILE:.elf=.lst)
ifneq (,$(filter suit, $(USEMODULE)))
ifneq (,$(filter suit,$(USEMODULE)))
include $(RIOTMAKE)/suit.base.inc.mk
endif
@ -660,26 +662,29 @@ endif
# It should be included after defining 'BINFILE' for 'riotboot.bin' handling.
include $(RIOTMAKE)/boot/riotboot.mk
# include suit targets
ifneq (,$(filter suit,$(USEMODULE)))
include $(RIOTMAKE)/suit.inc.mk
endif
# elf file used for the debugger, must include bootloader offset
DEBUG_ELFFILE ?= $(ELFFILE)
# Targets to get given file
elffile: $(ELFFILE)
hexfile: $(HEXFILE)
binfile: $(BINFILE)
lstfile: $(LSTFILE)
# FLASHFILE is the file used by the flasher
# Usually set to $(ELFFILE), $(HEXFILE) or $(BINFILE) in the board/flasher
# or application specific files
flashfile: $(FLASHFILE)
ifeq (,$(FLASHFILE))
$(error FLASHFILE is not defined for this board: $(FLASHFILE))
$(error FLASHFILE is not defined for this board: $(BOARD))
endif
# By default always build ELFFILE, BINFILE and FLASHFILE
ifeq ($(RIOT_CI_BUILD),1)
# Don't build BINFILE on the CI to save some computation time
BUILD_FILES += $(ELFFILE) $(FLASHFILE)
else
BUILD_FILES += $(ELFFILE) $(BINFILE) $(FLASHFILE)
endif
BUILD_FILES += $(ELFFILE) $(BINFILE) $(FLASHFILE) $(HASHFILE)
# variables used to compile and link c++
ifneq (,$(filter cpp,$(USEMODULE)))
@ -697,6 +702,12 @@ BUILDDEPS += $(RIOTBUILD_CONFIG_HEADER_C)
BUILDDEPS += pkg-prepare
BUILDDEPS += $(APPDEPS)
BUILDDEPS += $(MODULE_LIST_DIR)
BUILDDEPS += $(BUILD_DIR)/CACHEDIR.TAG
# Build dependencies depend on clean (if a make goal), as clean may wipe them.
# Without them depending on clean parallel builds occasionally fail due to
# clean removing dependencies that make previously considered as up to date.
$(BUILDDEPS): $(CLEAN)
# Save value to verify it is not modified later
_BASELIBS_VALUE_BEFORE_USAGE := $(BASELIBS)
@ -712,6 +723,15 @@ else
_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $$(find $(BASELIBS:%.module=$(BINDIR)/%/) -name "*.o" 2> /dev/null | sort) $(ARCHIVES_GROUP) $(LINKFLAGS) $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map
endif # BUILDOSXNATIVE
COMPILE_COMMANDS_PATH ?= $(if $(findstring $(RIOTBASE),$(APPDIR)),$(RIOTBASE)/compile_commands.json, $(APPDIR)/compile_commands.json)
COMPILE_COMMANDS_FLAGS ?= --clangd
.PHONY: compile-commands
compile-commands: $(BUILDDEPS)
$(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk compile-commands
$(Q)$(RIOTTOOLS)/compile_commands/compile_commands.py $(COMPILE_COMMANDS_FLAGS) $(BINDIR) \
> $(COMPILE_COMMANDS_PATH)
ifeq ($(BUILD_IN_DOCKER),1)
link: ..in-docker-container
else
@ -721,7 +741,7 @@ else
link: ..compiler-check ..build-message $(BASELIBS) $(ARCHIVES) ..module-check
endif # RIOTNOLINK
$(ELFFILE): $(BASELIBS) $(ARCHIVES)
$(ELFFILE): $(BASELIBS) $(ARCHIVES) $(LD_SCRIPTS)
$(Q)$(_LINK) -o $@
.PHONY: $(APPLICATION_MODULE).module
@ -735,15 +755,6 @@ $(APPLICATION_MODULE).module: pkg-build $(BUILDDEPS)
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk
$(APPLICATION_MODULE).module: FORCE
COMPILE_COMMANDS_PATH ?= $(RIOTBASE)/compile_commands.json
COMPILE_COMMANDS_FLAGS ?= --clangd
.PHONY: compile-commands
compile-commands: $(BUILDDEPS)
$(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk compile-commands
$(Q)$(RIOTTOOLS)/compile_commands/compile_commands.py $(COMPILE_COMMANDS_FLAGS) $(BINDIR) \
> $(COMPILE_COMMANDS_PATH)
# Other modules are built by application.inc.mk and packages building
_SUBMAKE_LIBS = $(filter-out $(APPLICATION_MODULE).module $(APPDEPS), $(BASELIBS) $(ARCHIVES))
$(_SUBMAKE_LIBS): $(APPLICATION_MODULE).module pkg-build
@ -752,12 +763,22 @@ $(_SUBMAKE_LIBS): $(APPLICATION_MODULE).module pkg-build
print-size: $(ELFFILE)
$(Q)$(SIZE) $(SIZEFLAGS) $<
$(BUILD_DIR)/CACHEDIR.TAG:
$(Q)mkdir -p "$(BUILD_DIR)"
$(Q)echo "Signature: 8a477f597d28d172789f06886806bc55" > "$@"
$(Q)echo "# This folder contains RIOT's build cache" >> "$@"
%.hex: %.elf
$(Q)$(OBJCOPY) $(OFLAGS) -Oihex $< $@
%.bin: %.elf
$(Q)$(OBJCOPY) $(OFLAGS) -Obinary $< $@
%.lst: %.elf
$(Q)$(OBJDUMP) --disassemble-all --file-headers --file-offsets \
--section-headers --line-numbers --private-headers --source --wide \
--disassemble-zeroes $< > $@
endif # BUILD_IN_DOCKER
# Check given command is available in the path
@ -785,7 +806,7 @@ endif
$(call check_cmd,$(CC),Compiler)
..build-message: $(if $(SHOULD_RUN_KCONFIG), check-kconfig-errors)
@$(COLOR_ECHO) '$(COLOR_GREEN)Building application "$(APPLICATION)" for "$(BOARD)" with MCU "$(MCU)".$(COLOR_RESET)'
@$(COLOR_ECHO) '$(COLOR_GREEN)Building application "$(APPLICATION)" for "$(BOARD)" with CPU "$(CPU)".$(COLOR_RESET)'
@$(COLOR_ECHO)
# The `clean` needs to be serialized before everything else.
@ -841,8 +862,9 @@ preflash: $(BUILD_BEFORE_FLASH)
# graphical memory usage analyzer
COSY_TOOL ?= $(PKGDIRBASE)/cosy/cosy.py
COSY_PORT ?= 12345
cosy: $(ELFFILE) $(COSY_TOOL)
$(COSY_TOOL) --riot-base $(RIOTBASE) $(APPDIR) $(BOARD) $(ELFFILE) $(MAPFILE)
$(COSY_TOOL) --port $(COSY_PORT) --riot-base $(RIOTBASE) $(APPDIR) $(BOARD) $(ELFFILE) $(MAPFILE)
ifneq (,$(TERMLOG)$(TERMTEE))
TERMTEE ?= | tee -a $(TERMLOG)
@ -854,7 +876,7 @@ termdeps: $(TERMDEPS)
term: $(TERMDEPS)
$(call check_cmd,$(TERMPROG),Terminal program)
$(TERMPROG) $(TERMFLAGS) $(TERMTEE)
${TERMENV} $(TERMPROG) $(TERMFLAGS) $(TERMTEE)
# Term without the pyterm added logging
# PYTERMFLAGS must be exported for `jlink.sh term-rtt`.
@ -864,7 +886,7 @@ cleanterm: $(TERMDEPS)
$(TERMPROG) $(TERMFLAGS) $(TERMTEE)
list-ttys:
$(Q)$(RIOTTOOLS)/usb-serial/list-ttys.sh
$(Q)$(RIOTTOOLS)/usb-serial/ttys.py
doc:
$(MAKE) -BC $(RIOTBASE) doc
@ -873,6 +895,10 @@ debug: $(DEBUGDEPS)
$(call check_cmd,$(DEBUGGER),Debug program)
$(DEBUGGER) $(DEBUGGER_FLAGS)
debug-client:
$(call check_cmd,$(DEBUGCLIENT),Debug client program)
$(DEBUGCLIENT) $(DEBUGCLIENT_FLAGS)
debug-server:
$(call check_cmd,$(DEBUGSERVER),Debug server program)
$(DEBUGSERVER) $(DEBUGSERVER_FLAGS)
@ -893,7 +919,7 @@ include $(RIOTMAKE)/tests/tests.inc.mk
.PHONY: fuzz
fuzz:
env FLASHFILE="$(FLASHFILE)" PORT="$(PORT)" TERMFLAGS="$(TERMFLAGS)" \
"$(RIOTBASE)"/dist/tools/fuzzing/afl.sh $(AFL_FLAGS)
"$(RIOTBASE)"/dist/tools/fuzzing/afl.sh $(FLAGS_FOR_AFL)
# Default OBJDUMPFLAGS for platforms which do not specify it:
OBJDUMPFLAGS ?= -S -D -h
@ -999,7 +1025,8 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
endif
help:
@$(MAKE) -qp | sed -ne 's/\(^[a-z][a-z_-]*\):.*/\1/p' | sort | uniq
# filter all targets starting with lowercase and containing lowercase letters, hyphens, or underscores; explicitly include generate-Makefile.ci
@$(MAKE) -qp | sed -ne 's/\(^[a-z][a-z_-]*\|generate-Makefile.ci\):.*/\1/p' | sort -u
ifeq (iotlab-m3,$(BOARD))
ifneq (,$(filter iotlab-%,$(MAKECMDGOALS)))
@ -1039,6 +1066,9 @@ $(RIOTBUILD_CONFIG_HEADER_C).in: FORCE | $(CLEAN)
CFLAGS_WITH_MACROS += $(CFLAGS)
CFLAGS_WITH_MACROS += -DRIOT_VERSION=\"$(RIOT_VERSION)\"
CFLAGS_WITH_MACROS += -DRIOT_VERSION_CODE=$(RIOT_VERSION_CODE)
ifneq (,$(RIOT_VERSION_EXTRA))
CFLAGS_WITH_MACROS += -DCONFIG_RIOT_VERSION_EXTRA=\""$(RIOT_VERSION_EXTRA)"\"
endif
# MODULE_NAME defines. Declared in 'makefiles/modules.inc.mk'
CFLAGS_WITH_MACROS += $(EXTDEFINES)

View File

@ -1,5 +1,4 @@
[![Nightly CI status master][master-ci-badge]][master-ci-link]
[![Nightly HiL CI overview][hil-ci-badge]][hil-ci-link]
[![GitHub release][release-badge]][release-link]
[![License][license-badge]][license-link]
[![API docs][api-badge]][api-link]
@ -53,29 +52,36 @@ indirect business models around the free open-source software platform
provided by RIOT, e.g. it is possible to link closed-source code with the
LGPL code.
## FEATURES
## Features
RIOT is based on a microkernel architecture, and provides features including,
but not limited to:
RIOT provides features including, but not limited to:
* a preemptive, tickless scheduler with priorities
* flexible memory management
* high resolution, long-term timers
* support 100+ boards based on AVR, MSP430, ESP8266, ESP32, MIPS, RISC-V,
* MTD abstraction layer
* File System integration
* support 200+ boards based on AVR, MSP430, ESP8266, ESP32, RISC-V,
ARM7 and ARM Cortex-M
* the native port allows to run RIOT as-is on Linux, BSD, and MacOS. Multiple
instances of RIOT running on a single machine can also be interconnected via
a simple virtual Ethernet bridge
* the native port allows to run RIOT as-is on Linux and BSD.
Multiple instances of RIOT running on a single machine can also be
interconnected via a simple virtual Ethernet bridge or via a simulated
IEEE 802.15.4 network (ZEP)
* IPv6
* 6LoWPAN (RFC4944, RFC6282, and RFC6775)
* UDP
* RPL (storing mode, P2P mode)
* CoAP
* OTA updates via SUIT
* MQTT
* USB (device mode)
* Display / Touchscreen support
* CCN-Lite
* Sigfox
* LoRaWAN
* UWB
* Bluetooth (BLE) via [NimBLE](https://github.com/apache/mynewt-nimble)
## GETTING RIOT
## Getting RIOT
The most convenient way to get RIOT is to clone it via Git
@ -100,7 +106,7 @@ For more details on our release cycle, check our [documentation][release cycle].
[releases]: https://github.com/RIOT-OS/RIOT/releases
[release cycle]: https://doc.riot-os.org/release-cycle.html
## GETTING STARTED
## Getting Started
* You want to start the RIOT? Just follow our
[quickstart guide](https://doc.riot-os.org/index.html#the-quickest-start) or
try this
@ -111,23 +117,23 @@ For specific toolchain installation, follow instructions in the
version of the documentation is uploaded daily to
[doc.riot-os.org](https://doc.riot-os.org).
## FORUM
## Forum
Do you have a question, want to discuss a new feature, or just want to present
your latest project using RIOT? Come over to our [forum] and post to your hearts
content.
[forum]: https://forum.riot-os.org
## CONTRIBUTE
## Contribute
To contribute something to RIOT, please refer to our
[contributing document](CONTRIBUTING.md).
## MAILING LISTS
## Mailing Lists
* RIOT commits: [commits@riot-os.org](https://lists.riot-os.org/mailman/listinfo/commits)
* Github notifications: [notifications@riot-os.org](https://lists.riot-os.org/mailman/listinfo/notifications)
## LICENSE
## License
* Most of the code developed by the RIOT community is licensed under the GNU
Lesser General Public License (LGPL) version 2.1 as published by the Free
Software Foundation.
@ -145,8 +151,8 @@ https://www.riot-os.org
[api-link]: https://doc.riot-os.org/
[license-badge]: https://img.shields.io/github/license/RIOT-OS/RIOT
[license-link]: https://github.com/RIOT-OS/RIOT/blob/master/LICENSE
[master-ci-badge]: https://ci.riot-os.org/RIOT-OS/RIOT/master/latest/badge.svg
[master-ci-link]: https://ci.riot-os.org/nightlies.html#master
[master-ci-badge]: https://ci.riot-os.org/job/branch/master/badge
[master-ci-link]: https://ci.riot-os.org/details/branch/master
[matrix-badge]: https://img.shields.io/badge/chat-Matrix-brightgreen.svg
[matrix-link]: https://matrix.to/#/#riot-os:matrix.org
[merge-chance-link]: https://merge-chance.info/target?repo=RIOT-OS/RIOT
@ -158,5 +164,3 @@ https://www.riot-os.org
[twitter-link]: https://twitter.com/RIOT_OS
[wiki-badge]: https://img.shields.io/badge/docs-Wiki-informational.svg
[wiki-link]: https://github.com/RIOT-OS/RIOT/wiki
[hil-ci-link]: https://hil.riot-os.org/results/nightly/latest/overview
[hil-ci-badge]: https://img.shields.io/badge/CI-HiL-blue

View File

@ -3,6 +3,11 @@
All security bugs reported will be silently fixed in `master` and backported
to the previous release.
When CVE numbers are assigned to RIOT vulnerabilities, they are associated with
[CPE] identifiers in the shape of `cpe:2.3:o:riot-os:riot:<VERSION>`.
[CPE]: https://nvd.nist.gov/products/cpe
## Reporting a Vulnerability
If a security issue is discovered, please report it to security@riot-os.org.
@ -15,6 +20,14 @@ bottom of this file.
[security-gpg]: https://riot-os.org/assets/keys/security.asc
### Classification of a vulnerability
Unless the reporter explicitly requests not to do so,
the RIOT security maintainers may declassify an issue
if the issue is not deemed critical --
for example when it requires an unlikely combination of circumstances and/or configuration options,
or when it can only be exploited by a user who gains no additional privileges.
## Notification of a Vulnerability
After a fix is provided the security issue will be privately disclosed to the

218
SUBSYSTEMS.md Normal file
View File

@ -0,0 +1,218 @@
# RIOT Subsystem Maintainers
This file gives an overview about the maintainers of RIOT subsystems. Whenever
you submit an issue or a Pull Request, please assign one of the maintainers of
the affected modules as an assignee in the issue tracker. The maintainer takes
care of either fixing/merging the issue/PR herself or re-assign the issue to a
qualified developer.
**Note**: A developer might maintain more than one subsystem and an issue might
affect more than one module.
# CPU
## ESP32, ESP8266
## MSP430
- Marian Buschsieweke (@maribu)
## ARM7
- Marian Buschsieweke (@maribu)
## ARM Cortex-M
### Atmel Sam0 line (SAM D1x/D2x, L1x, L2x, D5x)
- Benjamin Valentin (@benpicco)
- Dylan Laduranty (@dylad)
## Atmel AVR (Atmega)
- Marian Buschsieweke (@maribu)
## Native
### ZEP radio simulation & ZEP dispatcher
- Benjamin Valentin (@benpicco)
# Hardware modules
## Network devices
### IEEE 802.15.4
- José I. Álamos (@jia200x)
### NRF802154
- José I. Álamos (@jia200x)
### CC2538
- José I. Álamos (@jia200x)
### KW2XRF
- José I. Álamos (@jia200x)
### MRF24J40
- José I. Álamos (@jia200x)
### AT86RF2XX
- José I. Álamos (@jia200x)
#### AT86RF215
- Benjamin Valentin (@benpicco)
### BLE
### LoRa
- José I. Álamos (@jia200x)
### CC110X
- Marian Buschsieweke (@maribu)
### ESP-NOW
## Peripherals
- Marian Buschsieweke (@maribu)
## Other drivers
# Kernel (core)
- Kaspar Schleiser (@kaspar030)
# System libraries
## High-level timer API (xtimer, ztimer)
- Kaspar Schleiser (@kaspar030)
## Power Management
## MTD Subsystem
- Benjamin Valentin (@benpicco)
## File Systems
## USB support
- Dylan Laduranty (@dylad)
## POSIX support
## Scripting languages
## RUST support
- Christian Amsüss (@chrysn)
- Kaspar Schleiser (@kaspar030)
## C++ support
- Marian Buschsieweke (@maribu)
## Crypto
# Networking
## Network stacks
### GNRC
- Martine S. Lenders (@miri64)
#### 6LowPAN
- Martine S. Lenders (@miri64)
#### IPv6
- Martine S. Lenders (@miri64)
##### Auto-Subnetting
- Benjamin Valentin (@benpicco)
#### Netif
- José I. Álamos (@jia200x)
#### UDP
- Martine S. Lenders (@miri64)
### CCN-Lite
### OpenThread
- José I. Álamos (@jia200x)
### LWIP
- Martine S. Lenders (@miri64)
### OpenWSN
- José I. Álamos (@jia200x)
## Physical/Link Layer
### LoRaWAN
- José I. Álamos (@jia200x)
### BLE (nimble)
### IEEE 802.15.4
- José I. Álamos (@jia200x)
## Interfaces
### Sock
- Martine S. Lenders (@miri64)
### Netif
- José I. Álamos (@jia200x)
### Netdev
- José I. Álamos (@jia200x)
## Application protocols
### CoAP
#### nanoCoAP
- Benjamin Valentin (@benpicco)
### MQTT
### LWM2M
## Others
### DTLS
- Martine S. Lenders (@miri64)
### RPL
# Build System
- Kaspar Schleiser (@kaspar030)
# Documentation
# Testing/CI
- Kaspar Schleiser (@kaspar030)

View File

@ -1,15 +0,0 @@
# Copyright (c) 2020 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
config BOARD
default "6lowpan-clicker" if BOARD_6LOWPAN_CLICKER
config BOARD_6LOWPAN_CLICKER
bool
default y
select CPU_MODEL_P32MX470F512H
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART

View File

@ -1,2 +0,0 @@
MODULE = board
include $(RIOTBASE)/Makefile.base

View File

@ -1,5 +0,0 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
USEMODULE += newlib_syscalls_mips_uhi

View File

@ -1,6 +0,0 @@
CPU = mips_pic32mx
CPU_MODEL = p32mx470f512h
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

View File

@ -1,15 +0,0 @@
# use pic32prog by default to program this board
PROGRAMMER ?= pic32prog
PROGRAMMERS_SUPPORTED += pic32prog
ifeq ($(PROGRAMMER),pic32prog)
# pic32prog
#
# For PICkit3:
#
# * Connect the chipKIT-Wi-Fire to USB
# * Connect the PICkit3 to ICSP holes
# * https://docs.creatordev.io/wifire/guides/wifire-programming/
# * The triangle `▶` goes into the port number 1 (a hole with a square around it)
# opposite side of the JP1 ICSP text.
FLASHFILE ?= $(HEXFILE)
endif

View File

@ -1,20 +0,0 @@
/*
* Copyright(C) 2016,2017, Imagination Technologies Limited and/or its
* affiliated group companies.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
*/
#include "board.h"
#include "periph/gpio.h"
extern void dummy(void);
void board_init(void)
{
/* Stop the linker from throwing away the PIC32 config register settings */
dummy();
}

View File

@ -1,95 +0,0 @@
/**
@defgroup boards_6lowpan-clicker MikroE 6LoWPAN Clicker
@ingroup boards
@brief Support for the MikroE 6LoWPAN Clicker
@deprecated Will not be available after the 2022.07 release. This includes
all MIPS based boards and cpus.
## Overview
The `6lowpan clicker` is an evaluation board by Mikroe featuring a
PIC32MX470F512H, a 6lowpan radio (CA810) by Cascoda and a Mikrobus
socket for expansion boards.
More general information on the board and related documentation can be found
[here](https://www.mikroe.com/clicker-6lowpan). Schematics for the board can be
found in the [manual](https://download.mikroe.com/documents/starter-boards/clicker/6lowpan/6lowpan-clicker-manual-v100.pdf).
## Hardware
### MCU
| MCU | PIC32MX470F512H |
|:---------- |:-------------------- |
| Family | PIC32MX (MIPS M4K) |
| Vendor | Microchip |
| RAM | 128KiB |
| Flash | 512KiB |
| Frequency | 120MHz |
| FPU | no |
| Timers | 5 (all 16-bit) |
| ADCs | 1x 28-channel 10-bit |
| USB 2.0 | 1 |
| UARTs | 4 |
| SPIs | 2 |
| I2Cs | 2 |
| RTC | yes |
| RNG | no |
| Vcc | 2.3V - 3.6V |
| Datasheet | [Datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/PIC32MX330350370430450470_Datasheet_DS60001185H.pdf) |
### User Interface
2 Buttons:
| NAME | T1 | T2 |
|:----- |:--- |:--- |
| Pin | RE7 | RB0 |
2 LEDs:
| NAME | LD1 | LD2 |
| ----- | --- | --- |
| Color | red | red |
| Pin | RB1 | RB2 |
## Implementation Status
| Device | ID | Supported | Comments |
|:---------------- |:--------------- |:--------- |:---------------------- |
| MCU | pic32mx470f512h | partly | |
| Low-level driver | GPIO | partly | gpio_irq not supported |
| | ADC | no | |
| | PWM | no | |
| | UART | yes | |
| | I2C | no | |
| | SPI | no | |
| | USB | no | |
| | RTT | no | |
| | RTC | no | |
| | Timer | no | |
## Using UART
This board doesn't open an UART or serial interface through the USB
automatically, and the USB device driver hasn't been implemented to RIOT.
Therefore, to open an UART interface one has to connect a usb/ttl converter to
the UART3 pins RF5 (RX) and RF4 (TX) available on the Mikrobus socket.
## Flashing the device
There are two ways to flash the MCU:
* Using MPLAB-IPE and a PICkit 3 (The RIOT build generates a hexfile
compatible with MPLAB-IPE)
* Using pic32prog and a PICkit 2 or a PICkit 3 (other devices might be
supported by pic32prog but were not tested). This is the preferred option
as it makes possible to flash the device using `make flash` command.
## Supported Toolchains
For using the 6lowpan-clicker board we strongly recommend the usage of the
[Codescape GNU Tools](https://codescape.mips.com) toolchain.
*/

View File

@ -1,82 +0,0 @@
/*
* Copyright(C) 2016,2017, Imagination Technologies Limited and/or its
* affiliated group companies.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
*/
/**
* @ingroup boards_6lowpan-clicker
* @details
* see:
* https://www.mikroe.com/clicker-6lowpan
* For more information on the board.
*
* @{
*
* @file
* @brief board configuration for the MikroE 6LoWPAN Clicker
*
* @author Neil Jones <Neil.Jones@imgtec.com>
*/
#ifndef BOARD_H
#define BOARD_H
#include "cpu.h"
#include "periph_conf.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Set how many increments of the count register per uS
* needed by the timer code.
*/
#define TICKS_PER_US (48)
/**
* @name LED pin configuration
* @{
*/
#define LED1_PIN GPIO_PIN(PORT_B, 1)
#define LED2_PIN GPIO_PIN(PORT_B, 2)
#define LED1_MASK (1 << 1)
#define LED2_MASK (1 << 2)
#define LED1_ON (LATBSET = LED1_MASK)
#define LED1_OFF (LATBCLR = LED1_MASK)
#define LED1_TOGGLE (LATBINV = LED1_MASK)
#define LED2_ON (LATBSET = LED2_MASK)
#define LED2_OFF (LATBCLR = LED2_MASK)
#define LED2_TOGGLE (LATBINV = LED2_MASK)
/** @} */
/**
* @name Button pin configuration
* @{
*/
#define BTN0_PIN GPIO_PIN(PORT_E, 7)
#define BTN0_MODE GPIO_IN
#define BTN1_PIN GPIO_PIN(PORT_B, 0)
#define BTN1_MODE GPIO_IN
/** @} */
/**
* @brief Board level initialization
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */

View File

@ -1,61 +0,0 @@
/*
* Copyright (C) 2020 Francois Berder
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_6lowpan-clicker
* @{
*
* @file
* @brief Configuration of SAUL mapped GPIO pins
*
* @author Francois Berder <fberder@outlook.fr>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD1",
.pin = LED1_PIN,
.mode = GPIO_OUT,
},
{
.name = "LD2",
.pin = LED2_PIN,
.mode = GPIO_OUT,
},
{
.name = "T1",
.pin = BTN0_PIN,
.mode = BTN0_MODE,
},
{
.name = "T2",
.pin = BTN1_PIN,
.mode = BTN1_MODE,
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */
/** @} */

View File

@ -1,82 +0,0 @@
/*
* Copyright(C) 2016,2017, Imagination Technologies Limited and/or its
* affiliated group companies.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
*/
/**
* @ingroup boards_6lowpan-clicker
* @{
*
* @file
* @brief peripheral configuration for the MikroE 6LoWPAN Clicker
*
* @author Neil Jones <Neil.Jones@imgtec.com>
*/
#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H
#include "cpu.h"
#include "macros/units.h"
#include "periph_cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Clock configurations
* @{
*/
/**
* @brief The peripheral clock is required for the UART Baud rate calculation
* It is configured by the 'config' registers (see pic32_config_settings.c)
* Note 120MHz is the max F for this device.
*/
#define PERIPHERAL_CLOCK MHZ(96)
#define CLOCK_CORECLOCK MHZ(120)
/** @} */
/**
* @name Timer definitions
* @{
*/
#define TIMER_NUMOF (1)
#define TIMER_0_CHANNELS (3)
/** @} */
/**
* @name UART Definitions
* @{
*/
static const uart_conf_t uart_config[] = {
{ /* UART port available on MikroBus */
.base = (volatile unsigned int *)_UART3_BASE_ADDRESS,
.clock = PERIPHERAL_CLOCK,
.rx_pin = GPIO_PIN(PORT_F, 5),
.tx_pin = GPIO_PIN(PORT_F, 4),
.rx_mux_reg = &U3RXR,
.tx_mux_reg = &RPF4R,
.rx_af = GPIO_AF2,
.tx_af = GPIO_AF1,
.vector = _UART_3_VECTOR,
.irq = _UART3_RX_IRQ,
},
};
#define UART_0_ISR (isr_usart3)
#define UART_NUMOF ((unsigned int)ARRAY_SIZE(uart_config))
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_H */
/** @} */

View File

@ -1,114 +0,0 @@
/*
* Copyright(C) 2016,2017, Imagination Technologies Limited and/or its
* affiliated group companies.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
*/
#include <stdint.h>
#include "vendor/p32mx470f512h.h"
/*
* DEVCFG3 @ 0x1FC02FF0
*
*
* USERID
* FSRSSEL 7 Assign IPL 7 to a shadow register set.
* PMDLIWAY 1
* IOL1WAY 1
* FUSBIDIO OFF USB USBID Selection Controlled by Port Function
* FVBUSONIO ON VBUSON pin is controlled by the USB module function
*/
volatile uint32_t _DEVCFG3 __attribute__((used, section(".devcfg3"))) =
0x0 /* unused bits must be 0 */
| (_DEVCFG3_USERID_MASK & 0xFFFF << _DEVCFG3_USERID_POSITION)
| (_DEVCFG3_FSRSSEL_MASK & 7 << _DEVCFG3_FSRSSEL_POSITION)
| (_DEVCFG3_PMDL1WAY_MASK & 1 << _DEVCFG3_PMDL1WAY_POSITION)
| (_DEVCFG3_IOL1WAY_MASK & 1 << _DEVCFG3_IOL1WAY_POSITION)
| (_DEVCFG3_FUSBIDIO_MASK & 0 << _DEVCFG3_FUSBIDIO_POSITION)
| (_DEVCFG3_FVBUSONIO_MASK & 1 << _DEVCFG3_FVBUSONIO_POSITION);
/* Note this sets the PLL to 96MHz (8/2 * 24) which is only supported by 3xx
* and 4xx parts and assumes an 8MHz XTAL.
*
* 1xx/2xx/53x/57x only support 50MHz (use 8/2 x 24 / 2 = 48Mhz)
* 5xx/6xx/7xx only support 80Mhz (use 8/2 * 20 = 80MHz).
*
*
* DEVCFG2 @ 0x1FC02FF4 (
*
* FPLLIDIV DIV_2 System PLL Input Divider 2x Divider
* FPLLMUL 24x System PLL Multiplier PLL Multiply by 24, 8/2 x 24 = 96MHz
* UPLLIDIV DIV_12x USB PLL divider
* UPLLEN OFF USB PLL disabled
* FPLLODIV DIV_1 System PLL Output Clock Divider 1x Divider
*/
volatile uint32_t _DEVCFG2 __attribute__ ((used, section(".devcfg2"))) =
0xffffffff /* unused bits must be 1 */
& (~_DEVCFG2_FPLLIDIV_MASK | 1 << _DEVCFG2_FPLLIDIV_POSITION)
& (~_DEVCFG2_FPLLMUL_MASK | 7 << _DEVCFG2_FPLLMUL_POSITION)
& (~_DEVCFG2_UPLLIDIV_MASK | 7 << _DEVCFG2_UPLLIDIV_POSITION)
& (~_DEVCFG2_UPLLEN_MASK | 0 << _DEVCFG2_UPLLEN_POSITION)
& (~_DEVCFG2_FPLLODIV_MASK | 0 << _DEVCFG2_FPLLODIV_POSITION);
/*
* DEVCFG1 @ 0x1FC02FF8
*
* FNOSC PRIPLL Oscillator Selection Bits Primary Osc w/PLL (XT+,HS+,EC+PLL)
* FSOSCEN ON Secondary Oscillator Enable Enabled
* IESO ON Internal/External Switch Over Enabled
* OSCIOFNC OFF CLKO Output Signal Active on the OSCO Pin Disabled
* FPBDIV DIV_1 Peripheral Clock Divisor Pb_Clk is Sys_Clk/1
* FCKSM CSDCMD Clock Switching and Monitor Selection Clock Switch Disable, FSCM Disabled
* WDTPS PS2 Watchdog Timer Postscaler 1:2
* WINDIS OFF Watchdog Timer Window Enable Watchdog Timer is in Non-Window Mode
* FWDTEN OFF Watchdog Timer Enable WDT Disabled (SWDTEN Bit Controls)
* FWDTWINSZ 25%
*/
volatile uint32_t _DEVCFG1 __attribute__ ((used, section(".devcfg1"))) =
0xffffffff /* unused bits must be 1 */
& (~_DEVCFG1_FNOSC_MASK | 3 << _DEVCFG1_FNOSC_POSITION)
& (~_DEVCFG1_FSOSCEN_MASK | 1 << _DEVCFG1_FSOSCEN_POSITION)
& (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
& (~_DEVCFG1_POSCMOD_MASK | 1 << _DEVCFG1_POSCMOD_POSITION)
& (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
& (~_DEVCFG1_FPBDIV_MASK | 0 << _DEVCFG1_FPBDIV_POSITION)
& (~_DEVCFG1_FCKSM_MASK | 3 << _DEVCFG1_FCKSM_POSITION)
& (~_DEVCFG1_WDTPS_MASK | 1 << _DEVCFG1_WDTPS_POSITION)
& (~_DEVCFG1_WINDIS_MASK | 0 << _DEVCFG1_WINDIS_POSITION)
& (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
& (~_DEVCFG1_FWDTWINSZ_MASK | 3 << _DEVCFG1_FWDTWINSZ_POSITION);
/*
* DEVCFG0 @ 0x1FC02FFC
*
* DEBUG OFF Background Debugger Enable Debugger is disabled
* JTAGEN ON JTAG Enable JTAG Port Enabled
* ICESEL ICS_PGx1 CE/ICD Comm Channel Select Communicate on PGEC1/PGED1
* PWP OFF Program Flash Write Protect Disable
* BWP OFF Boot Flash Write Protect bit Protection Disabled
* CP OFF Code Protect Protection Disabled
*/
volatile uint32_t _DEVCFG0 __attribute__ ((used, section(".devcfg0"))) =
0x7fffffff /* unused bits must be 1 except MSB which is 0 for some odd reason */
& (~_DEVCFG0_DEBUG_MASK | 3 << _DEVCFG0_DEBUG_POSITION)
& (~_DEVCFG0_JTAGEN_MASK | 1 << _DEVCFG0_JTAGEN_POSITION)
& (~_DEVCFG0_ICESEL_MASK | 3 << _DEVCFG0_ICESEL_POSITION)
& (~_DEVCFG0_PWP_MASK | 0xff << _DEVCFG0_PWP_POSITION)
& (~_DEVCFG0_BWP_MASK | 1 << _DEVCFG0_BWP_POSITION)
& (~_DEVCFG0_CP_MASK | 1 << _DEVCFG0_CP_POSITION);
/*
* Without a reference to this function from elsewhere LD throws the whole
* compile unit away even though the data is 'volatile' and 'used' !!!
*/
void dummy(void)
{
(void)1;
}

View File

@ -50,11 +50,6 @@ extern "C" {
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif

View File

@ -43,9 +43,21 @@ extern "C" {
* @name UART configuration
* @{
*/
#define UART_NUMOF (1U)
#define UART_PIN_RX GPIO_PIN(0, 30)
#define UART_PIN_TX GPIO_PIN(0, 31)
static const uart_conf_t uart_config[] = {
{
.dev = NRF_UARTE0,
.rx_pin = GPIO_PIN(0, 30),
.tx_pin = GPIO_PIN(0, 31),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.irqn = UARTE0_UART0_IRQn,
},
};
#define UART_NUMOF ARRAY_SIZE(uart_config)
#define UART_0_ISR (isr_uart0)
/** @} */
/**

View File

@ -25,4 +25,9 @@ config BOARD_ADAFRUIT_CLUE
select HAVE_SAUL_GPIO
select HAVE_SHT3X
select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG
config FORCE_USB_STDIO
default y
source "$(RIOTBOARD)/common/nrf52/Kconfig"

View File

@ -9,10 +9,4 @@ FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += highlevel_stdio
# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1,$(TEST_KCONFIG))
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config
endif
include $(RIOTBOARD)/common/nrf52/Makefile.features

View File

@ -8,18 +8,5 @@ ifeq ($(PROGRAMMER),adafruit-nrfutil)
# The preinstalled bootloader must also be taken into account so
# ROM_OFFSET skips the space taken by such bootloader.
ROM_OFFSET = 0x26000
ifneq (,$(filter reset flash flash-only, $(MAKECMDGOALS)))
# Add 2 seconds delay before opening terminal: this is required when opening
# the terminal right after flashing. In this case, the stdio over USB needs
# some time after reset before being ready.
TERM_DELAY = 2
TERMDEPS += term-delay
endif
include $(RIOTMAKE)/tools/usb_board_reset.mk
endif
term-delay:
sleep $(TERM_DELAY)
TESTRUNNER_CONNECT_DELAY ?= $(TERM_DELAY)
$(call target-export-variables,test,TESTRUNNER_CONNECT_DELAY)

View File

@ -94,7 +94,7 @@ extern "C" {
#define BACKLIGHT_MASK (1 << 5) /**< Backlight pin mask */
#define BACKLIGHT_ON (NRF_P1->OUTSET = BACKLIGHT_MASK) /**< Turn backlight on */
#define BACKLIGHT_OFF (NRF_P1->OUTCLR = BACKLIGHT_MASK) /**< Turn backlight off */
/** @ */
/** @} */
/**
* @name Display configuration
@ -107,7 +107,8 @@ extern "C" {
#define ILI9341_PARAM_NUM_LINES (240U) /**< Number of screen lines */
#define ILI9341_PARAM_RGB (1) /**< RGB configuration */
#define ILI9341_PARAM_INVERTED (1) /**< Inversion configuration */
#define ILI9341_PARAM_ROTATION (ILI9341_ROTATION_HORZ_FLIP) /**< Rotation mode */
#define ILI9341_PARAM_ROTATION (ILI9341_ROTATION_VERT) /**< Rotation mode */
#define ILI9341_PARAM_OFFSET_X (80) /**< Vertical rotation requires a 80 pixel offset */
/** @} */
#ifdef __cplusplus

View File

@ -0,0 +1,36 @@
# Copyright (C) 2023 Gunar Schorcht
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
config BOARD
default "adafruit-grand-central-m4-express" if BOARD_ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS
config BOARD_ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS
bool
default y
select CPU_MODEL_SAMD51P20A
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_PINS
select HAS_HIGHLEVEL_STDIO
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM
select HAS_PERIPH_RTC
select HAS_PERIPH_RTT
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAVE_SAUL_GPIO
select HAVE_MTD_SPI_NOR
# This specific board requires SPI_ON_QSPI for the MTD_SPI_NOR
select MODULE_PERIPH_SPI_ON_QSPI if MODULE_MTD_SPI_NOR
select HAVE_MTD_SDCARD_DEFAULT
select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT
source "$(RIOTBOARD)/common/samdx1-arduino-bootloader/Kconfig"

View File

@ -0,0 +1,5 @@
MODULE = board
DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,19 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEPKG += littlefs2
USEMODULE += fatfs_vfs
USEMODULE += mtd
endif
ifneq (,$(filter mtd,$(USEMODULE)))
FEATURES_REQUIRED += periph_spi_on_qspi
USEMODULE += mtd_spi_nor
USEMODULE += mtd_sdcard_default
endif
# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.dep

View File

@ -0,0 +1,20 @@
CPU = samd5x
CPU_MODEL = samd51p20a
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += highlevel_stdio
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_dac
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# other board features
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += sdcard_spi

View File

@ -0,0 +1,6 @@
CFLAGS += -DBOOTLOADER_UF2
# Include all definitions for flashing with bossa other USB
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.include
# Include handling of serial and non-bossa programmers (if selected by user)
include $(RIOTMAKE)/boards/sam0.inc.mk

View File

@ -0,0 +1,68 @@
/*
* Copyright (C) 2021 ML!PA Consulting GmbH
* 2023 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-grand-central-m4-express
* @{
*
* @file
* @brief Board specific implementations for the Adafruit Grand Central M4 Express
*
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
* @author Gunar Schorcht <gunar@schorcht.net>
* @}
*/
#include "board.h"
#include "periph/gpio.h"
#include "timex.h"
#ifdef MODULE_VFS_DEFAULT
#include "vfs_default.h"
#endif
#ifdef MODULE_MTD_SPI_NOR
#include "mtd_spi_nor.h"
/* GD25Q64 */
static const mtd_spi_nor_params_t _samd51_nor_params = {
.opcode = &mtd_spi_nor_opcode_default,
.wait_chip_erase = 25 * US_PER_SEC,
.wait_32k_erase = 150 * US_PER_MS,
.wait_64k_erase = 200 * US_PER_MS,
.wait_sector_erase = 50 * US_PER_MS,
.wait_chip_wake_up = 10 * US_PER_MS,
.clk = MHZ(54),
.flag = SPI_NOR_F_SECT_4K
| SPI_NOR_F_SECT_32K
| SPI_NOR_F_SECT_64K,
.spi = SPI_DEV(2),
.mode = SPI_MODE_0,
.cs = SAM0_QSPI_PIN_CS,
.wp = SAM0_QSPI_PIN_DATA_2,
.hold = SAM0_QSPI_PIN_DATA_3,
};
static mtd_spi_nor_t samd51_nor_dev = {
.base = {
.driver = &mtd_spi_nor_driver,
.sector_count = 2048,
.page_size = 256,
.pages_per_sector = 16,
},
.params = &_samd51_nor_params,
};
MTD_XFA_ADD(samd51_nor_dev, 0);
#ifdef MODULE_VFS_DEFAULT
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(samd51_nor_dev), VFS_DEFAULT_NVM(0), 0);
#endif
#endif /* MODULE_MTD_SPI_NOR */

View File

@ -0,0 +1,44 @@
/**
@defgroup boards_adafruit-grand-central-m4-express Adafruit Grand Central M4 Express
@ingroup boards
@brief Support for the Adafruit Grand Central M4 Express
### General information
![Adafruit Grand Central M4 Expressboard](https://cdn-learn.adafruit.com/assets/assets/000/068/748/medium800/adafruit_products_grand_central_top_angle.jpg?1546734839)
The main features of the board are:
- ATSAMD51 Cortex M4 running at 120 MHz
- Hardware DSP and floating point support
- 1MB Flash
- 256 KB RAM
- external 8 MB QSPI Flash storage
- 32-bit, 3.3V logic and power
- Micro SD Card slot connected to SPI
- native USB
### Links
- [Overview](https://learn.adafruit.com/adafruit-grand-central)
- [Schematics](https://learn.adafruit.com/assets/69175)
### Flash the board
The board is flashed using its on-board
[boot loader](https://github.com/adafruit/uf2-samdx1).
The process is automated in the usual `make flash` target.
If RIOT is already running on the board, it will automatically reset the CPU
and enter the bootloader. If some other firmware is running or RIOT crashed,
you need to enter the bootloader manually by double tapping the board's reset
button.
Readiness of the bootloader is indicated by LED pulsing in red.
### Accessing STDIO
The usual way to obtain a console on this board is using an emulated USB serial
port.
*/

View File

@ -0,0 +1,93 @@
/*
* Copyright (C) 2023 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-grand-central-m4-express
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO_PIN(PB, 25)
#define ARDUINO_PIN_1 GPIO_PIN(PB, 24)
#define ARDUINO_PIN_2 GPIO_PIN(PC, 18)
#define ARDUINO_PIN_3 GPIO_PIN(PC, 19)
#define ARDUINO_PIN_4 GPIO_PIN(PC, 20)
#define ARDUINO_PIN_5 GPIO_PIN(PC, 21)
#define ARDUINO_PIN_6 GPIO_PIN(PD, 20)
#define ARDUINO_PIN_7 GPIO_PIN(PD, 21)
#define ARDUINO_PIN_8 GPIO_PIN(PB, 18)
#define ARDUINO_PIN_9 GPIO_PIN(PB, 02)
#define ARDUINO_PIN_10 GPIO_PIN(PB, 22)
#define ARDUINO_PIN_11 GPIO_PIN(PB, 23)
#define ARDUINO_PIN_12 GPIO_PIN(PB, 00)
#define ARDUINO_PIN_13 GPIO_PIN(PB, 01)
#define ARDUINO_PIN_14 GPIO_PIN(PB, 20)
#define ARDUINO_PIN_15 GPIO_PIN(PB, 21)
#define ARDUINO_PIN_16 GPIO_PIN(PA, 3)
#define ARDUINO_PIN_17 GPIO_PIN(PC, 0)
#define ARDUINO_PIN_18 GPIO_PIN(PC, 3)
#define ARDUINO_PIN_19 GPIO_PIN(PC, 1)
#define ARDUINO_PIN_20 GPIO_PIN(PC, 4)
#define ARDUINO_PIN_21 GPIO_PIN(PC, 5)
#define ARDUINO_PIN_LAST 21
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_16
#define ARDUINO_PIN_A1 ARDUINO_PIN_17
#define ARDUINO_PIN_A2 ARDUINO_PIN_18
#define ARDUINO_PIN_A3 ARDUINO_PIN_19
#define ARDUINO_PIN_A4 ARDUINO_PIN_20
#define ARDUINO_PIN_A5 ARDUINO_PIN_21
/** @} */
/**
* @name Mapping of Arduino analog pins to RIOT ADC lines
* @{
*/
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A1 ADC_LINE(1)
#define ARDUINO_A2 ADC_LINE(2)
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_ANALOG_PIN_LAST 5
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -0,0 +1,96 @@
/*
* Copyright (C) 2023 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-grand-central-m4-express
* @{
*
* @file
* @brief Board specific definitions for the Adafruit Grand Central M4 Express
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef BOARD_H
#define BOARD_H
#include "cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PB, 1) /**< User LED red (D13) */
#define LED1_PIN GPIO_PIN(PC, 30) /**< TX LED yellow */
#define LED2_PIN GPIO_PIN(PC, 31) /**< RX LED yellow */
#define LED0_PORT PORT->Group[PB] /**< Port of User LED red (D13) */
#define LED0_MASK (1 << 1) /**< Mask of User LED red (D13) */
#define LED1_PORT PORT->Group[PC] /**< Port of TX LED yellow */
#define LED1_MASK (1 << 30) /**< Mask of TX LED yellow */
#define LED2_PORT PORT->Group[PC] /**< Port of RX LED yellow */
#define LED2_MASK (1 << 31) /**< Mask of RX LED yellow */
#define LED0_ON (LED0_PORT.OUTSET.reg = LED0_MASK) /**< Switch on User LED red (D13) */
#define LED0_OFF (LED0_PORT.OUTCLR.reg = LED0_MASK) /**< Switch off User LED red (D13) */
#define LED0_TOGGLE (LED0_PORT.OUTTGL.reg = LED0_MASK) /**< Toggle User LED red (D13) */
#define LED1_ON (LED1_PORT.OUTCLR.reg = LED1_MASK) /**< Switch on TX LED yellow */
#define LED1_OFF (LED1_PORT.OUTSET.reg = LED1_MASK) /**< Switch off TX LED yellow */
#define LED1_TOGGLE (LED1_PORT.OUTTGL.reg = LED1_MASK) /**< Toggle TX LED yellow */
#define LED2_ON (LED2_PORT.OUTCLR.reg = LED2_MASK) /**< Switch on RX LED yellow */
#define LED2_OFF (LED2_PORT.OUTSET.reg = LED2_MASK) /**< Switch off RX LED yellow */
#define LED2_TOGGLE (LED2_PORT.OUTTGL.reg = LED2_MASK) /**< Toggle User RX LED yellow */
#ifndef WS281X_PARAM_PIN
#define WS281X_PARAM_PIN GPIO_PIN(PC, 24) /**< GPIO pin connected to the data pin */
#endif
#ifndef WS281X_PARAM_NUMOF
#define WS281X_PARAM_NUMOF (1U) /**< Number of LEDs chained */
#endif
/** @} */
/**
* @name MTD configuration
* @{
*/
#define MTD_0 mtd_dev_get(0) /**< MTD device for the 8 MByte QSPI Flash */
#define MTD_1 mtd_dev_get(1) /**< MTD device for the SD Card */
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1 /**< MTD_1 is used for SD Card */
/** @} */
/**
* @name SD-Card interface configuration
*
* The SD-Card interface is connected to SPI_DEV(1).
*
* @{
*/
#if MODULE_SDCARD_SPI || DOXYGEN
#define SDCARD_SPI_PARAM_SPI SPI_DEV(1)
#define SDCARD_SPI_PARAM_CLK GPIO_PIN(PB, 27)
#define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PB, 26)
#define SDCARD_SPI_PARAM_MISO GPIO_PIN(PB, 29)
#define SDCARD_SPI_PARAM_CS GPIO_PIN(PB, 28)
#define SDCARD_SPI_PARAM_POWER GPIO_UNDEF
#endif
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */

View File

@ -0,0 +1,59 @@
/*
* Copyright (C) 2023 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-grand-central-m4-express
* @{
*
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO pin configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED User (red)",
.pin = LED0_PIN,
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INIT_CLEAR,
},
{
.name = "LED TX (yellow)",
.pin = LED1_PIN,
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED | SAUL_GPIO_INIT_CLEAR,
},
{
.name = "LED RX (yellow)",
.pin = LED2_PIN,
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED | SAUL_GPIO_INIT_CLEAR,
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */
/** @} */

View File

@ -0,0 +1,342 @@
/*
* Copyright (C) 2021 ML!PA Consulting GmbH
* 2023 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-grand-central-m4-express
* @{
*
* @file
* @brief Configuration of CPU peripherals for the Adafruit Grand Central M4 Express
*
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H
#include "periph_cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Core clock frequency
* @{
*/
#ifndef CLOCK_CORECLOCK
#define CLOCK_CORECLOCK MHZ(120)
#endif
/** @} */
/**
* @name 32kHz Oscillator configuration
* @{
*/
#define EXTERNAL_OSC32_SOURCE 1
#define INTERNAL_OSC32_SOURCE 0
#define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE 0
/** @} */
/**
* @brief Enable the internal DC/DC converter
* The board is equipped with L_EXT (L1) of 10uH at VSW pin.
*/
#define USE_VREG_BUCK (1)
/**
* @name ADC Configuration
* @{
*/
/* ADC Default values */
#define ADC_PRESCALER ADC_CTRLA_PRESCALER_DIV128
#define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG(0x18u)
#define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INTVCC1
static const adc_conf_chan_t adc_channels[] = {
/* port, pin, muxpos, dev */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA02, .dev = ADC0 }, /* A0 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA05, .dev = ADC0 }, /* A1 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB03, .dev = ADC0 }, /* A2 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC00, .dev = ADC1 }, /* A3 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC01, .dev = ADC1 }, /* A4 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC02, .dev = ADC1 }, /* A5 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC03, .dev = ADC1 }, /* A6 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB04, .dev = ADC1 }, /* A7 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB05, .dev = ADC1 }, /* A8 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB06, .dev = ADC1 }, /* A9 */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB07, .dev = ADC1 }, /* A10 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB08, .dev = ADC0 }, /* A11 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB09, .dev = ADC0 }, /* A12 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA04, .dev = ADC0 }, /* A13 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA06, .dev = ADC0 }, /* A14 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA07, .dev = ADC0 }, /* A15 */
};
#define ADC_NUMOF ARRAY_SIZE(adc_channels)
/** @} */
/**
* @name DAC configuration
* @{
*/
/* Must not exceed 12 MHz */
#define DAC_CLOCK SAM0_GCLK_TIMER
/* Use external reference voltage on PA03 */
/* (You have to manually connect PA03 with Vcc) */
/* Internal reference only gives 1V */
#define DAC_VREF DAC_CTRLB_REFSEL_VREFPU
/** @} */
/**
* @name I2C configuration
* @{
*/
static const i2c_conf_t i2c_config[] = {
{
.dev = &(SERCOM3->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PB, 21), /* D21 (SCL) */
.sda_pin = GPIO_PIN(PB, 20), /* D20 (SDA) */
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_PERIPH,
.flags = I2C_FLAG_NONE
},
{
.dev = &(SERCOM6->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PC, 17), /* D24 */
.sda_pin = GPIO_PIN(PC, 16), /* D25 */
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_PERIPH,
.flags = I2C_FLAG_NONE
},
};
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
* @name PWM configuration
* @{
*/
#define PWM_0_EN 1
#if PWM_0_EN
/* PWM0 channels */
static const pwm_conf_chan_t pwm_chan0_config[] = {
/* GPIO pin, MUX value, TCC channel */
{ GPIO_PIN(PA, 22), GPIO_MUX_G, 2 },
};
#endif
/* PWM device configuration */
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{ .tim = TCC_CONFIG(TCC0),
.chan = pwm_chan0_config,
.chan_numof = ARRAY_SIZE(pwm_chan0_config),
.gclk_src = SAM0_GCLK_PERIPH,
},
#endif
};
/* number of devices that are actually defined */
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
* @name RTT configuration
* @{
*/
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (32768U)
#endif
/** @} */
/**
* @name Timer peripheral configuration
* @{
*/
static const tc32_conf_t timer_config[] = {
{ /* Timer 0 - System Clock */
.dev = TC0,
.irq = TC0_IRQn,
.mclk = &MCLK->APBAMASK.reg,
.mclk_mask = MCLK_APBAMASK_TC0 | MCLK_APBAMASK_TC1,
.gclk_id = TC0_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
},
{ /* Timer 1 */
.dev = TC2,
.irq = TC2_IRQn,
.mclk = &MCLK->APBBMASK.reg,
.mclk_mask = MCLK_APBBMASK_TC2 | MCLK_APBBMASK_TC3,
.gclk_id = TC2_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
}
};
/* Timer 0 configuration */
#define TIMER_0_CHANNELS 2
#define TIMER_0_ISR isr_tc0
/* Timer 1 configuration */
#define TIMER_1_CHANNELS 2
#define TIMER_1_ISR isr_tc2
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{ /* SPI on XIO connector */
.dev = &(SERCOM7->SPI),
.miso_pin = GPIO_PIN(PD, 11), /* D50 MISO */
.mosi_pin = GPIO_PIN(PD, 8), /* D51 MOSI */
.clk_pin = GPIO_PIN(PD, 9), /* D52 SCK */
.miso_mux = GPIO_MUX_C,
.mosi_mux = GPIO_MUX_C,
.clk_mux = GPIO_MUX_C,
.miso_pad = SPI_PAD_MISO_3,
.mosi_pad = SPI_PAD_MOSI_0_SCK_1,
.gclk_src = SAM0_GCLK_PERIPH,
#ifdef MODULE_PERIPH_DMA
.tx_trigger = SERCOM7_DMAC_ID_TX,
.rx_trigger = SERCOM7_DMAC_ID_RX,
#endif
},
{ /* SD Card */
.dev = &(SERCOM2->SPI),
.miso_pin = GPIO_PIN(PB, 29),
.mosi_pin = GPIO_PIN(PB, 26),
.clk_pin = GPIO_PIN(PB, 27),
.miso_mux = GPIO_MUX_C,
.mosi_mux = GPIO_MUX_C,
.clk_mux = GPIO_MUX_C,
.miso_pad = SPI_PAD_MISO_3,
.mosi_pad = SPI_PAD_MOSI_0_SCK_1,
.gclk_src = SAM0_GCLK_PERIPH,
#ifdef MODULE_PERIPH_DMA
.tx_trigger = SERCOM2_DMAC_ID_TX,
.rx_trigger = SERCOM2_DMAC_ID_RX,
#endif
},
#ifdef MODULE_PERIPH_SPI_ON_QSPI
{ /* QSPI in SPI mode */
.dev = QSPI,
.miso_pin = SAM0_QSPI_PIN_DATA_1,
.mosi_pin = SAM0_QSPI_PIN_DATA_0,
.clk_pin = SAM0_QSPI_PIN_CLK,
.miso_mux = SAM0_QSPI_MUX,
.mosi_mux = SAM0_QSPI_MUX,
.clk_mux = SAM0_QSPI_MUX,
.miso_pad = SPI_PAD_MISO_0, /* unused */
.mosi_pad = SPI_PAD_MOSI_0_SCK_1, /* unused */
.gclk_src = SAM0_GCLK_MAIN, /* unused */
#ifdef MODULE_PERIPH_DMA
.tx_trigger = QSPI_DMAC_ID_TX,
.rx_trigger = QSPI_DMAC_ID_RX,
#endif
},
#endif
};
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
* @name USB peripheral configuration
* @{
*/
static const sam0_common_usb_config_t sam_usbdev_config[] = {
{
.dm = GPIO_PIN(PA, 24),
.dp = GPIO_PIN(PA, 25),
.d_mux = GPIO_MUX_H,
.device = &USB->DEVICE,
.gclk_src = SAM0_GCLK_PERIPH,
}
};
/** @} */
/**
* @name UART configuration
* @{
*/
static const uart_conf_t uart_config[] = {
{
.dev = &SERCOM0->USART,
.rx_pin = GPIO_PIN(PB, 25), /* D0 (UART0_RX) */
.tx_pin = GPIO_PIN(PB, 24), /* D1 (UART0_TX) */
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.mux = GPIO_MUX_C,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_PERIPH,
},
{
.dev = &SERCOM4->USART,
.rx_pin = GPIO_PIN(PB, 13), /* D19 (UART2_RX) */
.tx_pin = GPIO_PIN(PB, 12), /* D18 (UART2_TX) */
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.mux = GPIO_MUX_C,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_PERIPH,
},
{
.dev = &SERCOM1->USART,
.rx_pin = GPIO_PIN(PC, 23), /* D17 (UART2_RX) */
.tx_pin = GPIO_PIN(PC, 22), /* D16 (UART2_TX) */
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.mux = GPIO_MUX_C,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_PERIPH,
},
};
/* interrupt function name mapping */
#define UART_0_ISR isr_sercom0_2
#define UART_0_ISR_TX isr_sercom0_0
#define UART_1_ISR isr_sercom4_2
#define UART_1_ISR_TX isr_sercom4_0
#define UART_2_ISR isr_sercom1_2
#define UART_2_ISR_TX isr_sercom1_0
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_H */
/** @} */

View File

@ -7,5 +7,11 @@ ifneq (,$(filter mtd,$(USEMODULE)))
USEMODULE += mtd_spi_nor
endif
# default to using littlefs2 on the external flash
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEPKG += littlefs2
USEMODULE += mtd
endif
# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.dep

View File

@ -13,9 +13,3 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1, $(TEST_KCONFIG))
KCONFIG_ADD_CONFIG += $(RIOTBOARD)/common/samdx1-arduino-bootloader/samdx1-arduino-bootloader.config
endif

View File

@ -21,6 +21,9 @@
#include "periph/gpio.h"
#include "mtd_spi_nor.h"
#include "timex.h"
#ifdef MODULE_VFS_DEFAULT
#include "vfs_default.h"
#endif
#ifdef MODULE_MTD
/* GD25x16 */
@ -51,5 +54,45 @@ static mtd_spi_nor_t samd51_nor_dev = {
.params = &_samd51_nor_params,
};
mtd_dev_t *mtd0 = (mtd_dev_t *)&samd51_nor_dev;
MTD_XFA_ADD(samd51_nor_dev, 0);
#ifdef MODULE_VFS_DEFAULT
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(samd51_nor_dev), VFS_DEFAULT_NVM(0), 0);
#endif
#endif /* MODULE_MTD */
static inline void _toggle(unsigned n)
{
n *= 2;
while (--n) {
/* This might break if the GPIO driver gets more optimized, but
* with the current implementation the toggle is slow enough :) */
gpio_toggle(APA102_PARAM_CLK_PIN);
}
}
void board_init(void)
{
/* if the real driver is used, it will deal with the LED */
if (IS_USED(MODULE_APA102)) {
return;
}
/* bootloader leaves on an annoyingly bright LED - turn it off manually */
gpio_init(APA102_PARAM_DATA_PIN, GPIO_OUT);
gpio_init(APA102_PARAM_CLK_PIN, GPIO_OUT);
/* start frame - 32 zero bits */
gpio_clear(APA102_PARAM_DATA_PIN);
_toggle(32);
/* LED frame: 3 start bits (1), 5 alpha bits (0), 24 color bits (0) */
gpio_set(APA102_PARAM_DATA_PIN);
_toggle(3);
gpio_clear(APA102_PARAM_DATA_PIN);
_toggle(29); /* 5 alpha + 8 red + 8 green + 8 blue */
/* end frame - 32 one bits */
gpio_set(APA102_PARAM_DATA_PIN);
_toggle(32);
}

View File

@ -7,7 +7,7 @@
![Adafruit-Itsybitsy-M4 compared to a quarter dollar](https://cdn-learn.adafruit.com/assets/assets/000/055/465/large1024/adafruit_products_3800_quarter_ORIG_2018_06.jpg?1529192175)
This is a small formfactor (only 1.4" long by 0.7" wide) SAM D51 board made by Adafruit.
This is a small formfactor (only 1.4\" long by 0.7\" wide) SAM D51 board made by Adafruit.
The board features one red LED (LD1), one DotStar / APA102 RGB LED, a reset button as well as
21 configurable external pins(6 of which can be analog in).

View File

@ -20,7 +20,6 @@
#define BOARD_H
#include "cpu.h"
#include "mtd.h"
#ifdef __cplusplus
extern "C" {
@ -53,8 +52,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */
/**
@ -65,11 +63,6 @@ extern mtd_dev_t *mtd0;
#define XTIMER_HZ (1000000ul)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif

View File

@ -238,16 +238,15 @@ static const sam0_common_usb_config_t sam_usbdev_config[] = {
#define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG(0x18u)
#define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INTVCC1
#define ADC_DEV ADC0
static const adc_conf_chan_t adc_channels[] = {
/* port, pin, muxpos */
{GPIO_PIN(PA, 2), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN0)},
{GPIO_PIN(PA, 5), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN5)},
{GPIO_PIN(PB, 8), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN2)},
{GPIO_PIN(PB, 9), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN3)},
{GPIO_PIN(PA, 4), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN4)},
{GPIO_PIN(PA, 6), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN6)},
/* port, pin, muxpos, dev */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA02, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA05, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB08, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB09, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA04, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA06, .dev = ADC0 },
};
#define ADC_NUMOF ARRAY_SIZE(adc_channels)

View File

@ -20,4 +20,9 @@ config BOARD_ADAFRUIT_ITSYBITSY_NRF52
select HAVE_SAUL_GPIO
select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG
config FORCE_USB_STDIO
default y
source "$(RIOTBOARD)/common/nrf52/Kconfig"

View File

@ -9,10 +9,4 @@ FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += highlevel_stdio
# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1,$(TEST_KCONFIG))
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/nrf52/nrf52_bootloader.config
endif
include $(RIOTBOARD)/common/nrf52/Makefile.features

View File

@ -5,9 +5,9 @@
### General information
This is a small formfactor (only 1.4" long by 0.7" wide) nRF52840 board made by Adafruit.
This is a small formfactor (only 1.4\" long by 0.7\" wide) nRF52840 board made by Adafruit.
The board features one LED (LD1: blue), a user (SW1) and a
The board features one red LED (LD1), one DotStar / APA102 RGB LED, a user (SW1), a
reset button as well as 21 configurable external pins(6 of which can be analog in).
### Links
@ -42,9 +42,4 @@ you may need to run `pip3 install --upgrade pip3` before being able to run `pip3
The usual way to obtain a console on this board is using an emulated USB serial port.
### Todo
Add support for the mini DotStar RGB LED
*/

View File

@ -50,6 +50,15 @@ extern "C" {
/** @} */
/**
* @name APA102 / DotStar configuration
* @{
*/
#define APA102_PARAM_LED_NUMOF (1)
#define APA102_PARAM_DATA_PIN GPIO_PIN(0, 8)
#define APA102_PARAM_CLK_PIN GPIO_PIN(1, 9)
/** @} */
/**
* @name Button pin configuration
* @{

View File

@ -91,3 +91,4 @@ static const i2c_conf_t i2c_config[] = {
#endif
#endif /* PERIPH_CONF_H */
/** @} */

View File

@ -0,0 +1,32 @@
# Copyright (c) 2020 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
config BOARD
default "adafruit-pybadge" if BOARD_ADAFRUIT_PYBADGE
config BOARD_ADAFRUIT_PYBADGE
bool
default y
select CPU_MODEL_SAMD51J19A
select HAS_HIGHLEVEL_STDIO
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM
select HAS_PERIPH_RTC
select HAS_PERIPH_RTT
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAVE_ST7735
select HAVE_SAUL_GPIO
select HAVE_MTD_SPI_NOR
# This specific board requires SPI_ON_QSPI for the MTD_SPI_NOR
select MODULE_PERIPH_SPI_ON_QSPI if MODULE_MTD_SPI_NOR
source "$(RIOTBOARD)/common/samdx1-arduino-bootloader/Kconfig"

View File

@ -0,0 +1,5 @@
MODULE = board
DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,15 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
ifneq (,$(filter disp_dev,$(USEMODULE)))
USEMODULE += st7735
endif
ifneq (,$(filter mtd,$(USEMODULE)))
FEATURES_REQUIRED += periph_spi_on_qspi
USEMODULE += mtd_spi_nor
endif
# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.dep

View File

@ -0,0 +1,15 @@
CPU = samd5x
CPU_MODEL = samd51j19a
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += highlevel_stdio
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_dac
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

View File

@ -0,0 +1,9 @@
CFLAGS += -DBOOTLOADER_UF2
# stdio over usb takes several seconds to be up after flashing
TERM_DELAY ?= 4
# Include all definitions for flashing with bossa other USB
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.include
# Include handling of serial and non-bossa programmers (if selected by user)
include $(RIOTMAKE)/boards/sam0.inc.mk

View File

@ -0,0 +1,70 @@
/*
* Copyright (C) 2020 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-pybadge
* @{
*
* @file
* @brief Board initialization for the Adafruit PyBadge
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*
* @}
*/
#include "cpu.h"
#include "board.h"
#include "mtd_spi_nor.h"
#include "timex.h"
#include "periph/gpio.h"
#if IS_USED(MODULE_MTD)
/* GD25Q16C */
static const mtd_spi_nor_params_t _samd51_nor_params = {
.opcode = &mtd_spi_nor_opcode_default,
.wait_chip_erase = 15 * US_PER_SEC,
.wait_32k_erase = 150 * US_PER_MS,
.wait_64k_erase = 250 * US_PER_MS,
.wait_sector_erase = 50 * US_PER_MS,
.wait_chip_wake_up = 1 * US_PER_MS,
.clk = MHZ(54),
.flag = SPI_NOR_F_SECT_4K
| SPI_NOR_F_SECT_32K
| SPI_NOR_F_SECT_64K,
.spi = SPI_DEV(3),
.mode = SPI_MODE_0,
.cs = SAM0_QSPI_PIN_CS,
.wp = SAM0_QSPI_PIN_DATA_2,
.hold = SAM0_QSPI_PIN_DATA_3,
};
static mtd_spi_nor_t samd51_nor_dev = {
.base = {
.driver = &mtd_spi_nor_driver,
.page_size = 256,
.pages_per_sector = 16,
},
.params = &_samd51_nor_params,
};
MTD_XFA_ADD(samd51_nor_dev, 0);
#endif /* MODULE_MTD */
void board_init(void)
{
if (IS_USED(MODULE_DAC_DDS)) {
gpio_init(SPEAKER_ENABLE_PIN, GPIO_OUT);
gpio_set(SPEAKER_ENABLE_PIN);
}
if (IS_USED(MODULE_ST77XX)) {
gpio_init(BACKLIGHT_PIN, GPIO_OUT);
}
}

View File

@ -0,0 +1,40 @@
/**
@defgroup boards_adafruit-pybadge Adafruit PyBadge
@ingroup boards
@brief Support for the Adafruit PyBadge board.
### General information
The [Adafruit PyBadge](https://www.adafruit.com/product/4200) is a
learning and development board that provides 5 Neopixel LEDs, an accelerometer,
a light sensor, a speaker, several buttons and an LCD screen.
It is powered by an Atmel SAMD51 microcontroller.
The display, RGB LEDs, buttons and accelerometer of this board are currently not supported.
The [Adafruit PyBadge LC](https://www.adafruit.com/product/3939) and
[Adafruit EdgeBadge](https://www.adafruit.com/product/4400)) are
variants of the Pybadge with small differences:
- EdgeBadge provides an extra microphone (not supported)
- PyBadgeLC only have one Neopixel LED (instead of 5)
Both are compatible with the PyBadge RIOT port and the current port can easily
be adapted/extended with their respective differences.
### Flash the board
Connect the board via USB and use `BOARD=adafruit-pybadge` with the `make` command;
this uses the Arduino style bootloader preprogrammed on the board.<br/>
Example with `hello-world` application:
```
make BOARD=adafruit-pybadge -C examples/hello-world flash
```
In case of a crash of the firmware, one has to manually reset the board in
bootloader mode to be able to re-flash it again: simply double tap the reset
button before running the flash command provided above.
### Accessing STDIO via UART
STDIO of RIOT is directly available over the USB port.
*/

View File

@ -0,0 +1,119 @@
/*
* Copyright (C) 2020 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-pybadge
* @{
*
* @file
* @brief Board specific definitions for the Adafruit PyBadge
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef BOARD_H
#define BOARD_H
#include "cpu.h"
#include "periph/gpio.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PA, 23) /**< LED0 pin */
#define LED_PORT PORT->Group[PA] /**< LED0 port */
#define LED0_MASK (1 << 23) /**< LED0 mask */
#define LED0_ON (LED_PORT.OUTSET.reg = LED0_MASK) /**< LED0 on macro */
#define LED0_OFF (LED_PORT.OUTCLR.reg = LED0_MASK) /**< LED0 off macro */
#define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK) /**< LED0 toggle macro */
#define LED0_NAME "LED(Red)" /**< LED0 name */
/** @} */
/**
* @name Buttons control (TI SN74HC165 shift register)
* @{
*/
#define BUTTON_LATCH GPIO_PIN(PB, 0) /**< Latch pin */
#define BUTTON_CLK GPIO_PIN(PB, 31) /**< Clock pin */
#define BUTTON_OUT GPIO_PIN(PB, 30) /**< Serial output pin */
/** @} */
/**
* @name Backlight control
* @{
*/
#define BACKLIGHT_PIN GPIO_PIN(PA, 1) /**< Backlight pin */
#define BACKLIGHT_PORT PORT->Group[PA] /**< Backlight pin port */
#define BACKLIGHT_MASK (1 << 1) /**< Backlight pin mask */
#define BACKLIGHT_ON (BACKLIGHT_PORT.OUTSET.reg = BACKLIGHT_MASK) /**< Turn backlight on */
#define BACKLIGHT_OFF (BACKLIGHT_PORT.OUTCLR.reg = BACKLIGHT_MASK) /**< Turn backlight off */
/** @} */
/**
* @name Display configuration (not supported yet)
* @{
*/
#define ST77XX_PARAM_CNTRL ST77XX_CNTRL_ST7735 /**< ST77xx controller variant */
#define ST77XX_PARAM_SPI SPI_DEV(1) /**< SPI device */
#define ST77XX_PARAM_CS GPIO_PIN(PB, 7) /**< Chip select pin */
#define ST77XX_PARAM_DCX GPIO_PIN(PB, 5) /**< DCX pin */
#define ST77XX_PARAM_RST GPIO_PIN(PA, 0) /**< Reset pin */
#define ST77XX_PARAM_NUM_LINES (160U) /**< Number of screen lines */
#define ST77XX_PARAM_RGB_CHANNELS (128U) /**< Number of screen rgb channel (height) */
#define ST77XX_PARAM_RGB (1) /**< RGB configuration */
#define ST77XX_PARAM_INVERTED (0) /**< Inversion configuration */
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_90 /**< Rotation mode */
#define LCD_SCREEN_WIDTH (ST77XX_PARAM_NUM_LINES) /**< LCD screen width */
#define LCD_SCREEN_HEIGHT (ST77XX_PARAM_RGB_CHANNELS) /**< LCD screen height */
/** @} */
/**
* @name Neopixel LEDs (not supported yet)
* @{
*/
#define WS281X_PARAM_PIN (GPIO_PIN(PA, 15)) /**< GPIO pin connected to the data pin of the first LED */
#define WS281X_PARAM_NUMOF (5U) /**< Number of LEDs chained */
/** @} */
/**
* @name Speaker (supported via DAC DDS module)
* @{
*/
#define SPEAKER_ENABLE_PIN GPIO_PIN(PA, 27) /**< Speaker enable pin */
#define SPEAKER_PIN GPIO_PIN(PA, 2) /**< Speaker pin (A0) */
/** @} */
/**
* @name MTD configuration
* @{
*/
#define MTD_0 mtd_dev_get(0) /**< MTD_0 constant */
/** @} */
/**
* @name Xtimer configuration
* @{
*/
#define XTIMER_WIDTH (32) /**< Default timer is 32bit width */
#define XTIMER_HZ (1000000ul) /**< Default timer runs at 1MHz */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */

View File

@ -0,0 +1,46 @@
/*
* Copyright (C) 2020 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-pybadge
* @{
*
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO pin configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = LED0_NAME,
.pin = LED0_PIN,
.mode = GPIO_OUT
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */
/** @} */

View File

@ -0,0 +1,304 @@
/*
* Copyright (C) 2020 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_adafruit-pybadge
* @{
*
* @file
* @brief Configuration of CPU peripherals for the Adafruit PyBadge
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H
#include "periph_cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name desired core clock frequency
* @{
*/
#ifndef CLOCK_CORECLOCK
#define CLOCK_CORECLOCK MHZ(120)
#endif
/** @} */
/**
* @name 32kHz Oscillator configuration
* @{
*/
#define EXTERNAL_OSC32_SOURCE 0
#define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE 1
/** @} */
/**
* @brief Enable the internal DC/DC converter
* The board is equipped with the necessary inductor.
*/
#define USE_VREG_BUCK (1)
/**
* @name Timer peripheral configuration
* @{
*/
static const tc32_conf_t timer_config[] = {
{ /* Timer 0 - System Clock */
.dev = TC0,
.irq = TC0_IRQn,
.mclk = &MCLK->APBAMASK.reg,
.mclk_mask = MCLK_APBAMASK_TC0 | MCLK_APBAMASK_TC1,
.gclk_id = TC0_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
},
{ /* Timer 1 */
.dev = TC2,
.irq = TC2_IRQn,
.mclk = &MCLK->APBBMASK.reg,
.mclk_mask = MCLK_APBBMASK_TC2 | MCLK_APBBMASK_TC3,
.gclk_id = TC2_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
}
};
/* Timer 0 configuration */
#define TIMER_0_CHANNELS 2
#define TIMER_0_ISR isr_tc0
/* Timer 1 configuration */
#define TIMER_1_CHANNELS 2
#define TIMER_1_ISR isr_tc2
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
/**
* @name UART configuration
* @{
*/
static const uart_conf_t uart_config[] = {
{ /* Virtual COM Port */
.dev = &SERCOM5->USART,
.rx_pin = GPIO_PIN(PB, 16),
.tx_pin = GPIO_PIN(PB, 17),
#ifdef MODULE_SAM0_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.mux = GPIO_MUX_C,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_PERIPH,
}
};
/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5_2
#define UART_0_ISR_TX isr_sercom5_0
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
* @name PWM configuration
* @{
*/
#define PWM_0_EN 1
#if PWM_0_EN
/* PWM0 channels */
static const pwm_conf_chan_t pwm_chan0_config[] = {
/* GPIO pin, MUX value, TCC channel */
{ GPIO_PIN(PA, 22), GPIO_MUX_G, 2 },
};
#endif
/* PWM device configuration */
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{ .tim = TCC_CONFIG(TCC0),
.chan = pwm_chan0_config,
.chan_numof = ARRAY_SIZE(pwm_chan0_config),
.gclk_src = SAM0_GCLK_PERIPH,
},
#endif
};
/* number of devices that are actually defined */
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */
/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = &(SERCOM1->SPI),
.miso_pin = GPIO_PIN(PB, 22),
.mosi_pin = GPIO_PIN(PB, 23),
.clk_pin = GPIO_PIN(PA, 17),
.miso_mux = GPIO_MUX_C,
.mosi_mux = GPIO_MUX_C,
.clk_mux = GPIO_MUX_C,
.miso_pad = SPI_PAD_MISO_2,
.mosi_pad = SPI_PAD_MOSI_3_SCK_1,
.gclk_src = SAM0_GCLK_PERIPH,
#ifdef MODULE_PERIPH_DMA
.tx_trigger = SERCOM1_DMAC_ID_TX,
.rx_trigger = SERCOM1_DMAC_ID_RX,
#endif
},
{ /* Connected to TFT display */
.dev = &(SERCOM4->SPI),
.miso_pin = GPIO_PIN(PB, 12),
.mosi_pin = GPIO_PIN(PB, 15),
.clk_pin = GPIO_PIN(PB, 13),
.miso_mux = GPIO_MUX_C,
.mosi_mux = GPIO_MUX_C,
.clk_mux = GPIO_MUX_C,
.miso_pad = SPI_PAD_MISO_0,
.mosi_pad = SPI_PAD_MOSI_3_SCK_1,
.gclk_src = SAM0_GCLK_PERIPH,
#ifdef MODULE_PERIPH_DMA
.tx_trigger = SERCOM4_DMAC_ID_TX,
.rx_trigger = SERCOM4_DMAC_ID_RX,
#endif
},
{ /* Connected to PDM Mic */
.dev = &(SERCOM3->SPI),
.miso_pin = GPIO_PIN(PA, 18),
.mosi_pin = GPIO_PIN(PA, 19),
.clk_pin = GPIO_PIN(PA, 16),
.miso_mux = GPIO_MUX_D,
.mosi_mux = GPIO_MUX_D,
.clk_mux = GPIO_MUX_D,
.miso_pad = SPI_PAD_MISO_2,
.mosi_pad = SPI_PAD_MOSI_3_SCK_1,
.gclk_src = SAM0_GCLK_PERIPH,
#ifdef MODULE_PERIPH_DMA
.tx_trigger = SERCOM4_DMAC_ID_TX,
.rx_trigger = SERCOM4_DMAC_ID_RX,
#endif
},
#ifdef MODULE_PERIPH_SPI_ON_QSPI
{ /* QSPI in SPI mode */
.dev = QSPI,
.miso_pin = SAM0_QSPI_PIN_DATA_1,
.mosi_pin = SAM0_QSPI_PIN_DATA_0,
.clk_pin = SAM0_QSPI_PIN_CLK,
.miso_mux = SAM0_QSPI_MUX,
.mosi_mux = SAM0_QSPI_MUX,
.clk_mux = SAM0_QSPI_MUX,
.miso_pad = SPI_PAD_MISO_0, /* unused */
.mosi_pad = SPI_PAD_MOSI_0_SCK_1, /* unused */
.gclk_src = SAM0_GCLK_MAIN, /* unused */
#ifdef MODULE_PERIPH_DMA
.tx_trigger = QSPI_DMAC_ID_TX,
.rx_trigger = QSPI_DMAC_ID_RX,
#endif
},
#endif
};
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
* @name I2C configuration
* @{
*/
static const i2c_conf_t i2c_config[] = {
{
.dev = &(SERCOM2->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PA, 13),
.sda_pin = GPIO_PIN(PA, 12),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_PERIPH,
.flags = I2C_FLAG_NONE
},
};
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**,
* @name RTT configuration
* @{
*/
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (32768U)
#endif
/** @} */
/**
* @name USB peripheral configuration
* @{
*/
static const sam0_common_usb_config_t sam_usbdev_config[] = {
{
.dm = GPIO_PIN(PA, 24),
.dp = GPIO_PIN(PA, 25),
.d_mux = GPIO_MUX_H,
.device = &USB->DEVICE,
.gclk_src = SAM0_GCLK_48MHZ,
}
};
/** @} */
/**
* @name ADC Configuration
* @{
*/
/* ADC Default values */
#define ADC_PRESCALER ADC_CTRLA_PRESCALER_DIV128
#define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG(0x18u)
#define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INTVCC1
static const adc_conf_chan_t adc_channels[] = {
/* port, pin, muxpos, dev */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA05, .dev = ADC0 }, /* A1 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB08, .dev = ADC0 }, /* A2 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB09, .dev = ADC0 }, /* A3 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA04, .dev = ADC0 }, /* A4 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA06, .dev = ADC0 }, /* A5 */
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB01, .dev = ADC0 }, /* A6 - VMEAS */
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB04, .dev = ADC1 }, /* A7 - Light sensor */
};
#define ADC_NUMOF ARRAY_SIZE(adc_channels)
/** @} */
/**
* @name DAC configuration
* @{
*/
#define DAC_CLOCK SAM0_GCLK_TIMER /**< Must not exceed 12 MHz */
/** Use external reference voltage on PA03
*
* PA03 has to be manually connected to Vcc.
* Internal reference only gives 1V */
#define DAC_VREF DAC_CTRLB_REFSEL_VREFPU
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_H */
/** @} */

View File

@ -11,13 +11,11 @@ usual micro-controller peripherals with a 2.4GHz radio that supports both
Nordics proprietary ShockBurst as well as Bluetooth Low Energy (BLE).
The board was available via
[Indiegogo]
(https://www.indiegogo.com/projects/airfy-beacon-make-your-smart-home-even-smarter).
[Indiegogo](https://www.indiegogo.com/projects/airfy-beacon-make-your-smart-home-even-smarter).
## Hardware
![airfy-beacon]
(https://raw.githubusercontent.com/wiki/RIOT-OS/RIOT/images/airfy-beacon.jpg)
![airfy-beacon](https://raw.githubusercontent.com/wiki/RIOT-OS/RIOT/images/airfy-beacon.jpg)
| MCU | NRF51822QFAA |
|:--------------------- |:--------------------------------- |
@ -84,7 +82,7 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", \
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
# GROUP:="somegroupname" and manage access using standard unix groups.
> sudo cp 49-stlinkv2.rules /etc/udev/rules.d/
> sudo udevadm control --reload-rules
@ -114,8 +112,7 @@ SWD data I/O: SWDIO <-----------> SWDIO (CN3, pin4)
The following image shows the wiring for an SWD flasher board:
![airfy-beacon-flash-connect]
(https://raw.githubusercontent.com/wiki/RIOT-OS/RIOT/images/airfy-beacon-flash-connect.jpg)
![airfy-beacon-flash-connect](https://raw.githubusercontent.com/wiki/RIOT-OS/RIOT/images/airfy-beacon-flash-connect.jpg)
### Software
Debugging and programming this module works well with

View File

@ -31,13 +31,23 @@
/**
* @name UART configuration
*
* The CPU only supports one UART device, so we keep it simple
* @{
*/
#define UART_NUMOF (1U)
#define UART_PIN_RX 17
#define UART_PIN_TX 18
static const uart_conf_t uart_config[] = {
{ /* Mapped to USB virtual COM port */
.dev = NRF_UART0,
.rx_pin = GPIO_PIN(0, 17),
.tx_pin = GPIO_PIN(0, 18),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.irqn = UART0_IRQn,
},
};
#define UART_NUMOF ARRAY_SIZE(uart_config)
#define UART_0_ISR isr_uart0
/** @} */
/**
@ -96,3 +106,4 @@ static const adc_conf_t adc_config[] = {3, 4, 5, 6};
#endif
#endif /* PERIPH_CONF_H */
/** @} */

View File

@ -31,26 +31,14 @@ extern "C" {
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_E, 7) /**< LED0 gpio pin */
#define LED0_MASK (1 << 7) /**< LED0 gpio mask */
#define LED0_PIN_NUM 7
#define LED0_PORT_NUM PORT_E
#define LED0_ON (GPIOB->BSRR = LED0_MASK) /**< Turn on LED0 */
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16)) /**< Turn off LED0 */
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK) /**< Toggle LED0 */
#define LED1_PIN_NUM 8
#define LED1_PORT_NUM PORT_E
#define LED1_PIN GPIO_PIN(PORT_E, 8) /**< LED1 gpio pin */
#define LED1_MASK (1 << 8) /**< LED1 gpio mask */
#define LED1_ON (GPIOE->BSRR = LED1_MASK) /**< Turn on LED1 */
#define LED1_OFF (GPIOE->BSRR = (LED1_MASK << 16)) /**< Turn off LED1 */
#define LED1_TOGGLE (GPIOE->ODR ^= LED1_MASK) /**< Toggle LED1 */
#define LED2_PIN GPIO_PIN(PORT_E, 9) /**< LED2 gpio pin */
#define LED2_MASK (1 << 9) /**< LED2 gpio mask */
#define LED2_ON (GPIOE->BSRR = LED2_MASK) /**< Turn on LED2 */
#define LED2_OFF (GPIOE->BSRR = (LED2_MASK << 16)) /**< Turn off LED2 */
#define LED2_TOGGLE (GPIOE->ODR ^= LED2_MASK) /**< Toggle LED2 */
#define LED2_PIN_NUM 9
#define LED2_PORT_NUM PORT_E
/** @} */
@ -71,14 +59,11 @@ extern "C" {
#define BTN2_MODE GPIO_IN_PD /**< Button 2 mode */
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#include "stm32_leds.h"
#endif /* BOARD_H */
/** @} */

View File

@ -10,6 +10,7 @@ config BOARD_ARDUINO_DUEMILANOVE
select BOARD_COMMON_ARDUINO_ATMEGA
select CPU_MODEL_ATMEGA328P
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_UNO
config BOARD
default "arduino-duemilanove" if BOARD_ARDUINO_DUEMILANOVE

View File

@ -1,3 +1,4 @@
CPU = atmega328p
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -13,5 +13,6 @@ config BOARD_ARDUINO_LEONARDO
select BOARD_COMMON_ARDUINO_ATMEGA
select CPU_MODEL_ATMEGA32U4
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_UNO
source "$(RIOTBOARD)/common/arduino-atmega/Kconfig"

View File

@ -1,3 +1,4 @@
CPU = atmega32u4
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -13,5 +13,7 @@ config BOARD_ARDUINO_MEGA2560
select CPU_MODEL_ATMEGA2560
select BOARD_COMMON_ARDUINO_ATMEGA
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_MEGA
select HAS_ARDUINO_SHIELD_UNO
source "$(RIOTBOARD)/common/arduino-atmega/Kconfig"

View File

@ -1,3 +1,6 @@
CPU = atmega2560
FEATURES_PROVIDED += arduino_shield_mega
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -3,4 +3,34 @@ BAUD ?= 9600
ARDUINO_MEGA2560_BOOTLOADER ?= stk500v2
# If port selection via ttys.py is enabled by `MOST_RECENT_PORT=1`, filter
# USB serials to only select boards that identify as Arduino Mega 2560 or
# ad Arduino Mega ADK (a special official Mega flavor that is compatible)
TTY_BOARD_FILTER := --vendor 'Arduino' --model-db 'Mega 2560|Mega ADK'
# Same, but for clones using a cheap USB <--> UART chip rather than the
# ATmega16U2
TTY_BOARD_FILTER_CLONE := --driver 'cp210x|ch341'
# If set to 1, auto-detection of TTYs will also allow clones. This has a slight
# disadvantage for users of genuine Arduino Mega 2560: If the board is not
# plugged in, it will fall back to a detection that may yield false positives.
# However, most people will plug in their boards correctly prior to typing
# `make term`, so this is only a small loss for users of genuine
# Arduino Mega 2560 but a big win for users of cheap clones. Still, users that
# only will ever use genuine Arduino Mega 2560 boards can disable this via their
# .profile or .bashrc if they want.
ARDUINO_MEGA2560_COMPAT_WITH_CLONES ?= 1
ifeq (1,$(ARDUINO_MEGA2560_COMPAT_WITH_CLONES))
TTY_SELECT_CMD := $(RIOTTOOLS)/usb-serial/ttys.py \
--most-recent \
--format path serial \
$(TTY_BOARD_FILTER) || \
$(RIOTTOOLS)/usb-serial/ttys.py \
--most-recent \
--format path serial \
$(TTY_BOARD_FILTER_CLONE)
endif
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -72,8 +72,7 @@ to overwrite the bootloader on the MCU. Because of that it is a necessity to use
an ISP (in system programmer) to do the debugging. This isn't an issue because
all of the afore mentioned devices have ISP capabilities, but it requires some
additional steps to get back normal operation after debugging:
* flash a new arduino bootloader on the device, e.g. [this one]
(https://raw.githubusercontent.com/arduino/Arduino-stk500v2-bootloader/master/goodHexFiles/stk500boot_v2_mega2560.hex)
* flash a new arduino bootloader on the device, e.g. [this one](https://raw.githubusercontent.com/arduino/Arduino-stk500v2-bootloader/master/goodHexFiles/stk500boot_v2_mega2560.hex)
* restore the fuses to the default state.

View File

@ -19,12 +19,21 @@
#ifndef BOARD_H
#define BOARD_H
#include "board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name ztimer configuration values
* @{
*/
#define CONFIG_ZTIMER_USEC_ADJUST_SET (132)
#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP (120)
/** @} */
#include "board_common.h"
#ifdef __cplusplus
}
#endif

View File

@ -29,11 +29,6 @@
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 6 on this board
*/
#define ARDUINO_LED (6U)
/**
* @name LED pin definitions and handlers
* @{

View File

@ -40,11 +40,6 @@ extern "C" {
#define ATA8520E_PARAM_RESET_PIN GPIO_PIN(PA, 27)
/** @} */
/**
* @brief The on-board LED is connected to pin 6 on this board
*/
#define ARDUINO_LED (6U)
/**
* @name LED pin definitions and handlers
* @{

View File

@ -16,10 +16,10 @@ powered by an Atmel SAMD21 microcontroller.
### Flash the board
Use `BOARD=arduino-mkrgsm1400` with the `make` command.<br/>
Use `BOARD=arduino-mkrwan1300` with the `make` command.<br/>
Example with `hello-world` application:
```
make BOARD=arduino-mkrgsm1400 -C examples/hello-world flash
make BOARD=arduino-mkrwan1300 -C examples/hello-world flash
```
@note If the application crashes, automatic reflashing via USB, as explained
@ -34,4 +34,4 @@ STDIO of RIOT is directly available over the USB port.
The `TERM_DELAY` environment variable can be used to add a delay (in second)
before opening the serial terminal. The default value is 2s which should be
enough in most of the situation.
*/
*/

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