I figured since CRSFJoystick uses the crsfSerial library this should be possble. Here's my attempt at getting this to work on an rp2040 based CRSFJoystick:
https://gist.github.com/countofkrakow/1e26d9006461901a3011a02b911ca8a3
I try flashing an rx with the ELRS configurator and it seems to handle the handshake for going into bootloader mode but then I get a timeout after that. I looked into how serialpasssthrough is done by betaflight and copied the logic into a function and tried that but the configurator just hangs indefinitely that way. This can be found commented out in the gist above in checkSerialInPassthrough.
Here is output from the configurator with my adapted arduino code.
`Building in release mode
PLATFORM : 'espressif8266'
BUILD ENV: 'HAPPYMODEL_EP_2400_RX_VIA_BETAFLIGHTPASSTHROUGH'
Retrieving maximum program size .pio\build\HappyModel_EP_2400_RX_via_BetaflightPassthrough\firmware.elf
Checking size .pio\build\HappyModel_EP_2400_RX_via_BetaflightPassthrough\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [==== ] 43.2% (used 35388 bytes from 81920 bytes)
Flash: [==== ] 37.1% (used 379552 bytes from 1023984 bytes)
Configuring upload protocol...
AVAILABLE: custom, espota, esptool
CURRENT: upload_protocol = custom
Uploading .pio\build\HappyModel_EP_2400_RX_via_BetaflightPassthrough\firmware.bin
Uploading .pio\build\HappyModel_EP_2400_RX_via_BetaflightPassthrough\firmware.bin
======== PASSTHROUGH INIT ========
Trying to initialize COM6 @ 420000
Attempting to detect FC UART configuration...
** Serial RX config detected: 'serial 5 64 0 0 0 0'
Enabling serial passthrough...
CMD: 'serialpassthrough 5 420000'
======== PASSTHROUGH DONE ========
======== RESET TO BOOTLOADER ========
- Using full duplex (CRSF)
Cannot detect RX target, blindly flashing!
Uploading .pio\build\HappyModel_EP_2400_RX_via_BetaflightPassthrough\firmware.bin
esptool.py v3.0
Serial port COM6
Connecting......................................_____
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
*** [upload] Error 2
========================= [FAILED] Took 20.10 seconds =========================
Environment Status Duration
HappyModel_EP_2400_RX_via_BetaflightPassthrough FAILED 00:00:20.101
==================== 1 failed, 0 succeeded in 00:00:20.101 ====================`
I looked around on the CRSFJoystick page and mikeneiderhauser thinks it's an issue with dynamic baud rate.
Any ideas?