Skip to content

Conversation

@error414
Copy link
Contributor

@error414 error414 commented Oct 31, 2025

PR adds support for MSP2 inspired by implementation from betaflight. PR does not change manupulation with buffers and keep INAV style. In PR is fix for mspRequestOriginID originally made Pawel

  1. from MSP and MSP2 via CSFR has been removed MSP CRC, because CRSF contains itself CRC, so no need to duplicate
  2. CRSF MSP frame <receiver address 8b><sender address 8b><csfr flags 8b><length 8b><cmd 8b><payload ....>
  3. CRSF MSP2 frame
    <receiver address 8b><sender address 8b><csfr flags 8b><MSP flags 8b><cmd 16b LE><length 16b LE><payload ... >
  4. JUMBO frames are not supported
  5. simple test LUA files for MSP and MSP2 are attached, scripts has no any GUI, only send data over VSP from transmitter
    example:
RF2: Sending MSP cmd 1
RF2: TX (6 B)
RF2:   [1]:  0xC8
RF2:   [2]:  0xEA
RF2:   [3]:  0x30
RF2:   [4]:  0x0
RF2:   [5]:  0x1
RF2:   [6]:  0x1
RF2: -----
RF2: cmd:0x7B
RF2:   data length: 60
RF2:   [1]:  0xEA
RF2:   [2]:  0xC8
RF2:   [3]:  0x32
RF2:   [4]:  0x3
RF2:   [5]:  0x1
RF2:   [6]:  0x8
RF2:   [7]:  0x9
RF2:   [8]:  0x9

Tasks:

  • CRSF MSP1
  • CRSF MSP2
  • CRSF MSP1 >60B
  • CRSF MSP2 >60B
  • Smartport MSP1
  • Smartport MSP2
  • create unit test (optional)
  • apply fix , I don't know what the fix fixed and if it's needed (optional)


Testing:

CRSF (ready for test):

  • test MSP1 simple frame REQUEST
  • test MSP1 simple frame RESPONSE
  • test MSP1 frame <60B REQUEST
  • test MSP1 frame <60B RESPONSE
  • test MSP2 simple frame REQUEST
  • test MSP2 simple frame RESPONSE
  • test MSP2 frame <60B REQUEST
  • test MSP2 frame <60B RESPONSE

SmartPort:

  • test MSP1 simple frame REQUEST
  • test MSP1 simple frame RESPONSE
  • test MSP1 frame <60B REQUEST
  • test MSP1 frame <60B RESPONSE
  • test MSP2 simple frame REQUEST
  • test MSP2 simple frame RESPONSE
  • test MSP2 frame <60B REQUEST
  • test MSP2 frame <60B RESPONSE

MSP-test-lua.zip

@MrD-RC
Copy link
Member

MrD-RC commented Oct 31, 2025

Awesome work. Will SmartPort also get the MSPv2 treatment?

@error414
Copy link
Contributor Author

it should work, the changes for MSP2 are in msp_share file, so theoretically i don't see any reasson why it should not work.

rob.thomson is going to test it, he has smarport capable gear.

@MrD-RC
Copy link
Member

MrD-RC commented Oct 31, 2025

I did have a brief look. There may be some things that need changing in SmartPort regarding the packets. I believe there are examples of this in the BetaFlight or RotorFlight SmartPort.c file.

Awesome work though 👍🏻

@error414
Copy link
Contributor Author

do you mean change regarding to skip few request after EEPROM_WRITE command? I will look at that closely :)

* mspRequestOriginID fix
@MrD-RC
Copy link
Member

MrD-RC commented Nov 1, 2025

Don’t listen to me, I was misremembering 🤣 The changes in msp_shared should hopefully get it work over SmartPort.

@error414
Copy link
Contributor Author

error414 commented Nov 3, 2025

:D, it seems you were right, still some issues with smartport, I'm waiting to rob.thomson for more info. And moreover I will have frsky gear for better smartport testing.

However, CRSF works much better, I was able to fetch VERSION frame, PID frame, and save new values for PID frame. there were some insidious bugs :D

@MrD-RC
Copy link
Member

MrD-RC commented Nov 3, 2025

Awesome 🤘🏻 Rob mentioned that FrSky are sending you some hardware to get this working. Which is great news.

@error414
Copy link
Contributor Author

error414 commented Nov 3, 2025

current status is that CRSF is fully functional. I tested all scenarios from "Testing:" section. Rob.thomson confirmed that CRSF is OK,
So if anybody would like to test it as well, he is welcome :)

Smartport is still in progress, Maybe what about to create for smartport new pullrequest?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants