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 ESP32 #39

Merged
merged 35 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a4d62c1
feat(devboard): Add preliminary support for Adafruit QtPy ESP32 Pico
ZZ-Cat Oct 9, 2023
00ea169
fix(build/compile/verify): Force integer conversion in `min()` function.
ZZ-Cat Oct 9, 2023
4b6955f
fix(build/compile/verify): Resolve incorrect formatting
ZZ-Cat Oct 9, 2023
600264c
docs(readme): Fix typo
ZZ-Cat Oct 10, 2023
99c87f5
docs(readme): Add links to additional boards URLs for supported devel…
ZZ-Cat Oct 10, 2023
f8677b0
feat(devboard): Add preliminary support for Adafruit Feather ESP32
ZZ-Cat Oct 10, 2023
31bc252
feat(devboard): Add preliminary support for Adafruit Feather ESP32-S2
ZZ-Cat Oct 10, 2023
a6a2e1e
build(platformio): Move core directory to the working project directory
ZZ-Cat Oct 11, 2023
94af03b
build(platformio): Add missing default environment in `platformio.ini`
ZZ-Cat Oct 11, 2023
265fd6a
chore(compatibility table): Add missing board ID for Adafruit Feather…
ZZ-Cat Oct 11, 2023
f28d953
feat(devboard): Add preliminary support for Adafruit Metro ESP32-S2
ZZ-Cat Oct 11, 2023
0141487
feat(devboard): Add preliminary support for Adafruit QtPy ESP32-S3
ZZ-Cat Oct 12, 2023
8dd7db0
feat(devboard): Add preliminary support for Adafruit QtPy ESP32-C3
ZZ-Cat Oct 12, 2023
19f35a2
feat(devboard): Add preliminary support for Adafruit Feather ESP32-S3…
ZZ-Cat Oct 16, 2023
11d25c1
feat(devboard): Add preliminary support for Adafruit Feather ESP32-S3…
ZZ-Cat Oct 16, 2023
077f4e0
build(build/compile/verify): Add missing environment configuration fo…
ZZ-Cat Oct 16, 2023
a26b366
build(build/compile/verify): Add missing build flags for both Adafrui…
ZZ-Cat Oct 16, 2023
d331c71
feat(devboard): Add preliminary support for Adafruit ItsyBitsy ESP32
ZZ-Cat Oct 16, 2023
b7e7418
feat(devboard): Add preliminary support for Adafruit QtPy ESP32-S2
ZZ-Cat Oct 16, 2023
feb1ebe
feat(devboard): Add preliminary support for Arduino Nano ESP32
ZZ-Cat Oct 16, 2023
ae6b32e
feat(devboard): Add preliminary support for Espressif ESP32-C3-DevKit…
ZZ-Cat Oct 16, 2023
3acfddf
feat(devboard): Add preliminary support for Espressif ESP32-C3-DevKitM-1
ZZ-Cat Oct 17, 2023
734a14b
fix(compatibility table): Fix typo for DevKit variants of Espressif E…
ZZ-Cat Oct 17, 2023
736f214
feat(devboard): Add preliminary support for Espressif ESP32-S3-DevKitC-1
ZZ-Cat Oct 17, 2023
6500126
feat(devboard): Add preliminary support for Seeed Studio Xiao ESP32-C3
ZZ-Cat Oct 17, 2023
09e560e
feat(devboard): Add preliminary support for Seeed Studio Xiao ESP32-S3
ZZ-Cat Oct 17, 2023
423a6f6
feat(devboard): Add preliminary support for SparkFun ESP32 IoT RedBoard
ZZ-Cat Oct 18, 2023
8be5351
feat(devboard): Add preliminary support for SparkFun ESP32 Thing
ZZ-Cat Oct 18, 2023
0b4c287
feat(devboard): Add preliminary support for SparkFun ESP32 Thing Plus
ZZ-Cat Oct 18, 2023
c0313f4
feat(devboard): Add preliminary support for SparkFun ESP32-S2 WROOM T…
ZZ-Cat Oct 18, 2023
f9bc28f
build(build/compile/verify): Revert default environment back to Adafr…
ZZ-Cat Oct 18, 2023
2b15847
Merge branch 'Main-Trunk' into ZZ-Cat/issue38
ZZ-Cat Oct 18, 2023
9dfac0b
docs(readme): Populate list of ESP32 based development boards
ZZ-Cat Oct 18, 2023
3f1380a
docs(issue templates): Populate development board dropdown menu with …
ZZ-Cat Oct 18, 2023
7c19e15
docs(issue templates): Populate development boards dropdown menu with…
ZZ-Cat Oct 18, 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
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,27 @@ body:
Please select the board you are using.
Please note that only the boards listed below are supported.
options:
- Adafruit Feather ESP32
- Adafruit Feather ESP32-S2
- Adafruit Feather ESP32-S3 (2 MB PSRAM)
- Adafruit Feather ESP32-S3 (No PSRAM)
- 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 ESP32
- Adafruit ItsyBitsy M0 Express
- Adafruit ItsyBitsy M4 Express
- Adafruit Metro ESP32-S2
- Adafruit Metro M0 Express
- Adafruit Metro M4 Express
- Adafruit Metro M4 AirLift Lite
- Adafruit QtPy ESP32
- Adafruit QtPy ESP32 Pico
- Adafruit QtPy ESP32-C3
- Adafruit QtPy ESP32-S2
- Adafruit QtPy ESP32-S3
- Adafruit QtPy M0
- Adafruit Trinket M0
- Arduino MKR 1000
Expand All @@ -54,8 +65,22 @@ body:
- Arduino MKR WiFi 1010
- Arduino MKR ZERO
- Arduino Nano 33 IoT
- Arduino Nano ESP32
- Arduino Zero
- Espressif ESP32-C3 DevKitC-02
- Espressif ESP32-C3 DevKitM-1
- Espressif ESP32-S3 DevKitC-1-N8
- SparkFun ESP32 RedBoard IoT
- SparkFun ESP32 Thing
- SparkFun ESP32 Thing Plus
- SparkFun ESP32-S2 Thing Plus
- Seeed Studio XIAO SAMD21
- Teensy 3.0
- Teensy 3.1/3.2
- Teensy 3.5
- Teensy 3.6
- Teensy 4.0
- Teensy 4.1
validations:
required: true
- type: dropdown
Expand Down
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ This provides you with up to 16 11-bit full resolution channels & telemetry with
If you want to use CRSF for Arduino in the Arduino IDE, you need these:

- [Arduino IDE](https://www.arduino.cc/en/software)
- [Arduino SAMD Board Support Pack](https://github.com/arduino/ArduinoCore-samd)
- [Adafruit SAMD Board Support Pack](https://github.com/adafruit/ArduinoCore-samd)
- [Adafruit_ZeroDMA](https://github.com/adafruit/Adafruit_ZeroDMA)
- ESP32 targets:
- Additional Boards URL: `https://espressif.github.io/arduino-esp32/package_esp32_index.json`
- [Arduino ESP32 Board Support Pack](https://github.com/espressif/arduino-esp32)
- SAMD21 & SAMD51 targets:
- Additional Boards URL: `https://adafruit.github.io/arduino-board-index/package_adafruit_index.json`
- [Arduino SAMD Board Support Pack](https://github.com/arduino/ArduinoCore-samd)
- [Adafruit SAMD Board Support Pack](https://github.com/adafruit/ArduinoCore-samd)
- [Adafruit_ZeroDMA](https://github.com/adafruit/Adafruit_ZeroDMA)
- Teensy 3.x & Teensy 4.x targets:
- Additional Boards URL: `https://www.pjrc.com/teensy/package_teensy_index.json`
- [Teensy Board Support Pack](https://github.com/PaulStoffregen/cores)

## Prerequisites - Visual Studio Code & PlatformIO

Expand Down Expand Up @@ -336,6 +344,27 @@ For example, if you are using an Adafruit Metro M4 Express, you would use `pio r
CRSF for Arduino is designed to be compatible with modern hardware.
While CRSF for Arduino is primarily developed on the Adafruit Metro M4 Express, here is a list of target development boards CRSF for Arduino is compatible with (Keep in mind that this list is not exhaustive, & actual compatibility with everything listed here may be untested):

- ESP32 based boards:
- Adafruit Feather ESP32
- Adafruit Feather ESP32-S2
- Adafruit Feather ESP32-S3 (2 MB PSRAM)
- Adafruit Feather ESP32-S3 (NO PSRAM)
- Adafruit ItsyBitsy ESP32
- Adafruit Metro ESP32-S2
- Adafruit QtPy ESP32
- Adafruit QtPy ESP32 Pico
- Adafruit QtPy ESP32-C3
- Adafruit QtPy ESP32-S2
- Adafruit QtPy ESP32-S3
- Arduino Nano ESP32
- Espressif ESP32-C3-DevKit
- Espressif ESP32-S3-DevKit
- Seeed Studio XIAO ESP32-C3
- Seeed Studio XIAO ESP32-S3
- SparkFun ESP32 RedBoard IoT
- SparkFun ESP32 Thing
- SparkFun ESP32 Thing Plus
- SparkFun ESP32-S2 Thing Plus
- SAMD21 based boards:
- Adafruit Feather M0 & all of its variants, including the Adafruit Feather M0 Express
- Adafruit ItsyBitsy M0 Express
Expand All @@ -362,7 +391,7 @@ While CRSF for Arduino is primarily developed on the Adafruit Metro M4 Express,
- Adafruit Metro M4 Express AirLift Lite
- SAME51 based boards:
- Adafruit Feather M4 CAN Express
- Teensy 3.x
- Teensy 3.x
**NB:** The entire Teensy 3.x line is discontinued by the manufacturer, and is _not_ recommended for new projects.
- Teensy 4.x

Expand Down
144 changes: 143 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,147 @@ debug_tool = ${common_samd51.debugger}
lib_deps = ${common_samd51.lib_deps}
upload_protocol = ${common_samd51.sketch_upload_protocol}

; ESP32 Boards
[env:adafruit_qtpy_esp32]
platform = espressif32
board = adafruit_qtpy_esp32
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_qtpy_esp32c3]
platform = espressif32
board = adafruit_qtpy_esp32c3
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_qtpy_esp32s2]
platform = espressif32
board = adafruit_qtpy_esp32s2
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_qtpy_esp32s3_nopsram]
platform = espressif32
board = adafruit_qtpy_esp32s3_nopsram
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:featheresp32-s2]
platform = espressif32
board = featheresp32-s2
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_feather_esp32s3]
platform = espressif32
board = adafruit_feather_esp32s3
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_feather_esp32s3_nopsram]
platform = espressif32
board = adafruit_feather_esp32s3_nopsram
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:featheresp32]
platform = espressif32
board = featheresp32
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_itsybitsy_esp32]
platform = espressif32
board = adafruit_itsybitsy_esp32
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:adafruit_metro_esp32s2]
platform = espressif32
board = adafruit_metro_esp32s2
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:arduino_nano_esp32]
platform = espressif32
board = arduino_nano_esp32
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:esp32-c3-devkitc-02]
platform = espressif32
board = esp32-c3-devkitc-02
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:seeed_xiao_esp32c3]
platform = espressif32
board = seeed_xiao_esp32c3
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:seeed_xiao_esp32s3]
platform = espressif32
board = seeed_xiao_esp32s3
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:sparkfun_esp32_iot_redboard]
platform = espressif32
board = sparkfun_esp32_iot_redboard
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:esp32thing]
platform = espressif32
board = esp32thing
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:esp32thing_plus]
platform = espressif32
board = esp32thing_plus
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

[env:sparkfun_esp32s2_thing_plus]
platform = espressif32
board = sparkfun_esp32s2_thing_plus
build_flags =
-DUSE_ABSTRACTION_LAYER
-DCRC_OPTIMISATION_LEVEL=0

; Teensy Boards
[env:teensy_30]
platform = teensy
Expand Down Expand Up @@ -306,7 +447,8 @@ build_flags =
-DCRC_OPTIMISATION_LEVEL=0

[platformio]
default_envs = adafruit_metro_m0
default_envs = adafruit_metro_m4
core_dir = $PROJECT_DIR/.pio/core
include_dir = src/include
lib_dir = src/lib
src_dir = src/src
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,63 @@ namespace hal
// TEMPORARILY DISABLED: Arduino IDE must be 1.7.0 or greater
// #if ARDUINO >= 10700

// Arduino ESP32 Architecture
#if defined(ARDUINO_ARCH_ESP32)

// Adafruit devboards
#if defined(ARDUINO_FEATHER_ESP32)
device.type.devboard = DEVBOARD_ADAFRUIT_FEATHER_ESP32;
#elif defined(ARDUINO_METRO_ESP32S2)
device.type.devboard = DEVBOARD_ADAFRUIT_METRO_ESP32S2;
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_NOPSRAM)
device.type.devboard = DEVBOARD_ADAFRUIT_FEATHER_ESP32S2;
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3)
device.type.devboard = DEVBOARD_ADAFRUIT_FEATHER_ESP32S3;
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM)
device.type.devboard = DEVBOARD_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM;
#elif defined(ARDUINO_ADAFRUIT_ITSYBITSY_ESP32)
device.type.devboard = DEVBOARD_ADAFRUIT_ITSYBITSY_ESP32;
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3)
device.type.devboard = DEVBOARD_ADAFRUIT_QTPY_ESP32C3;
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
device.type.devboard = DEVBOARD_ADAFRUIT_QTPY_ESP32S2;
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM)
device.type.devboard = DEVBOARD_ADAFRUIT_QTPY_ESP32S3;
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO)
device.type.devboard = DEVBOARD_ADAFRUIT_QTPY_ESP32_PICO;

// Espressif devboards.
#elif defined(ARDUINO_ESP32C3_DEV)
device.type.devboard = DEVBOARD_ESPRESSIF_ESP32C3_DEVKIT;
#elif defined(ARDUINO_ESP32S3_DEV)
device.type.devboard = DEVBOARD_ESPRESSIF_ESP32S3_DEVKIT;

// Seeed Studio ESP32 devboards.
#elif defined(ARDUINO_XIAO_ESP32C3)
device.type.devboard = DEVBOARD_SEEEDSTUDIO_XIAO_ESP32C3;
#elif defined(ARDUINO_XIAO_ESP32S3)
device.type.devboard = DEVBOARD_SEEEDSTUDIO_XIAO_ESP32S3;

// SparkFun ESP32 devboards.
#elif defined(ARDUINO_ESP32_IOT_REDBOARD)
device.type.devboard = DEVBOARD_SPARKFUN_REDBOARD_ESP32_IOT;
#elif defined(ARDUINO_ESP32_THING)
device.type.devboard = DEVBOARD_SPARKFUN_THING_ESP32;
#elif defined(ARDUINO_ESP32_THING_PLUS)
device.type.devboard = DEVBOARD_SPARKFUN_THING_PLUS_ESP32;
#elif defined(ARDUINO_ESP32S2_THING_PLUS)
device.type.devboard = DEVBOARD_SPARKFUN_THING_PLUS_ESP32S2;

// Arduino devboards
#elif defined(ARDUINO_NANO_ESP32)
device.type.devboard = DEVBOARD_ARDUINO_NANO_ESP32;
#else
#warning "Devboard not supported. Please check the compatibility table."
device.type.devboard = DEVBOARD_IS_INCOMPATIBLE;
#endif

// Arduino SAMD Architecture
#if defined(ARDUINO_ARCH_SAMD)
#elif defined(ARDUINO_ARCH_SAMD)

// Adafruit devboards
#if USB_VID == 0x239A
Expand Down
Loading