msrc icon indicating copy to clipboard operation
msrc copied to clipboard

Add Support for XDfly ESC Telemetry

Open garfield2412 opened this issue 7 months ago • 10 comments

Hi Daniel,

Another great project to integrate the protocol in MSRC? I'll post some serial logs these days. These ESC seem to be more popular as time goes by (especially for Heli Pilots) Maybee they are similar to ZTW.

garfield2412 avatar May 09 '25 18:05 garfield2412

Waiting for the logs.

dgatf avatar May 09 '25 18:05 dgatf

Some specs:

 * XDFLY
 *
 *     - Serial protocol is 115200,8N1
 *     - Big-Endian byte order
 * 
 * Frame Format
 * ――――――――――――――――――――――――――――――――――――――――――――――――――――――――
 *      0:      start byte (0xA5)
 *      1:      length in bytes (8)
 *      2:      command 
 *          0x03 handshake
 *          0x34 set_par
 *          0x33 get_par
 *      3:      param number
 *      4-5:    param value
 *      6-7:      CRC16
 * 
 * 
 * checking whether the param is valid for the connected ESC:
 *      if the highest bit of the value is set, the parameter is valid for the connected ESC
 *          bool paramValid = paramValueRaw & 0x8000 != 0 //param shall not be displayed
 *      the actual data is in the lower 15 bits
 *          uint16_t paramValue =  paramValueRaw & 0x7FFF
 * 
 * for setting a param the high bit of the value is set to 1
 *     uint16_t paramValueRaw = paramValue | 0x8000
 * 
 * when setting a param and the ESC responds with 0xFFFF, setting the param was not successful
 */

Might be a bidirectional Info because you can set parameters via the protocol too.

Curious if I have to send 0x33 and then the parameter to get a reply, or if the ESC is sending continues.

garfield2412 avatar May 09 '25 18:05 garfield2412

That is not related to telemetry, but to program the esc...

dgatf avatar May 09 '25 18:05 dgatf

It seems that has some telemetry protocols to choose from. It has sbus2 and jeti which are known.

Can you test the esc with sbus2 or jeti receiver?

dgatf avatar May 09 '25 19:05 dgatf

I found it in rotorflight. I'll take a look.

dgatf avatar May 09 '25 19:05 dgatf

It seems that has some telemetry protocols to choose from. It has sbus2 and jeti which are known.

Can you test the esc with sbus2 or jeti receiver?

I have an ESC, but no SBus2 hardware or Jeti.

Only JR and FrSky

garfield2412 avatar May 09 '25 20:05 garfield2412

Maybe connecting the serial monitor to Tx, as with rotorflight, it sends telemetry without being polled. Just guessing because of its name, Tx.

dgatf avatar May 09 '25 21:05 dgatf

Were you able to read any serial output from the esc?

It seems that there is a handshake process.

dgatf avatar May 16 '25 09:05 dgatf

I'm sorry for the late reply - a bit bussy these day's . Will try to find some time this week for a serial log

garfield2412 avatar May 26 '25 20:05 garfield2412

I've created xdfly branch for development on this esc.

Select Receiver protocol -> Smartport, ESC Protocol -> XDFLY and connect ESC telemetry line to GPIO5 and GND to RP2040 GND. Post the log. Based on rotorfligh code, it sends a handshake: 0xA5 0x8 0x3 0x0 0x0 0x0 CRC. Then waits for telemetry.

Please use those links to download binaries:

File to flash to RP2040: MSRC-RP2040_xdfly.uf2

PC application for configuration:

dgatf avatar Jun 26 '25 14:06 dgatf