SoftRF icon indicating copy to clipboard operation
SoftRF copied to clipboard

No packets between Nano / ESP32-C3 / RM-XR1 and ardupilot v4.x

Open mf0o opened this issue 1 year ago • 14 comments

Dear Linar.

I struggle to get SoftRF v1.7.1 running on a Radiomaster XR1 with MavLink on Ardupilot. The final goal is to evaluate if we can add SoftRF-Nano to our opensource Paragliding Vario (epvario.github.io) to make the pilot visible in OGN, but thats for later and just an info at this stage.

  • Flashing v1.7.1 to the receiver without problems
  • WebUI is reliably online and available
  • The current used hardware is a Matek H743-Wing2 Flightcontroller running Ardupilot v4.6.3 (and a second one running v4.1.1).
  • Ive tried to connect the XR1 to multiple UARTS (UART1 with telemetry support, 2 and 7) and each time rebooted the flightcontroller or powercycled the hole system.
  • Both planes are fully set up, working as expected, having a solid SAT lock
  • RX/TX are connected to TX/RX as usual
  • I followed the wiki and the ardupilot documentation and setup the UART to MAVLink with baudrate 57
    • SERIAL2_PROTOCOL=1
    • SERIAL2_BAUD=57
    • also tried MAVLink v2 (SERIAL_PROTOCOL=2) without success, each with a FC reboot in between
  • different SoftRF Modes (normal/UAV) have no effect
  • Should the "Radio" beeing discovered as "LR1121" at this stage?

Hardware

  • [ ] Standalone
  • [ ] Badge
  • [ ] Prime Mark III
  • [ ] Prime Mark II
  • [ ] Dongle
  • [ ] SkyView EZ
  • [ ] SkyView Pico
  • [ ] Uni
  • [ ] Ham
  • [ ] Card
  • [ ] Handheld
  • [X] Nano
  • [ ] Cozy
  • [ ] Midi
  • [ ] Mini
  • [ ] Academy
  • [ ] Lego
  • [ ] ES Edition
  • [ ] Balkan
  • [ ] Raspberry Edition
  • [ ] UAV
  • [ ] WebTop Serial
  • [ ] WebTop USB
  • [ ] UAT978 module
  • [ ] Flight Recorder
Image Image Image

Firmware version

Image

Firmware settings

Image

Describe the bug

  • No communication between ardupilot and SoftRF Nano possible.
  • GNSS remains "NONE"
  • Packets Tx 0, Rx 0
  • Radio: "NONE"
  • Battery voltage shows ~0.80ish although powered by 5V

To Reproduce

  • Flash v1.7.1 (MD5 (SoftRF.ino.bin) = 809630f6ebb26f184e657cbda3cf611b)
  • connect SoftRF Nano with Ardupilot (v4.x) UART and configure Mavlink v1/v2

Expected behavior

  • Packetcounter increases, GNSS information beeing updated
  • "Radio" is not discovered?

Thank you a lot for the project and assistance in advance!

mf0o avatar Dec 01 '25 08:12 mf0o

I connected the XR1 to a USB2Serial and receiving this output:

Copyright (C) 2015-2025 Linar Yusupov. All rights reserved.

Reset reason: 0
POWERON_RESET
Free heap size: 214424
Vbat power on reset

EEPROM version: 97
WARNING! None of supported RFICs is detected!
WARNING! Barometric pressure sensor is NOT detected.
INFO: ESP32-C3 DevKit is detected.
Flash memory ID: 464016
Hostname: SoftRF-6d4cb8
Setting soft-AP configuration ... Ready
Setting soft-AP ... Ready
IP address: 192.168.1.1
HTTP server has started at port: 80
E (13424) ledc: freq_hz=0 duty_resolution=8

Data output device(s):
NMEA   - UART
GDL90  - NULL
D1090  - NULL

$PFLAU,0,0,0,1,0,,0,,,*4F
....

Flashing back to ELRS firmware worked and the receiver can be bound to the RC radio at 2.4Ghz.

Some high detail pictures of the device: Image

Image

Did I reach the point you wrote in the Disclaimer at this point?

mf0o avatar Dec 01 '25 10:12 mf0o

Image

Your XR1 hardware is mis-detected as an ESP32-C3 DevKit.


Image

lyusupov avatar Dec 01 '25 10:12 lyusupov

An ESP32-C3 in this particular XR1 uses unknown flash memory JEDEC vendor ID ( 0x46 ).

An ESP32-C3 SoC based SoftRF device with the embedded flash ID 0x464016 is now assigned to Nano Edition as of https://github.com/lyusupov/SoftRF/commit/c5cf46e63a94749e7e34931e4550ef47af54a3a9


