betaflight / betaflight

Open Source Flight Controller Firmware
GNU General Public License v3.0
8.41k stars 2.98k forks source link

MSP over CRSF - only 2 chunks are received for large MSP frames #13847

Open JimB40 opened 2 weeks ago

JimB40 commented 2 weeks ago

Describe the bug

When MSP frame with large payload is requested ie 48 (0x30) MSP_LED_STRIP_CONFIG (length 130) 52 (0x43) MSP_ADJUSTMENTS_RANGES (length 208) 52 (0x54) MSP_OSD_CONFIG (length 208) and few others (71, 116, 127, 164)

only two chunks (CRSF frames) are sent back. in total 112 bytes of payload Resulting in missing data.

Tested on BF 4.4.x and 4.5.x

To Reproduce

Check incoming frames in Betaflight Setup LUA selecting "OSD Elements" that uses MSP_OSD_CONFIG command

Expected behavior

all chunks should be sent back

Support ID

a1faa56f-ca73-4308-b7b7-36228f0d897d

Flight controller

STM32F411

Other components

No response

How are the different components wired up (including port information)

No response

Add any other context about the problem that you think might be relevant here

No response

haslinghuis commented 2 weeks ago
JimB40 commented 2 weeks ago

firmware issue IMHO. Used my MSP testing LUA and modified Betaflight Setup LUA to see on radio LCD what is the response from firmware.

There is still open #11928 about MSP_GPS_SV_INFO sending only 0 over CRSF until usb cable is connected and Betaflight Configurator opened. Looking at screenshot from tests I've done all 3 response chunks for MSP_GPS_SV_INFO (length 129) were sent back properly. It was tested on 4.3.x

JimB40 commented 2 weeks ago

Update about 4.5.1 At first I've seen only first chunk incoming, but by accident sent request again and next chunk came.

This is different behaviour from 4.3 and 4.4 where you send MSP request once and all chunks (CRSF frames for big MSP packet) are comming? Simply saying to get MSP frame that is divided across 3 CSRF frames I need to send MSP request 3 times.

So my qustion is is that a bug or feature?

haslinghuis commented 2 weeks ago

@klutvott123 ?

haslinghuis commented 1 week ago

@ledvinap ?

ledvinap commented 6 days ago

@JimB40 It's a bug, repeated requests are not working as intended. But I don't see any obvious cause of this, maybe it's something scheduler related.

Can you try bisecting the problem? can you try it with crsf_use_negotiated_baud = ON ?

klutvott123 commented 1 day ago

Is it ELRS? ELRS can't do an arbitrary number of frames. The limit is 2. crsf_use_negotiated baud won't do anything