Skip to content

LR2021 support - #3697

Merged
pkendall64 merged 34 commits into
ExpressLRS:masterfrom
pkendall64:4.2/lr2021
Aug 19, 2026
Merged

pkendall64 merged 34 commits into
ExpressLRS:masterfrom
pkendall64:4.2/lr2021

Conversation

@pkendall64

Copy link
Copy Markdown
Collaborator

Support for the Semtech LR2021.

Why would I want this?

The LR2021 is cross-universe compatible! It supports the subGHz bands compatible with the SX127x (LoRa) and LR1121 in all modes (FSK and LoRa). In the 2.4 modes it's compatible with SX128x (LoRa and FLRC) and the LR1121 (LoRa and FSK).
So you get the packet rate you can possibly want!

The LR2021 is quite different to the, although the command structures and sequences are similar. The DIO controls are very different and for working the ExpressLRS we have a calculator for configuring radio_rfsw_config in the JSON file. https://pkendall64.github.io/rfsw-config/

What's left to do?

Theres still a little bit of work around the power configuration that may be required as the chip has a few extra controls for refining the power output, unlike the LR1121 where you just give it the dBm output level, theres also a "PA_LF_DUTY_CYCLE" and "PA_HF_DUTY_CYCLE", and for subGHz a "PA_LF_SLICES" which should be configured., for different targeted power levels.
We may have to introduce new hardware parameter(s) for these if it can't be built into the driver or if they are materially different for different hardware.

For those that love pretty pictures...

First step, hop and send!

Screenshot 2026-07-12 at 1 17 34 PM This is the SPI traffic for 4 packets in LBT 1:4 TLM, 500Hz LoRa mode. The bottom trace is the tick-tock of the timer. Screenshot 2026-07-12 at 1 35 37 PM 5 uS after our "tock", we hop to the new frequency, send the command to check the RSSI Screenshot 2026-07-12 at 1 37 54 PM To see of we're allowed to send, which we are (hooray) so send the telemetry data to the FIFO and tell the LR2021 to fire away. Screenshot 2026-07-12 at 1 39 46 PM That's around 250us all up till the radio says it's all done. Screenshot 2026-07-12 at 1 42 48 PM Once we get a TXDONE interrupt about 1.58ms later, jump into RX mode so we can get some RC packets! Screenshot 2026-07-12 at 1 48 21 PM

Second, third & fourth step, reading packets

So we got our TXDONE, so we get and clear the interrupts, and swicth to RX mode
Screenshot 2026-07-12 at 1 50 25 PM
Them, some time later... we get an RXDONE interrupt

Screenshot 2026-07-12 at 1 53 11 PM which we clean and read our packet (RC data in this case) and clear the RX fifo as a cleanup. Now we read our packet status, for RSSI and SNR Screenshot 2026-07-12 at 1 55 29 PM and, we're done, so we hang about waiting for another one..., actually 2 in this case and then back to hopping & telemetry writing again.

pkendall64 and others added 23 commits July 12, 2026 14:12
Just a copy of the 1121 driver

# Conflicts:
#	src/html/package.json
#	src/lib/CONFIG/config.cpp
#	src/src/common.cpp
# Conflicts:
#	src/src/common.cpp
Or else you get errors
General cleanup of the LR2021 driver code

Reshuffling so to be more like the 1121 driver

Fix TX parameter order

# Conflicts:
#	src/src/common.cpp

# Conflicts:
#	src/src/rx_main.cpp
#	src/src/tx_main.cpp
# Conflicts:
#	src/lib/LBT/LBT.cpp
# Conflicts:
#	src/html/build-plugins/feature-blocks-plugin.js
#	src/html/features.js
Other cleanup/casting
@pkendall64 pkendall64 added the hardware request Plz support this random chip label Jul 12, 2026
@pkendall64
pkendall64 marked this pull request as ready for review July 12, 2026 02:52
Add specific timeouts for long commands.
Add debugging code that always waits for "busy" to complete, then log the time if greater than timeout.
@lyusupov

Copy link
Copy Markdown

Paul, are there any receiver and/or transmitter devices, that use the LR2021 radio, expected to appear on the market soon ?
Does RadioMaster have plans to upgrade XR1-XR4 family with LR2021 ?

@pkendall64