Resolution: fixed in https://github.com/lyusupov/SoftRF/commit/c5cf46e63a94749e7e34931e4550ef47af54a3a9

lyusupov avatar Dec 01 '25 11:12 lyusupov

Thank you for the quick reply, investigation and fix.

I've compiled that locally via the Arduino IDE, and while commit 1.7.1 https://github.com/lyusupov/SoftRF/commit/d397e5c1311188e39d1ca637120d52d43310ff47 is working as described above, the fix applied onto v1.7.1, (or even latest master https://github.com/lyusupov/SoftRF/commit/c5cf46e63a94749e7e34931e4550ef47af54a3a9) does stuck on the boot process like so:

SoftRF-ESP32-C3 FW.REV: 1.7.1 DEV.ID: f16d4cb8
Copyright (C) 2015-2025 Linar Yusupov. All rights reserved.

Reset reason: 0
POWERON_RESET
Free heap size: 219388
Vbat power on reset

WARNING! User defined settings are not initialized yet. Loading defaults...
WARNING! None of supported RFICs is detected!
W�

Any further ideas what I could try or read from the XR1 to troubleshoot this?

mf0o avatar Dec 02 '25 08:12 mf0o

Ah, maybe thats valuable insight:

Image

Those are my IDE settings, followed the source-build README as close as possible. PSRAM settings are not available for the C3 and I had to change "partition Scheme" to overcome an compiler error: "Compilation error: text section exceeds available space in board"

Those settings seems to work generally as unmodified v1.7.1 can be compiled and uploaded, resulting in C3 DevKit beeing detected again:

SoftRF-ESP32-C3 FW.REV: 1.7.1 DEV.ID: f16d4cb8
Copyright (C) 2015-2025 Linar Yusupov. All rights reserved.

Reset reason: 0
NO_MEAN
Free heap size: 214424
No reset information available

WARNING! User defined settings are not initialized yet. Loading defaults...
WARNING! None of supported RFICs is detected!
WARNING! Barometric pressure sensor is NOT detected.
INFO: ESP32-C3 DevKit is detected.
Flash memory ID: 464016
Hostname: SoftRF-6d4cb8
Setting soft-AP configuration ... Ready
Setting soft-AP ... Ready
IP address: 192.168.1.1
HTTP server has started at port: 80
E (13174) ledc: freq_hz=0 duty_resolution=8

Data output device(s):
NMEA   - UART
GDL90  - NULL
D1090  - NULL

$PFLAU,0,0,0,1,0,,0,,,*4F

I also tried to have the switch returning ESP32_RADIOMASTER_XR1 by default for testing, which lead to "WARNING! None of supported RFICs is detected!" and a stuck console output.

mf0o avatar Dec 02 '25 08:12 mf0o

... the fix applied onto v1.7.1, (or even latest master https://github.com/lyusupov/SoftRF/commit/c5cf46e63a94749e7e34931e4550ef47af54a3a9) does stuck on the boot process ...

Current master works fine to me on my Nano Edition ( RadioMaster XR1 , AP is not connected )

P.S. the 1.7.1+ (master) firmware binary is attached for a one who is able to try it out.

SoftRF-1.7.1plus-ESP32C3.zip


Image Image

Image

lyusupov avatar Dec 02 '25 12:12 lyusupov

Thank you Linar!

Unfortunately it doesnt work yet, here is my progress:

  1. I've flashed the hole unit as described on your README by using the esptool with the binaries of 1.7.1 :
esptool.py \
  --chip esp32c3 \
  --port /dev/tty.usbserial-1120 \
  --baud 115200 \
  write-flash \
  --flash-mode dio \
  --flash-freq 40m \
  --flash-size detect \
  0x0000 SoftRF.ino.bootloader.bin \
  0x8000 SoftRF.ino.partitions.bin \
  0xE000 boot_app0.bin \
  0x10000 SoftRF.ino.bin

esptool v5.1.0
Connected to ESP32-C3 on /dev/tty.usbserial-1120:
Chip type:          ESP32-C3 (QFN32) (revision v0.4)
Features:           Wi-Fi, BT 5 (LE), Single Core, 160MHz, Embedded Flash 4MB (XMC)
Crystal frequency:  40MHz
MAC:                20:6e:f1:6d:4c:b8

Stub flasher running.

Configuring flash size...
Auto-detected flash size: 4MB
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x001c9fff...
Flash parameters set to 0x0220.
.....
  1. Then Ive uploaded the 1.7.1+ via the WebUI.

  2. The RF Module will still not be detected and Serial@38400 shows:

SoftRF-ESP32-C3 FW.REV: 1.7.1+ DEV.ID: f16d4cb8
Copyright (C) 2015-2025 Linar Yusupov. All rights reserved.

Reset reason: 0
POWERON_RESET
Free heap size: 214424
Vbat power on reset

EEPROM version: 97
WARNING! None of supported RFICs is detected!
  1. On Serial@57 I see the MAVlink initialized:
INFO: RadioMaster XR1 is detected.
Flash memory ID: 464016

Data output device(s):
MAV V1 - UART

Ive added some debug prints and found out:

       412      lr11xx_GetVersion(&hw, &device, &major, &minor);
       413 +    Serial.print(F("DEBUG: device=0x")); Serial.print(device, HEX);
       414 +    Serial.print(F(" hw=0x")); Serial.print(hw, HEX);
       415 +    Serial.print(F(" fw=")); Serial.print(major); Serial.print(F(".")); Serial.println(minor);

giving me:

DEBUG: Before RF_setup
DEBUG: LR1121 probe start
DEBUG: SPI begun
DEBUG: lmic_hal_init done
DEBUG: Reset asserted
DEBUG: device_reset=0x0
DEBUG: Waited 300ms after reset
DEBUG: device=0xF3 hw=0x22 fw=1.4
DEBUG: SPI ended
DEBUG: LR1121 probe failed - device ID mismatch
WARNING! None of supported RFICs is detected!

No idea why my device ID is 0xF3 but the code expects LR1121: 0x03 if I'm reading it correctly. As I can read hw=0x22, fw=1.4 from the SPI, it seem to work at least.

I'm trying to make the code accept this, like:

        -    if (device == RADIOLIB_LR11X0_DEVICE_LR1121) {
        +    if (device == RADIOLIB_LR11X0_DEVICE_LR1121 || device == 0xF3) {

But I havnt had any luck until now. It will detect the RF module then, but stucks after that and fails to bring up the UART for Mavlink.

mf0o avatar Dec 02 '25 17:12 mf0o

ELRS firmware could flash internal memory of LR1121 with this https://github.com/Lora-net/radio_firmware_images/tree/master/lr1121/transceiver_drone

I suppose that you need to find a way to use ELRS somehow to rollback the LR1121 internal memory onto any previous regular version ( not a "drone" one ). https://github.com/Lora-net/radio_firmware_images/tree/master/lr1121/transceiver

lyusupov avatar Dec 02 '25 18:12 lyusupov

Thanks for the idea. I read about a lot of changes regarding the LR1121 in the ELRS release notes. I proceed downgrading to 3.5.3 and flash the semtec by using ELRS http://10.0.0.1/lr1121.html.

Will keep you posted!

mf0o avatar Dec 02 '25 19:12 mf0o

Linar, the LR1121 firmware was causing it. I will put all information and files together later. After downgrading the RF Module it has hw=0x30 again and gets detected by 1.7.1+ (will try 1.7.1 later) and also the GNSS will be detected as MAV once connected to a flightcontroller. I couldnt receive any packets yet, need to check my GPS setup next.

If you prefer I can submit a PR for the documentation with the downgrade instructions.

mf0o avatar Dec 03 '25 10:12 mf0o

If you prefer I can submit a PR for the documentation with the downgrade instructions.

Read this https://github.com/lyusupov/SoftRF/wiki/Nano-Edition#quick-start

lyusupov avatar Dec 03 '25 10:12 lyusupov

Yeah, Im aware and that was my primary source of information so far.

If you want, I can make a doc-PR to that page, adding explanations and files how to downgrade the LR1121. Like, the essence of this discussions and my learnings.

mf0o avatar Dec 03 '25 13:12 mf0o

You can create your own repo on GitHub with your success story. This is an example of such a repo: https://github.com/ivonovak/SoftRF-Naviter-Oudie/wiki

I may ( or may not ) consider to add a reference on your repo into "Links" section of the Nano Edition wiki.

Other option is you can just post your success story in the ArduPilot.org forum thread

lyusupov avatar Dec 03 '25 14:12 lyusupov

Aaaahhh... I missed that you have already updated your wiki when sending me the link, with the details of LR1121 firmware .

That was exactly what I wanted to deliver, sorry for the misunderstanding here. Here is my stake on that, but its deprecated now anyway: https://github.com/mf0o/SoftRF/wiki/Nano-Edition/5078e91228431d624e40a45ea4c1b49be4975c7d

My SoftRF Nano is now fully working and I can see the XR1 with a drone indicator on my Skytraxx Vario! Thank you for your support!

mf0o avatar Dec 04 '25 11:12 mf0o