Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(devboard): Add support for Seeed Studio XIAO SAMD21 #27

Merged
merged 62 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
24706af
chore(library): Bump version number to 0.4.0
ZZ-Cat Jul 16, 2023
c65db39
feat(devboard): Initial support for Seeed XIAO
ZZ-Cat Jul 16, 2023
1e3b8dd
docs(readme): Add Seeed Studio XIAO to the list of compatible develop…
ZZ-Cat Jul 16, 2023
d28fb63
fix: Fix typos in `CompatibilityTable.h` & `CRSFforArduino.cpp`
ZZ-Cat Jul 17, 2023
fdc7a0b
chore(compatibility table): Exit initialisation, if the target devboa…
ZZ-Cat Jul 17, 2023
8743a21
feat(hal): Add a validitiy check on the SERCOM
ZZ-Cat Jul 17, 2023
105c0e6
feat(library): Add various debug messages.
ZZ-Cat Jul 17, 2023
5743a41
refactor(arduino): Defer error handling to user sketch layer.
ZZ-Cat Jul 17, 2023
37b727d
refactor(platformio): Defer error handling to user sketch layer.
ZZ-Cat Jul 17, 2023
436459a
refactor(compatibility table): Use USB VIDs & PIDs to detect compatib…
ZZ-Cat Jul 19, 2023
3e45052
chore(library): Bump version number to 0.4.0
ZZ-Cat Jul 16, 2023
4f538d4
feat(devboard): Initial support for Seeed XIAO
ZZ-Cat Jul 16, 2023
82c6f7a
docs(readme): Add Seeed Studio XIAO to the list of compatible develop…
ZZ-Cat Jul 16, 2023
9c72b75
fix: Fix typos in `CompatibilityTable.h` & `CRSFforArduino.cpp`
ZZ-Cat Jul 17, 2023
efbe2d0
chore(compatibility table): Exit initialisation, if the target devboa…
ZZ-Cat Jul 17, 2023
b0b3fc9
feat(hal): Add a validitiy check on the SERCOM
ZZ-Cat Jul 17, 2023
000f188
feat(library): Add various debug messages.
ZZ-Cat Jul 17, 2023
b151fa7
refactor(arduino): Defer error handling to user sketch layer.
ZZ-Cat Jul 17, 2023
0fcaa0c
refactor(platformio): Defer error handling to user sketch layer.
ZZ-Cat Jul 17, 2023
6e401cd
Merge branch 'Testing-SeeedXIAO-Support' of https://github.com/ZZ-Cat…
ZZ-Cat Jul 19, 2023
b88510e
chore(library): Cleanup rebase botches
ZZ-Cat Jul 19, 2023
9c6e75f
refactor(crsf): Deprecate existing unpacking of RC Channels Data
ZZ-Cat Jul 21, 2023
6b58bd5
refactor(crsf): Use Packed RC Channels Data
ZZ-Cat Jul 21, 2023
707e164
chore(crsf): Clean up deprecated code
ZZ-Cat Jul 21, 2023
e0d5973
refactor(hal): Remove changing data order
ZZ-Cat Jul 21, 2023
869a885
chore(hal): Move `getSercom()` function inside the DMA initialisation
ZZ-Cat Jul 21, 2023
d34688d
docs(readme): Remove paragraph regardin changing the UART data order
ZZ-Cat Jul 21, 2023
f954c00
docs(readme): Add a full list of minimum requirements
ZZ-Cat Jul 21, 2023
21bdbf0
docs(readme): Add a paragraph regarding compatibility issues for devb…
ZZ-Cat Jul 21, 2023
1407e13
chore(library): Fix formatting errors
ZZ-Cat Jul 21, 2023
bba5230
chore(library): Bump version number to 0.3.4
ZZ-Cat Jul 21, 2023
d39bba0
Merge pull request #30 from ZZ-Cat:testing-packedRCchannels
ZZ-Cat Jul 21, 2023
17bc536
ci(github): Add Devboard Compatibility Request form
ZZ-Cat Jul 21, 2023
08878d4
ci(github): Rename devboard-request.yml
ZZ-Cat Jul 21, 2023
49e2b5b
ci(github): Fix typo in devboard-request.yml
ZZ-Cat Jul 21, 2023
d12a6b0
ci(github): Remove `validations` key
ZZ-Cat Jul 21, 2023
39154ce
ci(github): Reinstate `validations` key
ZZ-Cat Jul 21, 2023
aae1f15
ci(github): Move `validations` out of `attributes` block
ZZ-Cat Jul 21, 2023
95fee0e
ci(github): Add an Issue Template config.
ZZ-Cat Jul 21, 2023
a0e19ce
ci(github): Rephrase the `devboard-request` description.
ZZ-Cat Jul 21, 2023
b70f9dc
ci(issue templates): Replace outdated bug report template with new bu…
ZZ-Cat Jul 21, 2023
f1e1531
ci(issue templates): Fix typo in `bug-report.yml`
ZZ-Cat Jul 21, 2023
bf42253
ci(issue templates): Resolve `Name must be unique` error in `bug-repo…
ZZ-Cat Jul 21, 2023
421c4ad
ci(issue templates): Add `Pending 📌` label to `bug-report.yml`
ZZ-Cat Jul 21, 2023
fc21138
ci(github actions): Increase number of days before auto-close to 60 days
ZZ-Cat Jul 21, 2023
dfcb94b
ci(github actions): Update exempt Issues & Pull Request labels
ZZ-Cat Jul 21, 2023
35f61c7
ci(issue templates): Replace outdated feature request template with a…
ZZ-Cat Jul 21, 2023
c3057dc
chore(issue templates): Remove deprecated issue templates
ZZ-Cat Jul 22, 2023
a8fd898
chore(library): Bump version number to 0.4.0
ZZ-Cat Jul 16, 2023
8c043d2
feat(devboard): Initial support for Seeed XIAO
ZZ-Cat Jul 16, 2023
e940985
docs(readme): Add Seeed Studio XIAO to the list of compatible develop…
ZZ-Cat Jul 16, 2023
b0ff0a1
fix: Fix typos in `CompatibilityTable.h` & `CRSFforArduino.cpp`
ZZ-Cat Jul 17, 2023
1383c41
chore(compatibility table): Exit initialisation, if the target devboa…
ZZ-Cat Jul 17, 2023
c39568e
feat(library): Add various debug messages.
ZZ-Cat Jul 17, 2023
564f729
refactor(arduino): Defer error handling to user sketch layer.
ZZ-Cat Jul 17, 2023
99acaac
refactor(platformio): Defer error handling to user sketch layer.
ZZ-Cat Jul 17, 2023
05b8048
feat(devboard): Initial support for Seeed XIAO
ZZ-Cat Jul 16, 2023
b3b33fe
fix: Fix typos in `CompatibilityTable.h` & `CRSFforArduino.cpp`
ZZ-Cat Jul 17, 2023
5718ae3
chore(library): Cleanup rebase botches
ZZ-Cat Jul 19, 2023
2dc2c0d
Merge branch 'Testing-SeeedXIAO-Support' of https://github.com/ZZ-Cat…
ZZ-Cat Jul 22, 2023
ffd25e1
chore(library): Fix minor rebase errors
ZZ-Cat Jul 22, 2023
23fb987
chore(issue templates): Add Seeed Studio XIAO SAMD21 as an option to …
ZZ-Cat Jul 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Submit a bug report
description: Create a bug report & help me improve CRSF for Arduino
labels: ["🐞 Bug 🐞", "Pending 📌"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report a bug in CRSF for Arduino.
Please fill out the form below to help me improve CRSF for Arduino.
- type: checkboxes
attributes:
label: Is there an existing issue for this bug?
description: Please check if there is already an issue for this bug.
options:
- label: I have searched the issues and there is no existing issue for this bug.
required: true
- type: dropdown
id: development-environment
attributes:
label: What development environment are you using?
description: Are you using the Arduino IDE or PlatformIO?
options:
- Arduino IDE
- PlatformIO
validations:
required: true
- type: dropdown
id: board
attributes:
label: What board are you using?
description: |
Please select the board you are using.
Please note that only the boards listed below are supported.
options:
- Adafruit Feather M0 (Any variants EG Bluefruit LE, LoRa, etc)
- Adafruit Feather M0 Express
- Adafruit Feather M4 Express
- Adafruit Feather M4 CAN Express
- Adafruit Grand Central M4
- Adafruit ItsyBitsy M0 Express
- Adafruit ItsyBitsy M4 Express
- Adafruit Metro M0 Express
- Adafruit Metro M4 Express
- Adafruit Metro M4 AirLift Lite
- Adafruit QtPy M0
- Adafruit Trinket M0
- Arduino MKR 1000
- Arduino MKR FOX 1200
- Arduino MKR GSM 1400
- Arduino MKR NB 1500
- Arduino MKR VIDOR 4000
- Arduino MKR WAN 1300
- Arduino MKR WAN 1310
- Arduino MKR WiFi 1010
- Arduino MKR ZERO
- Arduino Nano 33 IoT
- Arduino Zero
- Seeed Studio XIAO SAMD21
validations:
required: true
- type: dropdown
id: bug-type
attributes:
label: What part of CRSF for Arduino is this bug related to?
description: Please select the part of CRSF for Arduino that this bug is related to.
options:
- Build/Compile/Upload
- Compatibility Table
- RC Channels
- Other (please specify)
validations:
required: true
- type: textarea
attributes:
label: Current behaviour
description: Provide a clear & concise description of the bug.
placeholder: |
A clear and concise description of what the bug is.
EG: When I try to compile the code I get this error...
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
description: Provide a clear & concise description of what you expected to happen.
placeholder: |
A clear and concise description of what you expected to happen.
EG: The code should compile without any errors.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: |
Provide a clear & concise description of how to reproduce the bug.
Please include any code that is required to reproduce the bug.
placeholder: |
A clear and concise description of how to reproduce the bug.
EG: To reproduce the bug, compile the code with the following settings...
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: |
Provide any additional information that may be relevant to the bug.
EG: I am using the following version of the Arduino IDE...

Tip: You can paste code, logs, or config files into the text box below.
Screenshots can also be pasted into the text box below.
validations:
required: false
28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/devboard-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Devboard Compatibility Request
description: Tell me which development board you would like me to add to CRSF for Arduino.
labels: ["✨️ Enhancement ✨️"]
body:
- type: markdown
attributes:
value: |
Request your development board to be added to CRSF for Arduino's Compatibility Table.
- type: checkboxes
attributes:
label: Minimum requirements
description: |
Your devboard _must_ meet these requirements in order for it to be compatible with CRSF for Arduino.
Please check your development board's documentation & the data sheet of its host microcontroller for more information.
options:
- label: Core clock speed is 48 MHz or faster?
required: true
- label: Is the CPU an ARM Cortex M0+ or later?
required: true
- label: Is the host microcontroller's UART peripheral able to support 420,000 (or higher) baud rate(s)?
required: true
- label: Is your development board currently supported in the Arduino IDE?
required: true
- type: textarea
attributes:
label: What development board would you like me to add?
description: |
Provide a clear & concise description of what your devboard is, what its host microcontroller is,
& provide links to the development board's documentation & the data sheet of its host microcontroller.
placeholder: My development board is...
validations:
required: true
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Submit a feature request
description: Suggest an idea for CRSF for Arduino to help make it better.
labels: ["✨️ Enhancement ✨️"]
body:
- type: markdown
attributes:
value: |
Thank you for suggesting an idea for CRSF for Arduino!

If your idea is still in its early stages or you're not sure if it will benefit my project,
you can open a discussion in the [Ideas](https://github.com/ZZ-Cat/CRSFforArduino/discussions/categories/ideas) category instead.
- type: checkboxes
attributes:
label: Is there already an issue for this?
description: Please check if there is already an issue for this feature request.
options:
- label: I have searched the issues and there is no existing issue for this feature request.
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: Please provide a clear & concise description of what the problem is.
placeholder: I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: Please provide a clear & concise description of what you want to happen.
placeholder: I'd like to be able to [...]
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: Please provide a clear & concise description of any alternative solutions or features you've considered.
placeholder: |
I have considered [...]
But it will not work because [...]
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Please provide any other context or screenshots about the feature request here.
placeholder: |
Add any other context or screenshots about the feature request here.
EG: I am using [...]
EG: I am using the following version of CRSF for Arduino [...]
validations:
required: false
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/auto_close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
stale-issue-message: 'This issue has been closed due to inactivity in over 30 days after being marked for closure.'
stale-pr-message: 'This pull request has been closed due to inactivity in over 30 days after being marked for closure.'
days-before-stale: 30
days-before-close: 30
days-before-close: 60
stale-issue-label: 'Stale 🚮'
exempt-issue-labels: '🚨 Help Wanted 🚨'
exempt-issue-labels: '🚨 Help Wanted 🚨, Note to self ✏️🗒, Pending 📌'
stale-pr-label: 'Stale 🚮'
exempt-pr-labels: 'Bug Fix 👋🐞💥, 🚨 Help Wanted 🚨'
exempt-pr-labels: 'Bug Fix 👋🐞💥, 🚨 Help Wanted 🚨, ⤴️ Rebase Needed ⤴️'
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ While CRSF for Arduino is primarily developed on the Adafruit Metro M4 Express,
- MKR Zero
- Arduino Nano 33 IoT
- Arduino Zero
- Seeed Studio XIAO SAMD21
- SAMD51 based boards:
- Adafruit Feather M4 Express
- Adafruit Grand Central M4
Expand All @@ -219,12 +220,16 @@ While CRSF for Arduino is primarily developed on the Adafruit Metro M4 Express,

Compatibility with other microcontroller boards may be added in future, if there is demand for it. Keep in mind that this will be subject to hardware limitations of the host microcontroller itself.

Generally speaking, if the host microcontroller's UART peripheral supports 420k bauds (or higher), it is a likely candidate for CRSF for Arduino. Bonus points if the microcontroller has DMA (Direct Memory Access), because this helps immensely to capture RC data & send out telemetry data.
In order for CRSF for Arduino to run, the host microcontroller _must_ meet these minimum requirements:

The only limitation so far is the microcontroller's ability to change the UART's data order. CRSF requires data to be transmitted & received in MSB (Most Significant Bit) First. Traditionally, UART is transmitted & received in LSB (Least Significant Bit) First. ATSAMD21 & ATSAMD51 microcontrollers are the only two Arduino-compatible microcontrollers (that I am aware of) that have the ability to select what data order the UART is sent & received as.
- Core Clock Speed: 48 MHz or higher.
- CPU: ARM Cortex M0+ or later.
- UART Baud Rate: 420 KB/s.

I am now aware that Arduino are making an R4 of their UNO & Adafruit are making a Metro M7. This is exciting news for me, because I would like to make these development boards fully compatible with CRSF for Arduino as & when their respective underlying code & toolchain support is added.

As for other development boards (& their host microcontrollers), if they meet the minimum requirements & you are still having compatibility issues, it is likely that I have not yet added your board to the Compatibility Table. Consider opening up an [Issue](https://github.com/ZZ-Cat/CRSFforArduino/issues/new/choose) & we can go from there.

## AVR based microcontrollers are not compatible

Development boards of yesteryear that were built around ATmega AVR microcontrollers such as the 328, 32u4, 2560 & 4809 are incompatible with CRSF for Arduino.
Expand All @@ -251,6 +256,7 @@ Here are some examples:
- These have an equivalent "breadboard-friendly" form factor that is similar to the Arduio Micro & the Arduino Nano:
- Adafruit Feather M0 (all variants, including the Feather M0 Express)
- Adafruit Feather M4 Express
- Seeed Studio XIAO SAMD21
- These have the "Arduino R3" form factor - The same shape as the Arduino UNO:
- Adafruit:
- Metro M0 Express
Expand All @@ -276,6 +282,10 @@ For wiring, here is how you do it:
- T (or Tx) on your receiver goes to ►Rx/Pin0 on your development board. This step can catch you out, if you're not careful.
- R (or Rx) on your reciever goes to ◄Tx/Pin1 on your development board. This step can catch you out, if you're not careful.

**NB:** Some development boards (especially smaller ones) may not route the primary UART port to the default 0 & 1 pins, as these pins may be used for other purposes or they simply are not physically available to you on the device.
As a workaround, CRSF for Arduino automatically selects the closest available pins that has a suitable UART port.
You _must_ refer to your development board's documentation to determine where your default Tx & Rx pins are. These are the pins that CRSF for Arduino will use.

## Telemetry

Currently, there is no telemetry feedback from the host microcontroller's side... _yet!_
Expand Down
13 changes: 10 additions & 3 deletions examples/channels/channels.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file channels.ino
* @author Cassandra "ZZ Cat" Robinson ([email protected])
* @brief This example sketch shows how to receive RC channels from a CRSF receiver using the CRSF for Arduino library.
* @version 0.3.2
* @date 2023-06-03
* @version 0.4.0
* @date 2023-07-17
*
* @copyright Copyright (c) 2023, Cassandra "ZZ Cat" Robinson. All rights reserved.
*
Expand Down Expand Up @@ -118,7 +118,14 @@ void setup()
}

// Initialize the CRSFforArduino library.
crsf.begin();
if (!crsf.begin())
{
Serial.println("CRSF for Arduino initialization failed!");
while (1)
{
;
}
}

// Show the user that the sketch is ready.
Serial.println("RC Channels Example");
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CRSFforArduino
version=0.3.2
version=0.4.0
author=Cassandra Robinson <[email protected]>
maintainer=Cassandra Robinson <[email protected]>
sentence=An Arduino Library for communicating with ExpressLRS receivers.
Expand Down
8 changes: 6 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ lib_deps = ${common.lib_deps}
board = mkrzero
lib_deps = ${common.lib_deps}

[env:seeed_xiao]
board = seeed_xiao
lib_deps = ${common.lib_deps}

[env:zero]
board = zero
lib_deps = ${common.lib_deps}
Expand All @@ -113,8 +117,8 @@ board_build.f_cpu = ${common.cpu_speed}
build_flags = ${common.compile_flags}
lib_deps = ${common.lib_deps}

[env:adafruit_grand_central_m4]
board = adafruit_grand_central_m4
[env:adafruit_grandcentral_m4]
board = adafruit_grandcentral_m4
board_build.f_cpu = ${common.cpu_speed}
build_flags = ${common.compile_flags}
debug_tool = ${common.debugger}
Expand Down
4 changes: 2 additions & 2 deletions src/CRSFforArduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @file CRSFforArduino.h
* @author Cassandra "ZZ Cat" Robinson ([email protected])
* @brief Top level header for CRSF for Arduino, to help with Arduino IDE compatibility.
* @version 0.3.2
* @date 2023-06-03
* @version 0.4.0
* @date 2023-07-17
*
* @copyright Copyright (c) 2023, Cassandra "ZZ Cat" Robinson. All rights reserved.
*
Expand Down
Loading