betaflight / betaflight

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

Dashboard build option impedes Betaflight initialization and creates I2C errors. #13590

Open B1naryShad0w opened 3 weeks ago

B1naryShad0w commented 3 weeks ago

Describe the bug

When adding "Dashboard" as a build option to Betaflight, certain I2C conditions make the firmware take an entire 30 seconds to initialize. This issue is specific to Betaflight 4.5 RC4, and does not exist in 4.4.3. I have not tested other 4.5 release candidates. My testing is based around the I2C errors readout in the configurator, as it seems to have some correlation with respect to the I2C errors from my baseline testing in 4.4.3.

My hardware:

Other considerations:

Notes:

Some test cases have errors incrementing by 1 every 5 seconds. This is noted.

Some test cases involve Betaflight not initializing for 30 seconds. This is determined by the blue status LED not flashing and being unable to connect through the configurator although the COM port is visible and detected immediately after plugging in. After 30 seconds the LED starts flashing and I am able to connect. If the BN-880 is powered via XT60 after the flight controller is plugged into USB but before the 30 seconds while in this state, Betaflight still takes the full 30 seconds to initialize from initial power-on via the USB.

4.4.3 with both Core+Magnetometer and Core+Magnetometer+Dashboard: Disconnected: 7 errors (0 if magnetometer is disabled in configuration.) Connected Unpowered: 8 errors (1 if magnetometer is disabled.) Connected Powered: 0 errors

4.5RC4 with Core only: Disconnected: 0 errors Connected Unpowered: 1 error Connected Powered: 0 errors

4.5RC4 with Core+Magnetometer: Disconnected: 9 errors Connected Unpowered: 10 error Connected Powered: 0 errors

Here is where behavior is abnormal:

4.5RC4 with Core+Dashboard: Disconnected: 1027 errors with increment Connected Unpowered: Long initialization and 1028 errors with increment Connected Powered: 1028 errors with increment

4.5RC4 with Core+Dashboard+Magnetometer: Disconnected: 1036 errors with increment Connected Unpowered: Long initialization and 1037 errors with increment Connected Powered: 1027 errors with increment

I would love to help get to the bottom of this so if you need me to test some updated firmware, install some verbose firmware for more detailed errors, or if you guys need any more information please let me know.

Support ID

53e97ffa-3ebc-458a-a27e-d90329481095
ot0tot commented 2 weeks ago

Why are you including the DASHBOARD define?

@haslinghuis Should we just remove all #define DASHBOARD_I2C_INSTANCE lines from configs since this feature is almost never used?

ledvinap commented 2 weeks ago

Just take approach suggested by @hydra and don't enable features just because they are compiled in.

Also, dashboard should throttle reinitialization attempts

B1naryShad0w commented 2 weeks ago

Why are you including the DASHBOARD define?

@haslinghuis Should we just remove all #define DASHBOARD_I2C_INSTANCE lines from configs since this feature is almost never used?

I saw in the documentation that it "enables the post-flight overview screen," which led me to assume it refers to the post flight statistics found in the OSD tab. I see that I was mistaken and that the post flight statistics doesn't seem to be related to the DASHBOARD build option.

I am curious as to what this define does exactly and when it should be used as I've always had it enabled under the wrong assumption before 4.5, but don't notice any missing features without it.

haslinghuis commented 2 weeks ago

It's for an external [O]LED display. See https://betaflight.com/docs/development/display

ctzsnooze commented 2 weeks ago

Updated the user documentation in PR 418