pkendall64 commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Paul, are there any receiver and/or transmitter devices, that use the LR2021 radio, expected to appear on the market soon ? Does RadioMaster have plans to upgrade XR1-XR4 family with LR2021 ?

That I cannot say, but I'm sure that in time there will be devices that use this chipset.

@GyroGhost

Copy link
Copy Markdown

Thank you, Paul, for the incredible work on adding LR2021 support. Cross-band compatibility with LoRa, FLRC, and FSK opens exciting possibilities for the future of ExpressLRS. We truly appreciate your time and effort! 🩵

@pkendall64 pkendall64 added enhancement 🪄 New feature or request new target 🎯 and removed hardware request Plz support this random chip labels Aug 12, 2026
@lyusupov

lyusupov commented Aug 14, 2026 •

Copy link
Copy Markdown

@GyroGhost

Copy link
Copy Markdown

@pkendall64

That I cannot say, but I'm sure that in time there will be devices that use this chipset.

This one, according to the product name, is supposed to use LR2021 radio

image

Is the new LR-2021-M-TX module already compatible with PR #3697, or will it need a separate hardware target/configuration before it can be used with ExpressLRS 4.2?

@pkendall64

Copy link
Copy Markdown
Collaborator Author

@pkendall64

That I cannot say, but I'm sure that in time there will be devices that use this chipset.

This one, according to the product name, is supposed to use LR2021 radio

Unsupported hardware. The dev team has not tested or approved this hardware let alone even seen this.

@pkendall64

Copy link
Copy Markdown
Collaborator Author

@pkendall64

That I cannot say, but I'm sure that in time there will be devices that use this chipset.

This one, according to the product name, is supposed to use LR2021 radio

Is the new LR-2021-M-TX module already compatible with PR #3697, or will it need a separate hardware target/configuration before it can be used with ExpressLRS 4.2?

Unsupported hardware. The dev team has not tested or approved this hardware let alone even seen this.

@CapnBry CapnBry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to approve this yesterday before I left but Github was having a moment so you're gonna get the short version today!

I tested this with the development RX, and apart from it having absolutely terrible RF performance (hardware design issue seems likely) I could find no other issues. The code seems fine going by you and Mickey's real hardware testing so garbage RSSI aside the code seems to do what it is supposed to.

I ran overnight tests with (one night each):

  • SX1280 TX to LR2021 - F500, D500, 500Hz, 100Hz
  • LR1121 TX to LR2021 - K1000 Full, K1000, 500Hz, 200Hz

Also checking for regressions in existing RF paths, but maybe an hour switching between rates on each:

  • SX1280 TX to SX1280
  • LR1121 TX to LR1121
  • SX127x TX to SX127x

I had one issue when I first installed the firmware, but I can not remember what the problem was and it went away never to be seen again throughout testing. Something about the TX being in Gemini mode and it didn't switch out but it was likely due to the terrible RF performance I encountered.

@mha1

mha1 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

I successfully tested all LR2021 modes with two different development RXs in rx and rx-as-tx configuration against SX128x, SX127x and LR1121 hardware. Establishing connections, up- and down link works as expected. Apart from the already mentioned poor RF performance (RF power) everything looked good.

# Conflicts:
#	src/html/headers/web-lr1121-rx.h
#	src/html/headers/web-lr1121-tx.h
#	src/html/headers/web-sx127x-rx-8285.h
#	src/html/headers/web-sx127x-rx.h
#	src/html/headers/web-sx127x-tx-8285.h
#	src/html/headers/web-sx127x-tx.h
@pkendall64
pkendall64 merged commit 73ce820 into ExpressLRS:master Aug 19, 2026
32 checks passed
@pkendall64
pkendall64 deleted the 4.2/lr2021 branch August 19, 2026 18:28
@StreakingJerry

Copy link
Copy Markdown

Hi, I think for TCXO mode, SetMode(LR1121_MODE_STDBY_RC, radioNumber); in void LR1121Driver::Config(...) should also be changed to SetMode(LR1121_MODE_STDBY_RC, radioNumber);

@pkendall64

Copy link
Copy Markdown
Collaborator Author

Hi, I think for TCXO mode, SetMode(LR1121_MODE_STDBY_RC, radioNumber); in void LR1121Driver::Config(...) should also be changed to SetMode(LR1121_MODE_STDBY_RC, radioNumber);

