Skip to content

Conversation

@ZZ-Cat
Copy link
Owner

@ZZ-Cat ZZ-Cat commented Nov 1, 2025

Right-oh. Been a hot minute since I last made any Pull Requests for new targets.
As per #159, this adds support for the DOIT ESP32 DevKit V1.

I have been made aware that there may also be a conflict between CFA and how this target handles UART, as it uses The Old Skool Method™️ of sharing the default UART with an external Serial-to-USB converter chip.

So I have marked this Pull Request as a draft until this gets sorted.

@ZZ-Cat ZZ-Cat self-assigned this Nov 1, 2025
@ZZ-Cat ZZ-Cat added ✨️ Enhancement ✨️ New feature or request ...in progress 🚧 Development on this is in progress labels Nov 1, 2025
@ZZ-Cat
Copy link
Owner Author

ZZ-Cat commented Nov 2, 2025

Right-oh @DurvalMenezes, you're up. =^/.^=

You can check-out the topic branch either by downloading-and-extracting the zip to where you have CFA currently installed relative to your IDE, or do a git clone -b ZZ-Cat/issue159 https://github.com/ZZ-Cat/CRSFforArduino.git

Then in CFA_Config.hpp, enable CRSF_DEBUG_ENABLED as well as CRSF_DEBUG_ENABLE_COMPATIBILITY_TABLE_OUTPUT and CRSF_DEBUG_ENABLE_CONFIGURATION_DUMP.

Then flash your choice of examples to your development board.
To keep it simple for now, I recommend picking the rc_channels.ino file.

If you're getting grief on the default port, try the ESP32-specific constructor CRSFforArduino(HardwareSerial *serialPort, int RxPin, int TxPin)

Example:

#include "CRSFforArduino.h"

/* Define your custom UART pinouts here. */
#define MY_UART_RX_PIN 2
#define MY_UART_TX_PIN 3

/* Declare a null pointer to CRSF for Arduino. */
CRSFforArduino *crsf = nullptr;

void setup()
{
    /* Instantiate CRSF for Arduino with your custom pins. */
    crsf = new CRSFforArduino(&Serial1, MY_UART_RX_PIN, MY_UART_TX_PIN);
}

void loop()
{
    /* Your main code here... */
}

In this case, you may also need to point Serial1 (or whichever UART instance you are using) to what pins you are trying to use as well.

CRSF for Arduino supports custom baud rates as well. Although it defaults to 416,666 if you do not specify a baud rate when begin() is called.

@ZZ-Cat ZZ-Cat changed the title feat(targets): Add ESP32 DOIT DevKit V1 to Compatibility Table feat(targets): Add DOIT ESP32 DevKit V1 to Compatibility Table Nov 2, 2025
@ZZ-Cat
Copy link
Owner Author

ZZ-Cat commented Nov 2, 2025

Also fuck my dyslexia. =</.>=
I been calling it "ESP32 DOIT" this entire time, and only now realised it's "DOIT ESP32" and not the other way around.

@DurvalMenezes
Copy link

DurvalMenezes commented Nov 2, 2025

Right-oh @DurvalMenezes, you're up. =^/.^=

DurvalMenezes.state = UP
:-)

Seriously, thanks for the detailed instructions. Followed them to the letter and here's what trying to compile rc_channels.ino gets me:

/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp: In member function 'bool serialReceiverLayer::SerialReceiver::begin(uint32_t)':
/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp:365:55: error: 'PIN_SERIAL1_RX' was not declared in this scope
  365 |         CRSF_DEBUG_SERIAL_PORT.println(_rxPin == -1 ? PIN_SERIAL1_RX : _rxPin);
      |                                                       ^~~~~~~~~~~~~~
/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp:367:55: error: 'PIN_SERIAL1_TX' was not declared in this scope
  367 |         CRSF_DEBUG_SERIAL_PORT.println(_txPin == -1 ? PIN_SERIAL1_TX : _txPin);
      |                                                       ^~~~~~~~~~~~~~
exit status 1

Compilation error: exit status 1

Looks like a couple of #define's are missing. So, where did I mess it up?

@DurvalMenezes
Copy link

DurvalMenezes commented Nov 2, 2025

Also fuck my dyslexia. =</.>=
I been calling it "ESP32 DOIT" this entire time, and only now realised it's "DOIT ESP32" and not the other way around.

He who has never inverted two words in entirely arbitrary names may cast the first nasty comment... :-)

@ZZ-Cat
Copy link
Owner Author

ZZ-Cat commented Nov 26, 2025

Right-oh @DurvalMenezes, you're up. =^/.^=

DurvalMenezes.state = UP :-)

Seriously, thanks for the detailed instructions. Followed them to the letter and here's what trying to compile rc_channels.ino gets me:

/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp: In member function 'bool serialReceiverLayer::SerialReceiver::begin(uint32_t)':
/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp:365:55: error: 'PIN_SERIAL1_RX' was not declared in this scope
  365 |         CRSF_DEBUG_SERIAL_PORT.println(_rxPin == -1 ? PIN_SERIAL1_RX : _rxPin);
      |                                                       ^~~~~~~~~~~~~~
/REDACTED/Arduino/libraries/CRSFforArduino/src/SerialReceiver/SerialReceiver.cpp:367:55: error: 'PIN_SERIAL1_TX' was not declared in this scope
  367 |         CRSF_DEBUG_SERIAL_PORT.println(_txPin == -1 ? PIN_SERIAL1_TX : _txPin);
      |                                                       ^~~~~~~~~~~~~~
exit status 1

Compilation error: exit status 1

Looks like a couple of #define's are missing. So, where did I mess it up?

Ah. From what I can see, the ESP32 board support package isn't providing pin definitions for its default Serial1 pins... or if it is, it's likely to be named something else, and CFA has missed it.

Usually when the pins aren't declared in CFA's constructor, CFA will favour default UART pins for compatible hardware and that means using the definitions provided by the variant.h header in the target's board support package.

Upon further inspection (in the Arduino Espressif32 board support package), there is no variant.h header. Instead there is a pins_arduino.h header and the only definitions that refer to the UART pins are straight-up TX and RX, which... in the case of your devlopment board, that refers to pins 1 and 3 respectively. That is where the missing defines are.

I can do a workaround for this that will automatically point PIN_SERIAL_TX and PIN_SERIAL_RX to their correct defaults if they are previously undefined and your selected target is ESP32-based, because to me it looks like this wee SNAFU applies to the entire ESP32 support line-up and my QC missed it somehow.

The ESP32 board support package does not provide generic `PIN_SERIAL1_RX` and `PIN_SERIAL1_TX` defines. So, these have been added to the Compatibility Table's header for ESP32 targets.

This changes the default UART pins for ESP32 targets to where they should be, instead of using potentially non-existent pins 0 and 1. Refer to your development board's documentation for its default UART pinouts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨️ Enhancement ✨️ New feature or request ...in progress 🚧 Development on this is in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add the DOIT ESP32 DEVKIT V1 / Expressif ESP32 DevKitC to the list of compatible boards

2 participants