What? Change the line to exactly the same thing?

@aiagent0619

Copy link
Copy Markdown

Issue report: ESP32-S3 + E80-900M2213S — observed on master after PR #3697 merged

Reposting this from discussion #3313 since PR #3697 also enables LR1121 TCXO config (radio_tcxo / radio_tcxo_delay) and the symptom reproduces on master with these JSON fields set.

Hardware

  • MCU: ESP32-S3 (with PSRAM)
  • Radio module: Ebyte E80-900M2213S (LR1121 + onboard TCXO at 1.8V on VTCXO)
  • Wiring: short flying wires, ~3 cm SPI length
  • MISO pull-up tried (3 kΩ) — no effect on the symptom

Setup

  • ELRS source: master branch after PR LR2021 support #3697 merge
  • JSON config: radio_tcxo: 2 (1.8 V), radio_tcxo_delay: 320
  • TX side: stock E80 + ESP32, runs fine as a control

Observed behavior

  • ESP32 (non-S3) + stock E80: binds and links correctly, every boot.
  • ESP32-S3 + stock E80, same firmware: hal.WriteCommand(LR11XX_SYSTEM_GET_VERSION_OC, ...) fails about 50% of the time.
    • On failure: the returned version bytes are all 0xff (i.e. hardware=0xff type=0xff version=0xffff), so CheckVersion() returns false and LR1121Driver::Begin() exits early.
    • On success: returns the expected 0x07 0x22 0x03 0x01 0x01 (LR1121 FW type 0x03, version 0x0101).
  • The failing 50% case also means SetTcxoMode() is never reached, so VTCXO stays at 0 V on those boots (confirmed by oscilloscope probe on VTCXO pad).
  • Replacing the E80 with an SX1280 module on the same ESP32-S3 board → works every time. So the issue is specific to the LR1121 + ESP32-S3 combination, not the S3 in general and not the wiring.
  • Frequency of failure does not change noticeably across multiple power cycles on the same boot session — it really is ~50/50 between boots.

Experiments done

  1. Shortened SPI wires to <3 cm — no change in failure rate.
  2. Added 3 kΩ external pull-up on MISO — no change.
  3. Swapped E80 for SX1280 module on identical wiring — 100% boot success.
  4. Swapped ESP32-S3 board for a stock ESP32 (WROOM-32) with same E80 and same firmware — 100% boot success.
  5. Set radio_tcxo_delay to 320, 64000, and unset (no TCXO call at all) — same ~50% failure rate on S3 in all three cases.
  6. Reset button does not change the outcome; only a power-cycle re-rolls the 50/50.

The same failure mode (LR1121 CheckVersion returning 0xff bytes ~50% of boots) has been reported before by @StreakingJerry on discussion #3313 on an identical ESP32-S3 + E80 setup, also without resolution.

Reference

What I am NOT claiming in this report

  • I have not scoped the BUSY pin during boot on my hardware, so I cannot confirm or rule out BUSY timing as a factor.
  • I have not measured SPI signal integrity at the failing boot — this is an observation report, not a root-cause analysis.
  • The frequency of failure on ESP32-S3 vs ESP32 difference is empirical only.

@StreakingJerry

Copy link
Copy Markdown

Hi, I think for TCXO mode, SetMode(LR1121_MODE_STDBY_RC, radioNumber); in void LR1121Driver::Config(...) should also be changed to SetMode(LR1121_MODE_STDBY_RC, radioNumber);

What? Change the line to exactly the same thing?

Ha sorry typo. Change to SetMode(LR1121_MODE_STDBY_XOSC, radioNumber);

@pkendall64

pkendall64 commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Hi, I think for TCXO mode, SetMode(LR1121_MODE_STDBY_RC, radioNumber); in void LR1121Driver::Config(...) should also be changed to SetMode(LR1121_MODE_STDBY_RC, radioNumber);

What? Change the line to exactly the same thing?

Ha sorry typo. Change to SetMode(LR1121_MODE_STDBY_XOSC, radioNumber);

Nope, from the user manual rev 2.1, section 6.3.2

  • Delay represents the maximum duration for the 32MHz oscillator to start and stabilize (in 30.52us steps). If the 32MHz oscillator from
    the TCXO is not detected internally at the end the delay period, the device internal firmware triggers a HF_XOSC_START_ERR error.
    • 0: Disables TCXO mode (default value).
    • 1: Sets TCXO mode. A complete Reset of the chip is required to get back to normal XOSC operation.
      Command only operates in Standby RC mode, otherwise it returns CMD_FAIL on the next GetStatus() command.

But in the Config() function it doesn't really matter if it's RC or XOSC mode that is set. It's only while configuration is happening.

@pkendall64

Copy link
Copy Markdown
Collaborator Author

Issue report: ESP32-S3 + E80-900M2213S — observed on master after PR #3697 merged

Reposting this from discussion #3313 since PR #3697 also enables LR1121 TCXO config (radio_tcxo / radio_tcxo_delay) and the symptom reproduces on master with these JSON fields set.

This has nothing to do with the LR1121 TCXO config. The version number is read before the TCXO mode is set.
There is something else going on here and a new issue would be in order if this is reproducible.

@StreakingJerry

Copy link
Copy Markdown

Hi, I think for TCXO mode, SetMode(LR1121_MODE_STDBY_RC, radioNumber); in void LR1121Driver::Config(...) should also be changed to SetMode(LR1121_MODE_STDBY_RC, radioNumber);

What? Change the line to exactly the same thing?

Ha sorry typo. Change to SetMode(LR1121_MODE_STDBY_XOSC, radioNumber);

Nope, from the user manual rev 2.1, section 6.3.2

  • Delay represents the maximum duration for the 32MHz oscillator to start and stabilize (in 30.52us steps). If the 32MHz oscillator from
    the TCXO is not detected internally at the end the delay period, the device internal firmware triggers a HF_XOSC_START_ERR error.

    • 0: Disables TCXO mode (default value).
    • 1: Sets TCXO mode. A complete Reset of the chip is required to get back to normal XOSC operation.
      Command only operates in Standby RC mode, otherwise it returns CMD_FAIL on the next GetStatus() command.

But in the Config() function it doesn't really matter if it's RC or XOSC mode that is set. It's only while configuration is happening.

Yes I understand Config() do nothing about the TCXO configuration step. I mean in the dual-band RX/TX flow Config() is called on every hop (900 ↔ 2.4GHz), and switching from STBY_RC into the active radio config means one extra RC↔XOSC transition per hop. Going directly into STBY_XOSC skips that. SetTcxoMode is still only called once in Begin() under STBY_RC, so UM §6.3.2 is not violated. I am not sure if it is necessary to do this hop-frequency optimiazion.

@pkendall64

Copy link
Copy Markdown
Collaborator Author

Config is not called for every hop, it's only called when you change the packet rate.

@aiagent0619 aiagent0619 mentioned this pull request Aug 23, 2026
@aiagent0619

Copy link
Copy Markdown

You're right that CheckVersion itself doesn't read TCXO state — the version read happens before SetTcxoMode. My bad for framing it under the TCXO config heading.

Filed the issue properly now: #3744. The single new experiment that makes the symptom stop happening is externally powering VTCXO on the E80 module — same firmware, same JSON, same ESP32-S3, same E80 module, only the VTCXO power source changes. With external VTCXO power: 100% CheckVersion success. With LR1121's internal VTCXO regulator: ~50% failure on ESP32-S3, 0% on ESP32 (WROOM-32).

I have not scoped BUSY or SPI at the failing boot — observations only. I posted under TCXO because I was following the symptom from your recent TCXO change. New issue has the full details and what I have and haven't measured.

@StreakingJerry

Copy link
Copy Markdown

Config is not called for every hop, it's only called when you change the packet rate.

Ah you are right, seems not worth to change.

@StreakingJerry

Copy link
Copy Markdown

@pkendall64 Hi, I’m not sure if this should be posted here, but I occasionally get [5,3,0,80,0] (in hex) when calling checkVersion() with the hardware E80-900M2213S (LR1121).

I’ve tried adding delay(2500); after hal.reset(); and changing wtimeoutUS = 20000000U; in WaitOnBusy(), but that didn’t help.

I’ve ordered an E80-900M2212S (LR2021) module and will test it once I receive it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants