Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FLRC F-modes to ELRS SPI implementation #12936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CapnBry
Copy link
Contributor

@CapnBry CapnBry commented Jul 2, 2023

Some racer using a pancake was sad his Betaflight didn't do F1000 so I added it, along with the other ExpressLRS F-modes. Note that it turns out the F411 doesn't have enough CPU power to do F1000+4K PID loop, at the very least have a slow updating OSD. For 1000Hz, a 120MHz overclock or 2K PID loop seems to be a necessity. Still, I believe this to be a good addition and if someone makes an SPI ELRS Betaflight FC that doesn't use a terribly overburdened MCU (F722?), it should work even better.

Note that I wrote this 3 months ago and haven't touched it since so I am a little foggy on the details. I have shared this back then with @phobos- who wrote the rest of the implementation and have heard 0 complaints 😋 as long as we go by the rule that "no news is good news" and not that no news means nobody has looked at it. So have a look at it!

This PR also removes unused CLI options to set expresslrs_rate_index and expresslrs_switch_mode.

  • Switch mode: the user can't change this because the TX SYNC packet forces a switch mode on the RX. This never did anything.
  • Rate index: the user can set this but always rate cycles on boot to find the TX anyway. When it establishes a connection, it will store this rate index for quicker connection next boot. This is all automatic, so there's no need for the user to set this or modify it, as the automatic process always overwrites it. This keeps the same behavior but removes the knob the user expected to have to set.

I did not implement the ELRS D-modes, which would still be needed to bring the code up to full ExpressLRS 3.x OTA.

@github-actions
Copy link

github-actions bot commented Jul 2, 2023

Do you want to test this code? You can flash it directly from Betaflight Configurator:

  • Simply put #12936 (this pull request number) in the Select commit field of the Configurator firmware flasher tab (you need to Enable expert mode, Show release candidates and Development).

WARNING: It may be unstable. Use only for testing!

@CapnBry CapnBry changed the title Add FLRC F-modes to ELRS implementation Add FLRC F-modes to ELRS SPI implementation Jul 2, 2023
@blckmn
Copy link
Member

blckmn commented Jul 2, 2023

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> FAIL
  • approver count at least three -> FAIL

@haslinghuis
Copy link
Member

Note that it turns out the F411 doesn't have enough CPU power to do F1000 for very long and tends to failsafe (if running with bidirectional DSHOT and everything you'd expect), or at the very least have a really slow updating OSD. Still, I believe this to be a good addition since F500 works and if someone makes an SPI ELRS Betaflight FC that doesn't use a terribly overburdened MCU (F722?), it should work just fine.

This is good reason to reject this feature request.

@CapnBry
Copy link
Contributor Author

CapnBry commented Jul 3, 2023

This is good reason to reject this feature request.

I had to refresh my memory on this because it has been a while since I worked with it and usually don't run F1000 myself. Running this code against master:

PID Loop Rate Overclock Result
2K 108M OK
4K 108M Laggy OSD, but 0 failsafes in 3 packs
2K 120M OK
4K 120M OK

I must have been misremembering, or possibly there was some interaction with the version master from back in April, but it seems to be ok now, but I'd say it requires 2K PID loop or a 120MHz overclock to do 1000Hz. 500Hz always appears fine (and the current master does 500Hz LoRa as well so that's not changed).

I've updated my original post.

Copy link
Member

@haslinghuis haslinghuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marked some (not all) coding style issues

src/main/drivers/rx/rx_sx1280.c Outdated Show resolved Hide resolved
src/main/drivers/rx/rx_sx1280.c Outdated Show resolved Hide resolved
src/main/drivers/rx/rx_sx1280.h Outdated Show resolved Hide resolved
@CapnBry
Copy link
Contributor Author

CapnBry commented Jul 4, 2023

Ah yes, sorry about that. I believe I have fixed all the indention and opening bracket style issues now.

EDIT: I tend to shy away from using force pushes normally, but as an "I'm a dumb developer" question is there another way to keep this one commit but not using commit amend + push force?

haslinghuis
haslinghuis previously approved these changes Jul 4, 2023
Copy link
Member

@haslinghuis haslinghuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

git commit -a --amend --no-edit
git push origin +branch

Using same here 😛

@howels
Copy link
Contributor

howels commented Jul 6, 2023

Note that it turns out the F411 doesn't have enough CPU power to do F1000 for very long and tends to failsafe (if running with bidirectional DSHOT and everything you'd expect), or at the very least have a really slow updating OSD. Still, I believe this to be a good addition since F500 works and if someone makes an SPI ELRS Betaflight FC that doesn't use a terribly overburdened MCU (F722?), it should work just fine.

This is good reason to reject this feature request.

Surely it can be documented?

@sugaarK
Copy link
Member

sugaarK commented Jul 27, 2023

and if someone makes an SPI ELRS Betaflight FC that doesn't use a terribly overburdened MCU (F722?), it should work even better.

very unlikely as we recommend serial based ELRS to the manufacturers, with the at32 chips as well the lack of uarts is addresses vs the f411

@ctzsnooze
Copy link
Member

Personally, not in favour of this.

1000Hz has marginal benefit because the resolution of feedforward is so poor at 1000Hz that the filtering delay means overall feedforward benefit is zero, and the improvement in P lag is not going to make any definite improvement to the flight control experience.

If adding this made no hit to CPU that's OK, but if it does, that's bad.

We would need to see a log of the scheduler time required for the ELRS tasks to figure out if this can get up.

@sugaarK
Copy link
Member

sugaarK commented Aug 16, 2023

If elrs was to go to 11 or 12 bit on the other hand….

@CapnBry
Copy link
Contributor Author

CapnBry commented Aug 17, 2023

1000Hz has marginal benefit because the resolution of feedforward is so poor at 1000Hz

That's not really on the table here, SPI implementation or not, people are running Betaflight on 1000Hz ExpressLRS. I do agree with your expertise in the matter, but rejecting this strictly on the basis of it being 1000Hz implies that Betaflight should also prevent an external 1000Hz packet rate as input too, does it not? 😁

Of course it takes more CPU time to receive twice as many packets as 500Hz, you don't need any scheduler logs to know that. Every feature takes CPU time but isn't excluded strictly on that metric though. This is on the user to decide what they like, as the MCU is capable of doing it. Does it take too much CPU time? The performance of the quad I tested with seemed unaffected, even with bidirectional d-shot and all the normal filters on (including dynamic gyro / dterm / notch).

Note that this PR also includes F500, which is extremely low-latency compared to LoRa 500Hz and is beneficial on its own. The average theoretical latency of F500 is just 1.439ms from gimbal to SPI pulling the packet into Betaflight, compared to 2.557ms for LoRa 500Hz. I don't think you can argue against a 43% decrease in average latency for the same CPU time, even if both these values may very well be below any sort of measurable impact on pilot performance.

If elrs was to go to 11 or 12 bit on the other hand….

ELRS OTA 4 will change all FLRC to 12bit resolution, but that change alone will just be a few lines of this code being updated for the new packet format so it would be nice if we already had a know working stable FLRC implementation to build on rather than both adding FLRC and making packet format changes to support OTA 4.

Disclaimer

I am not being an ExpressLRS zealot demanding this be included into Betaflight, but am simply supplying the code in response to requests I have gotten from pilots to include these modes. I've also been anti-SPI right from the start, but its use is somewhat inescapable in some use cases and extremely convenient in others.

I don't know if 1000Hz makes people better pilots, but that's not what is on the table here-- Betaflight already does not prevent 1000Hz RC input. Running 1000Hz SPI also does take more CPU time, but spare CPU cycles do nothing. A typical F1000 user would probably not be using other features like GPS, or a ton of OSD elements, so that synergy reduces the CPU time argument even further.

@nerdCopter
Copy link
Member

nerdCopter commented Aug 17, 2023

i personally do not mind the option to exist, but maybe with disclaimer somewhere (should it be in configurator? 🤷‍♂️ -- such would need to alert to both CPU and FeedForward problems)

two things come to mind as already presented

  • stronger CPU's in the future
  • already recommending against SPI

@sugaarK
Copy link
Member

sugaarK commented Nov 26, 2023

any movement on this?

@haslinghuis haslinghuis removed this from the 4.5 milestone Dec 3, 2023
@sugaarK
Copy link
Member

sugaarK commented Dec 4, 2023

Happy model are hell bent on continuing to use spi elrs as well. They really need to stop using the f411 on every thing 🤦‍♂️

@CapnBry
Copy link
Contributor Author

CapnBry commented Dec 5, 2023

If this PR includes measurable efficiencies in the code, by timing how long parts of it take.

Oh I don't think that's going to happen. I don't even know how to profile these devices or have the software tools to do it effectively. Although actually (pushes glasses up) the FLRC implementation here is more SPI optimized than the LoRa version because there is hardware CRC for FLRC, and therefore bad packets are dropped early in the chain resulting in less SPI traffic than bad LoRa packets. Measurable efficiency! I kid though, that's just basic decent coding.

😅I refuse to turn this FLRC PR into a debate about 1000Hz Ideology and Usefulness!

@ctzsnooze
Copy link
Member

My views on 1000Hz are well known. When ELRS goes 12 bit, rather than the current 10 bit, and the incoming signal from the gimbal sensor clean enough, and the input resolution of the radio AD converter is good enough, and the data path in the radio is jitter free, that's when 1000Hz will be more useful than it is now.

Once we get 4.5 RC1 out, if I get some ELRS SPI boards, then I can look closely at optimising feedforward and providing sensible values in our Presets.

So for sure, let's set debate about 1000Hz aside.

The general topic of SPI Rx is a difficult one. The FrSky SPI Rx implementation was very prone to random link failure and I don't think anyone knew why. This gave SPI Rx a bad reputation, generally.

Well maintained, efficient SPI Rx code that works reliably is something that I would continue to support actively. It's latency is considerably less than serial. And on F411's it frees up a serial port, and that is helpful to some people.

So let's be clear, I have no objection to SPI Rx code for ELRS, so long as it is as efficient as possible, well-maintained, works reliably, and that its reliability is validated as carefully as possible by the people maintaining the code.

@ctzsnooze
Copy link
Member

ctzsnooze commented Dec 5, 2023

I don't even know how to profile these devices or have the software tools to do it effectively.
@CapnBry -

Suitable tools exist within Betaflight already, so you have all the tools you need.

The basic things to check are flash space requirements and the tasks command in CLI:

  • is extra flash space is required; if so, how much
  • what happens to the 'tasks' menu; does this code's task take significantly longer, do other tasks over-run when the code in question is active.

Using the tasks menu requires invoking the command at say 10 or 15s intervals, repeatedly, to get a 'feel' for the typical numbers. Then flash the new code, and see if those numbers change significantly. If the new code reduces task time, and delays other tasks less often, that's really good; if it takes longer and causes other tasks to over-run, that's bad.

More advanced testing involves checking execution time

Code that runs only occasionally (eg only when new data arrives) has a 'resting' impact while it is 'idle', and an 'active' impact in the CPU cycle in which it is triggered. Some aspects of Rx code are, I think, spread over several cycles to 'smear' the cost per cycle over several cycles. I don't know if that is the case for the SPI code.

For SPI Rx code, it would be good to know the CPU cost every CPU cycle; that way we know what it costs when it is 'idle' and that it costs when 'active'.

Once we know that, we can make rational recommendations on loop time so that there are enough CPU cycles that these processes can run without messing with other bits of code.

If the 'active' task is very, very high on CPU, then it could be split over two cycles.

Without seeing data on CPU time cost, we won't know what's going on.

To find out, we can set timers and log the time taken for parts of the code to execute. Check the MAG_TASK_RATE debug in the code. We initialise a value to current time at some point, and get the number of microseconds it takes to get to some other point. That tells us how much CPU time is required to execute that part of the code.

We can also log the delta time between absolute start time of each iteration of the code, in microseconds, to check that the code executes at the expected time intervals, which may detect impending failure or significant over-run issues.

Doing this is time consuming, but not difficult. Just use an existing debug with spare space, if you like.

There is a debug DEBUG_RC_STATS which is almost empty. It could be used, even if only temporarily, for testing purposes, to learn about the timing and CPU cost of the SPI code.

When logging for these purposes, you'd put transient times into a static value so that even if logging at 1:2 you'll see that value from its last iteration. Disabling nearly all other elements in the log may permit logging at 1:1, and this is possible on many boards, and 1:2 is certainly achievable on F411's. That's enough to get a good reflection of the 'idle' period CPU cost.

You can see examples of timing tests done this way in the Mag Pr

True, it does take a bit of time to set up, but once set up, it is very easy to evaluate whether a particular part of the code runs more efficiently when coded differently, and to learn about the overall CPU cost of the code.

The main concern with SPI code has been its impact on the CPU and the possibility that if the CPU gets excessively loaded, the link may fail. At present we are in a bit of a vacuum with no information to run with at all.

If we continue to support SPI Rx then:

  • we need a debug that examines the CPU cost accurately. DEBUG_RC_STATS would be fine. It could be used to investigate other Rx code as well.
  • the code maintainers need to investigate the CPU cost and timing accuracy of the code, especially when it is updated, and should liaise with Steve for advice on how to optimise scheduling if the CPU cost is truly an issue.

@nerdCopter

This comment was marked as outdated.

@Justicefpv
Copy link

As a dedicated Tiny Whoop pilot, I feel obligated to contribute to this discussion. In my experience and observing trends at our local flying club, SPI-only boards are extensively used and will likely continue to be a mainstay in our community for some time. Unfortunately, these are not going away anytime soon. I would welcome the addition of the F500 mode this PR brings and look forward to the addition of 12-bit resolution.

@nerdCopter

This comment was marked as outdated.

@haslinghuis haslinghuis modified the milestones: 4.6, 4.5 Dec 6, 2023
@haslinghuis
Copy link
Member

haslinghuis commented Dec 6, 2023

Sorry put this on 4.6 to soon. Discussion ongoing. Please correct [me] if wrong as I do not intent to give false impressions.

@nerdCopter

This comment was marked as outdated.

@nerdCopter

This comment was marked as outdated.

@CapnBry
Copy link
Contributor Author

CapnBry commented Dec 7, 2023

Oh I am such a good developer I typed a whole pile of text, verified the markdown looked good in Preview, did not hit the post button 😣

Shorter summary: Thank you, ctzsnooze for your detailed explanation of the facilities available for profiling. I will likely revisit that message if I need to gather information.

I did not extensively profile the code or attempt to make the PR bigger by refactoring / optimizing any of the ELRS SPI code. I also did not add FLRC D-modes as they require changes to the processing and would be a larger changeset. The only change this adds is in the one-time initialization of setting up the RF chip, to put it in FLRC vs LoRa mode. I then did A/B tests with master with the PR applied or without to check for any regressions. At 500Hz LoRa vs 500Hz FLRC the tasks showed similar CPU usage, and 1000Hz doubled that so everything checked out.

The core ELRS SPI code is all the same, so the performance of one vs the other should be identical (at the same rate) except for the early bailout if the FLRC has a hardware CRC check failure. I've been flying F500 since May on my whoop (8k/2k) using this code and seen no issues.

Moving forward

It would be great if there was someone who was motivated to become the full time maintainer of this code, kept it up to date and would have good time optimizing it for size and speed. I, on the other hand, announced a year and a half ago that nobody should buy ELRS SPI because nobody on our team planned to support it. I assisted with the ELRS 3.0 update because it made me sad and embarrassed to think of pilots having to fly ELRS 2.4 forever 😅 This change was just (someone) "Can you make SPI do FLRC? 1000Hz?" me: "I dunno, sure, it is just changing some parameters". A couple days later I banged it out in a few hours.

I greatly appreciate the time you and the rest of the team puts into creating and maintaining betaflight, and love how every year my quads just fly better. I only intended to make a small incremental improvement in the ELRS compatibility and not take on any sort of ongoing role. I would have much rather the ELRS SPI implementation never existed due to the user confusion, version compatibility and feature set issues, and workload it creates for both your and our team.

@sugaarK
Copy link
Member

sugaarK commented Dec 7, 2023

It’s a little bit of sore point that the spi implementation on our side pushed our rc phase on 4.3 to 3-4 months and then elrs dropped support. It was a massive amount of work for something that was DOA. Happy model are also hell bent on continuing to use it and make new hardware with it also as a side note. Maybe they assist with with maintenance of it?

@ctzsnooze
Copy link
Member

@CapnBry I think we are both on the same wavelength, and I carry no sour grapes. ELRS has been massive for me and I'm a very strong supporter.

I personally want to keep SPI ELRS as long as possible, and I do appreciate that there are a LOT of ELRS SPI users out there.

One of the great virtues of the cloud build system, for users, is that the can include a defined code block when they flash the quad. And they can do this with release firmware.

From the developer perspective, it's possible to compartmentalise the code. This helps us know who is responsible for maintaining it, and we can protect the rest of the code from defined code that isn't included by default.

So it becomes a win-win situation.

If, for example, all ERLS SPI code was put inside #ifdef ELRS_SPI ... #endif // ERLS_SPI blocks, then a normal user will not get any SPI related overhead. You can then maintain the ELRS_SPI code blocks and it won't mess with our normal users. And any user who flies SPI ELRS can flash it and it should work.

If this PR only improves ELRS 3.x support for ELRS_SPI users, then this approach is the way to go.

If a user flashes it, and has problems, they can get back to you on this PR.

It's even possible to use ifdef to handle 3.x vs 4.x support by putting all the existing code into #ifdef ELRS_SPI_3 tags, and then a user can flash ELRS SPI 3.x support. Then when 4.x comes, if you want to support that, you can use an #ifdef ELRS_SPI_4 tag for the code it needs, then users can flash whichever they want.

Now I appreciate that this is a fair bit of work, but it is, I think, the right way forward. It works for me, and it should work for you and for the users.

As to the timing of it, there is no explicit urgency if we go down this path.

If we do not include this PR in 4.5, ELRS 3.x users get a 'known good' SPI solution in 4.5. I don't want to break that by merging this and discovering bugs in it. I'm sure you also accept that this conservative thinking has some merit.

Its not clear how long to 4.6, but probably not as long as 4.5.

So you could put the SPI code into #ifdef ELRS_SPI_3 tags and we can test this in 4.6zulu, your users can add the PR into 4.6zulu, and we will be able to merge it into 4.6 zulu with confidence.

Additionally, if ELRS 4.x comes out, you can do the same there, if supporting ELRS 4.x over SPI is what you end up wanting to do.

I'm hoping this sounds reasonable.

@ctzsnooze ctzsnooze modified the milestones: 4.5, 4.6 Dec 8, 2023
@Justicefpv
Copy link

Justicefpv commented Dec 8, 2023

I've had no success getting the FLRC modes to work properly with this PR. When I attach a battery to my whoop, the F500 mode stops communicating shortly after. Looking at the receivers tab, it is visible that a few seconds after connecting the battery, the inputs suddenly stop. Other LORA modes function normally.

I am using the TMOTOR 6A AIO and HM ES24TX ELRS version 3.2

Here is the tasks output prior to connecting a battery:

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       2       0    0.0%    0.0%         0      1     62       1
01 - (         SYSTEM)    832      54       0    4.4%    0.0%        14     14   5679      46
02 - (           GYRO)   3380      54       3   18.2%    1.2%       305      0  19868       0
03 - (         FILTER)   3380     116      33   39.2%   11.3%      2830      0  19868       0
04 - (            PID)   3380     159      75   53.7%   25.3%      5769      0  19868       0
05 - (            ACC)    750      39       3    2.9%    0.2%        66      3   4636      19
06 - (       ATTITUDE)     99      85       9    0.8%    0.0%        27      1    614      84
07 - (             RX)    500      52      20    2.6%    1.0%       765    265   9207      28
08 - (         SERIAL)     99    8773       1   86.8%    0.0%       909      0    610      81
09 - (       DISPATCH)    826      61       0    5.0%    0.0%        19     16   5759      56
10 - (BATTERY_VOLTAGE)    199      53       2    1.0%    0.0%        10      2   1221      49
11 - (BATTERY_CURRENT)     50      53       1    0.2%    0.0%         1      1    308      52
12 - ( BATTERY_ALERTS)      5       3       2    0.0%    0.0%         0      0     31       8
13 - (         BEEPER)     99      16       0    0.1%    0.0%         2      4    610      27
14 - (      TELEMETRY)    478      55       0    2.6%    0.0%        12      7   2977      41
16 - (            OSD)     12      95      25    0.1%    0.0%       205     46   2620      94
18 - (            CMS)     20      17       1    0.0%    0.0%         0      0    124      16
19 - (        VTXCTRL)      5      16       1    0.0%    0.0%         2      0     31      72
21 - (    ADCINTERNAL)      1      17       3    0.0%    0.0%         0      1      6      16
23 - (SPEED_NEGOTIATION)     99      42       1    0.4%    0.0%         5      1    610      39
RX Check Function                  66       2                       119
Total (excluding SERIAL)                                39.0%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10      23       0    0.0%    0.0%         0      1     48      22
01 - (         SYSTEM)    926      53       0    4.9%    0.0%        17      7   4241      41
02 - (           GYRO)   3382      53       3   17.9%    1.2%       370      0  16108       0
03 - (         FILTER)   3382     114      33   38.5%   11.3%      3405      0  16108       0
04 - (            PID)   3382     147      70   49.7%   23.9%      6935      0  16108       0
05 - (            ACC)    722      63       3    4.5%    0.2%        77      5   3555      60
06 - (       ATTITUDE)     99      87      11    0.8%    0.1%        32      1    473      86
07 - (             RX)    498      51      20    2.5%    0.9%       910    196   7116      27
08 - (         SERIAL)     99    3014       1   29.8%    0.0%       913      0    470     138
09 - (       DISPATCH)    940      64       0    6.0%    0.0%        23      6   4016      42
10 - (BATTERY_VOLTAGE)    198      42       2    0.8%    0.0%        12      1    946      41
11 - (BATTERY_CURRENT)     50       1       0    0.0%    0.0%         1      0    237      50
12 - ( BATTERY_ALERTS)      5       4       2    0.0%    0.0%         0      0     24       8
13 - (         BEEPER)     99      53       0    0.5%    0.0%         3      2    470      52
14 - (      TELEMETRY)    479      33       0    1.5%    0.0%        14      2   2285      23
16 - (            OSD)     12     115      22    0.1%    0.0%       246     51   2070      89
18 - (            CMS)     20       7       1    0.0%    0.0%         1      1     95      15
19 - (        VTXCTRL)      5       3       1    0.0%    0.0%         2      0     24      72
21 - (    ADCINTERNAL)      1       3       2    0.0%    0.0%         0      0      5      16
23 - (SPEED_NEGOTIATION)     99      42       1    0.4%    0.0%         6      0    470      38
RX Check Function                  61       2                       143
Total (excluding SERIAL)                                37.6%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       6       1    0.0%    0.0%         0      0    229      20
01 - (         SYSTEM)    932      53       0    4.9%    0.0%        30     82  21007      36
02 - (           GYRO)   3222      49       3   15.7%    1.1%       665      0  73847       0
03 - (         FILTER)   3222     113      33   36.4%   10.6%      5988      0  73847       0
04 - (            PID)   3222     146      73   47.0%   23.5%     12177      0  73847       0
05 - (            ACC)    752      62       3    4.6%    0.2%       138      6  17186      47
06 - (       ATTITUDE)     99      86      10    0.8%    0.0%        56      3   2266      80
07 - (             RX)    497      44      19    2.1%    0.9%      1587    395  33696      23
08 - (         SERIAL)     98    8513       1   83.4%    0.0%       925      0   2251      95
09 - (       DISPATCH)    916      54       0    4.9%    0.0%        41    110  21016      36
10 - (BATTERY_VOLTAGE)    198      54       1    1.0%    0.0%        21      9   4525      52
11 - (BATTERY_CURRENT)     50      22       0    0.1%    0.0%         2      0   1142      42
12 - ( BATTERY_ALERTS)      5      23       3    0.0%    0.0%         0      2    115      22
13 - (         BEEPER)     98      53       0    0.5%    0.0%         5      1   2251      48
14 - (      TELEMETRY)    493      54       0    2.6%    0.0%        21     22  10902      14
16 - (            OSD)     12     110      21    0.1%    0.0%       427    147   9594      92
18 - (            CMS)     20      17       1    0.0%    0.0%         1      1    458      15
19 - (        VTXCTRL)      5      19       1    0.0%    0.0%         2      0    115      71
21 - (    ADCINTERNAL)      1       3       2    0.0%    0.0%         0      0     23      16
23 - (SPEED_NEGOTIATION)     98      38       1    0.3%    0.0%        10      3   2251      22
RX Check Function                  68       1                       249
Total (excluding SERIAL)                                36.3%`

and tasks output after connecting the battery

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10      26       0    0.0%    0.0%         1      2   1438      16
01 - (         SYSTEM)    923      54       0    4.9%    0.0%       113    368 131617      37
02 - (           GYRO)   3216      50       3   16.0%    1.2%      2502      0 463477       0
03 - (         FILTER)   3216     111      33   35.6%   10.6%     22005      0 463477       0
04 - (            PID)   3216     160      87   51.4%   28.0%     47158      0 463477       0
05 - (            ACC)    766      76       3    5.8%    0.2%       519     78 108743      37
06 - (       ATTITUDE)     99      83      10    0.8%    0.1%       203     16  14232      46
07 - (             RX)    130      46      20    0.5%    0.2%      5216   3436 180051      23
08 - (         SERIAL)     99    3873       1   38.3%    0.0%       951      0  14079      54
09 - (       DISPATCH)    951      55       0    5.2%    0.0%       155    594 132040       7
10 - (BATTERY_VOLTAGE)    198      62       2    1.2%    0.0%        80     34  28392      29
11 - (BATTERY_CURRENT)     50       9       2    0.0%    0.0%        11      1   7183       6
12 - ( BATTERY_ALERTS)      5      57       2    0.0%    0.0%         2      4    719      53
13 - (         BEEPER)     99      53       0    0.5%    0.0%        21     29  14079      14
14 - (      TELEMETRY)    452      55       0    2.4%    0.0%        69    118  67507      33
16 - (            OSD)     12     118      21    0.1%    0.0%      1583   1034  60968      76
18 - (            CMS)     20      23       1    0.0%    0.0%         7      5   2874      20
19 - (        VTXCTRL)      5      38       1    0.0%    0.0%         3      0    719      65
21 - (    ADCINTERNAL)      1      17       2    0.0%    0.0%         0      0    144      15
23 - (SPEED_NEGOTIATION)     99      50       2    0.4%    0.0%        37     23  14079      17
RX Check Function                  86       1                       885
Total (excluding SERIAL)                                40.3%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       2       1    0.0%    0.0%         1      1     48      15
01 - (         SYSTEM)    942      38       0    3.5%    0.0%       115      5   4375       6
02 - (           GYRO)   3219      48       3   15.4%    1.2%      2560      0  15237       0
03 - (         FILTER)   3219     109      33   35.0%   10.7%     22511      0  15237       0
04 - (            PID)   3219     160      84   51.5%   27.1%     48461      0  15237       0
05 - (            ACC)    775      76       3    5.8%    0.2%       532      2   3661      47
06 - (       ATTITUDE)     99      69       9    0.6%    0.0%       208      1    469      65
07 - (             RX)     55      44      21    0.2%    0.1%      5236     69    960      21
08 - (         SERIAL)     99   11594       1  114.7%    0.0%       963      0    468      70
09 - (       DISPATCH)    924      38       0    3.5%    0.0%       158      9   4444      24
10 - (BATTERY_VOLTAGE)    198      47       2    0.9%    0.0%        82      1    937      40
11 - (BATTERY_CURRENT)     50       8       2    0.0%    0.0%        12      1    237       7
12 - ( BATTERY_ALERTS)      5       2       2    0.0%    0.0%         2      0     24      53
13 - (         BEEPER)     99      17       1    0.1%    0.0%        21      3    468      16
14 - (      TELEMETRY)    475      16       0    0.7%    0.0%        71      0   2196      16
16 - (            OSD)     12      95      23    0.1%    0.0%      1620     41   2016      72
18 - (            CMS)     20       2       1    0.0%    0.0%         7      0     95      19
19 - (        VTXCTRL)      5       1       1    0.0%    0.0%         3      0     23      65
21 - (    ADCINTERNAL)      1       3       2    0.0%    0.0%         0      0      5      15
23 - (SPEED_NEGOTIATION)     99      21       1    0.2%    0.0%        38      2    468      19
RX Check Function                  52       2                       900
Total (excluding SERIAL)                                39.3%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       1       0    0.0%    0.0%         1      0     19      15
01 - (         SYSTEM)    903      38       0    3.4%    0.0%       117      4   1821      28
02 - (           GYRO)   3218      48       3   15.4%    1.1%      2583      0   6298       0
03 - (         FILTER)   3218     106      32   34.1%   10.4%     22719      0   6298       0
04 - (            PID)   3218     158      86   50.8%   27.8%     48999      0   6298       0
05 - (            ACC)    767      55       3    4.2%    0.2%       537      2   1524      47
06 - (       ATTITUDE)     99      31      10    0.3%    0.0%       210      0    194      64
07 - (             RX)     64      36      22    0.2%    0.1%      5243     22    330      21
08 - (         SERIAL)     99   11180       1  110.6%    0.0%       975      0    194      36
09 - (       DISPATCH)    935      19       0    1.7%    0.0%       160      0   1837      10
10 - (BATTERY_VOLTAGE)    198      17       2    0.3%    0.0%        83      0    388      37
11 - (BATTERY_CURRENT)     50       7       2    0.0%    0.0%        12      1     98       6
12 - ( BATTERY_ALERTS)      5       2       2    0.0%    0.0%         2      0     10      53
13 - (         BEEPER)     99      16       1    0.1%    0.0%        21      0    194      15
14 - (      TELEMETRY)    474      15       0    0.7%    0.0%        71      2    937       9
16 - (            OSD)     12      63      23    0.0%    0.0%      1636     15    845      70
18 - (            CMS)     20      17       1    0.0%    0.0%         7      0     39      19
19 - (        VTXCTRL)      5       1       0    0.0%    0.0%         3      0     10      65
21 - (    ADCINTERNAL)      1       2       2    0.0%    0.0%         0      0      2      15
23 - (SPEED_NEGOTIATION)     99      16       1    0.1%    0.0%        38      0    194      15
RX Check Function                  41       2                       906
Total (excluding SERIAL)                                39.6%
# 

# dump

# version
# Betaflight / STM32F411 (S411) 4.5.0 Dec  8 2023 / 08:57:42 (b7c091333) MSP API: 1.46
# config rev: 8c646d1

# start the command batch
batch start

board_name TMOTORF4SX1280
manufacturer_id TMTR

# name: Justice

# resources
resource BEEPER 1 B02
resource MOTOR 1 B00
resource MOTOR 2 B01
resource MOTOR 3 B06
resource MOTOR 4 B07
resource MOTOR 5 NONE
resource MOTOR 6 NONE
resource MOTOR 7 NONE
resource MOTOR 8 NONE
resource LED_STRIP 1 A10
resource SERIAL_TX 1 A09
resource SERIAL_TX 2 A02
resource SERIAL_TX 3 NONE
resource SERIAL_TX 4 NONE
resource SERIAL_TX 5 NONE
resource SERIAL_TX 6 NONE
resource SERIAL_TX 7 NONE
resource SERIAL_TX 8 NONE
resource SERIAL_TX 9 NONE
resource SERIAL_TX 10 NONE
resource SERIAL_TX 11 NONE
resource SERIAL_RX 1 NONE
resource SERIAL_RX 2 A03
resource SERIAL_RX 3 NONE
resource SERIAL_RX 4 NONE
resource SERIAL_RX 5 NONE
resource SERIAL_RX 6 NONE
resource SERIAL_RX 7 NONE
resource SERIAL_RX 8 NONE
resource SERIAL_RX 9 NONE
resource SERIAL_RX 10 NONE
resource SERIAL_RX 11 NONE
resource INVERTER 1 NONE
resource INVERTER 2 NONE
resource INVERTER 3 NONE
resource INVERTER 4 NONE
resource INVERTER 5 NONE
resource INVERTER 6 NONE
resource INVERTER 7 NONE
resource INVERTER 8 NONE
resource INVERTER 9 NONE
resource INVERTER 10 NONE
resource INVERTER 11 NONE
resource SOFTSERIAL_TX 1 NONE
resource SOFTSERIAL_TX 2 NONE
resource SOFTSERIAL_RX 1 NONE
resource SOFTSERIAL_RX 2 NONE
resource I2C_SCL 1 NONE
resource I2C_SCL 2 NONE
resource I2C_SCL 3 NONE
resource I2C_SDA 1 NONE
resource I2C_SDA 2 NONE
resource I2C_SDA 3 NONE
resource LED 1 C13
resource LED 2 NONE
resource LED 3 NONE
resource SPI_SCK 1 A05
resource SPI_SCK 2 B13
resource SPI_SCK 3 B03
resource SPI_SDI 1 A06
resource SPI_SDI 2 B14
resource SPI_SDI 3 B04
resource SPI_SDO 1 A07
resource SPI_SDO 2 B15
resource SPI_SDO 3 B05
resource ESCSERIAL 1 NONE
resource ADC_BATT 1 A01
resource ADC_RSSI 1 NONE
resource ADC_CURR 1 A00
resource ADC_EXT 1 NONE
resource PINIO 1 NONE
resource PINIO 2 NONE
resource PINIO 3 NONE
resource PINIO 4 NONE
resource OSD_CS 1 B12
resource RX_SPI_CS 1 A15
resource RX_SPI_EXTI 1 C14
resource RX_SPI_BIND 1 B10
resource RX_SPI_LED 1 A14
resource RX_SPI_EXPRESSLRS_RESET 1 A08
resource RX_SPI_EXPRESSLRS_BUSY 1 A13
resource GYRO_EXTI 1 C15
resource GYRO_EXTI 2 NONE
resource GYRO_CS 1 A04
resource GYRO_CS 2 NONE
resource USB_DETECT 1 NONE
resource PULLUP 1 NONE
resource PULLUP 2 NONE
resource PULLUP 3 NONE
resource PULLUP 4 NONE
resource PULLDOWN 1 NONE
resource PULLDOWN 2 NONE
resource PULLDOWN 3 NONE
resource PULLDOWN 4 NONE

# timer
timer A03 AF3
# pin A03: TIM9 CH2 (AF3)
timer B00 AF2
# pin B00: TIM3 CH3 (AF2)
timer B01 AF2
# pin B01: TIM3 CH4 (AF2)
timer B06 AF2
# pin B06: TIM4 CH1 (AF2)
timer B07 AF2
# pin B07: TIM4 CH2 (AF2)
timer A10 AF1
# pin A10: TIM1 CH3 (AF1)

# dma
dma SPI_SDO 1 NONE
dma SPI_SDO 2 NONE
dma SPI_SDO 3 NONE
dma SPI_SDI 1 NONE
dma SPI_SDI 2 NONE
dma SPI_SDI 3 NONE
dma SPI_TX 1 NONE
dma SPI_TX 2 NONE
dma SPI_TX 3 NONE
dma SPI_RX 1 NONE
dma SPI_RX 2 NONE
dma SPI_RX 3 NONE
dma ADC 1 0
# ADC 1: DMA2 Stream 0 Channel 0
dma ADC 2 NONE
dma ADC 3 NONE
dma UART_TX 1 NONE
dma UART_TX 2 NONE
dma UART_TX 3 NONE
dma UART_TX 4 NONE
dma UART_TX 5 NONE
dma UART_TX 6 NONE
dma UART_TX 7 NONE
dma UART_TX 8 NONE
dma UART_TX 9 NONE
dma UART_TX 10 NONE
dma UART_TX 11 NONE
dma UART_RX 1 NONE
dma UART_RX 2 NONE
dma UART_RX 3 NONE
dma UART_RX 4 NONE
dma UART_RX 5 NONE
dma UART_RX 6 NONE
dma UART_RX 7 NONE
dma UART_RX 8 NONE
dma UART_RX 9 NONE
dma UART_RX 10 NONE
dma UART_RX 11 NONE
dma pin A03 NONE
dma pin B00 0
# pin B00: DMA1 Stream 7 Channel 5
dma pin B01 0
# pin B01: DMA1 Stream 2 Channel 5
dma pin B06 0
# pin B06: DMA1 Stream 0 Channel 2
dma pin B07 0
# pin B07: DMA1 Stream 3 Channel 2
dma pin A10 0
# pin A10: DMA2 Stream 6 Channel 0

# feature
feature -RX_PPM
feature -INFLIGHT_ACC_CAL
feature -RX_SERIAL
feature -MOTOR_STOP
feature -SERVO_TILT
feature -SOFTSERIAL
feature -GPS
feature -RANGEFINDER
feature -TELEMETRY
feature -3D
feature -RX_PARALLEL_PWM
feature -RX_MSP
feature -RSSI_ADC
feature -LED_STRIP
feature -DISPLAY
feature -OSD
feature -CHANNEL_FORWARDING
feature -TRANSPONDER
feature -AIRMODE
feature -RX_SPI
feature -ESC_SENSOR
feature -ANTI_GRAVITY
feature TELEMETRY
feature OSD
feature AIRMODE
feature RX_SPI
feature ANTI_GRAVITY

# serial
serial 20 1 115200 57600 0 115200
serial 0 2048 115200 57600 0 115200
serial 1 0 115200 57600 0 115200

# mixer
mixer QUADX

mmix reset


# beeper
beeper GYRO_CALIBRATED
beeper RX_LOST
beeper RX_LOST_LANDING
beeper DISARMING
beeper ARMING
beeper ARMING_GPS_FIX
beeper ARMING_GPS_NO_FIX
beeper BAT_CRIT_LOW
beeper BAT_LOW
beeper GPS_STATUS
beeper RX_SET
beeper ACC_CALIBRATION
beeper ACC_CALIBRATION_FAIL
beeper READY_BEEP
beeper MULTI_BEEPS
beeper DISARM_REPEAT
beeper ARMED
beeper SYSTEM_INIT
beeper ON_USB
beeper BLACKBOX_ERASE
beeper CRASH_FLIP
beeper CAM_CONNECTION_OPEN
beeper CAM_CONNECTION_CLOSE
beeper RC_SMOOTHING_INIT_FAIL

# beacon
beacon -RX_LOST
beacon -RX_SET

# map
map TAER1234

# led
led 0 0,0::C:0
led 1 0,0::C:0
led 2 0,0::C:0
led 3 0,0::C:0
led 4 0,0::C:0
led 5 0,0::C:0
led 6 0,0::C:0
led 7 0,0::C:0
led 8 0,0::C:0
led 9 0,0::C:0
led 10 0,0::C:0
led 11 0,0::C:0
led 12 0,0::C:0
led 13 0,0::C:0
led 14 0,0::C:0
led 15 0,0::C:0
led 16 0,0::C:0
led 17 0,0::C:0
led 18 0,0::C:0
led 19 0,0::C:0
led 20 0,0::C:0
led 21 0,0::C:0
led 22 0,0::C:0
led 23 0,0::C:0
led 24 0,0::C:0
led 25 0,0::C:0
led 26 0,0::C:0
led 27 0,0::C:0
led 28 0,0::C:0
led 29 0,0::C:0
led 30 0,0::C:0
led 31 0,0::C:0

# color
color 0 0,0,0
color 1 0,255,255
color 2 0,0,255
color 3 30,0,255
color 4 60,0,255
color 5 90,0,255
color 6 120,0,255
color 7 150,0,255
color 8 180,0,255
color 9 210,0,255
color 10 240,0,255
color 11 270,0,255
color 12 300,0,255
color 13 330,0,255
color 14 0,0,0
color 15 0,0,0

# mode_color
mode_color 0 0 1
mode_color 0 1 11
mode_color 0 2 2
mode_color 0 3 13
mode_color 0 4 10
mode_color 0 5 3
mode_color 1 0 5
mode_color 1 1 11
mode_color 1 2 3
mode_color 1 3 13
mode_color 1 4 10
mode_color 1 5 3
mode_color 2 0 10
mode_color 2 1 11
mode_color 2 2 4
mode_color 2 3 13
mode_color 2 4 10
mode_color 2 5 3
mode_color 3 0 8
mode_color 3 1 11
mode_color 3 2 4
mode_color 3 3 13
mode_color 3 4 10
mode_color 3 5 3
mode_color 4 0 7
mode_color 4 1 11
mode_color 4 2 3
mode_color 4 3 13
mode_color 4 4 10
mode_color 4 5 3
mode_color 5 0 0
mode_color 5 1 0
mode_color 5 2 0
mode_color 5 3 0
mode_color 5 4 0
mode_color 5 5 0
mode_color 6 0 6
mode_color 6 1 10
mode_color 6 2 1
mode_color 6 3 0
mode_color 6 4 0
mode_color 6 5 2
mode_color 6 6 3
mode_color 6 7 6
mode_color 6 8 0
mode_color 6 9 0
mode_color 6 10 0
mode_color 7 0 3

# aux
aux 0 0 0 1300 2100 0 0
aux 1 35 1 1800 2100 0 0
aux 2 49 2 1800 2100 0 0
aux 3 0 0 900 900 0 0
aux 4 0 0 900 900 0 0
aux 5 0 0 900 900 0 0
aux 6 0 0 900 900 0 0
aux 7 0 0 900 900 0 0
aux 8 0 0 900 900 0 0
aux 9 0 0 900 900 0 0
aux 10 0 0 900 900 0 0
aux 11 0 0 900 900 0 0
aux 12 0 0 900 900 0 0
aux 13 0 0 900 900 0 0
aux 14 0 0 900 900 0 0
aux 15 0 0 900 900 0 0
aux 16 0 0 900 900 0 0
aux 17 0 0 900 900 0 0
aux 18 0 0 900 900 0 0
aux 19 0 0 900 900 0 0

# adjrange
adjrange 0 0 0 900 900 0 0 0 0
adjrange 1 0 0 900 900 0 0 0 0
adjrange 2 0 0 900 900 0 0 0 0
adjrange 3 0 0 900 900 0 0 0 0
adjrange 4 0 0 900 900 0 0 0 0
adjrange 5 0 0 900 900 0 0 0 0
adjrange 6 0 0 900 900 0 0 0 0
adjrange 7 0 0 900 900 0 0 0 0
adjrange 8 0 0 900 900 0 0 0 0
adjrange 9 0 0 900 900 0 0 0 0
adjrange 10 0 0 900 900 0 0 0 0
adjrange 11 0 0 900 900 0 0 0 0
adjrange 12 0 0 900 900 0 0 0 0
adjrange 13 0 0 900 900 0 0 0 0
adjrange 14 0 0 900 900 0 0 0 0
adjrange 15 0 0 900 900 0 0 0 0
adjrange 16 0 0 900 900 0 0 0 0
adjrange 17 0 0 900 900 0 0 0 0
adjrange 18 0 0 900 900 0 0 0 0
adjrange 19 0 0 900 900 0 0 0 0
adjrange 20 0 0 900 900 0 0 0 0
adjrange 21 0 0 900 900 0 0 0 0
adjrange 22 0 0 900 900 0 0 0 0
adjrange 23 0 0 900 900 0 0 0 0
adjrange 24 0 0 900 900 0 0 0 0
adjrange 25 0 0 900 900 0 0 0 0
adjrange 26 0 0 900 900 0 0 0 0
adjrange 27 0 0 900 900 0 0 0 0
adjrange 28 0 0 900 900 0 0 0 0
adjrange 29 0 0 900 900 0 0 0 0

# rxrange
rxrange 0 1000 2000
rxrange 1 1000 2000
rxrange 2 1000 2000
rxrange 3 1000 2000

# vtxtable
vtxtable bands 6
vtxtable channels 8
vtxtable band 1 BOSCAM_A A FACTORY 5865 5845 5825 5805 5785 5765 5745 5725
vtxtable band 2 BOSCAM_B B FACTORY 5733 5752 5771 5790 5809 5828 5847 5866
vtxtable band 3 BOSCAM_E E FACTORY 5705 5685 5665    0 5885 5905    0    0
vtxtable band 4 FATSHARK F FACTORY 5740 5760 5780 5800 5820 5840 5860 5880
vtxtable band 5 RACEBAND R FACTORY 5658 5695 5732 5769 5806 5843 5880 5917
vtxtable band 6 IMD6     I CUSTOM  5732 5765 5828 5840 5866 5740    0    0
vtxtable powerlevels 2
vtxtable powervalues 0 1
vtxtable powerlabels 25 50

# vtx
vtx 0 0 0 0 0 900 900
vtx 1 0 0 0 0 900 900
vtx 2 0 0 0 0 900 900
vtx 3 0 0 0 0 900 900
vtx 4 0 0 0 0 900 900
vtx 5 0 0 0 0 900 900
vtx 6 0 0 0 0 900 900
vtx 7 0 0 0 0 900 900
vtx 8 0 0 0 0 900 900
vtx 9 0 0 0 0 900 900

# rxfail
rxfail 0 a
rxfail 1 a
rxfail 2 a
rxfail 3 a
rxfail 4 h
rxfail 5 h
rxfail 6 h
rxfail 7 h
rxfail 8 h
rxfail 9 h
rxfail 10 h
rxfail 11 h
rxfail 12 h
rxfail 13 h
rxfail 14 h
rxfail 15 h
rxfail 16 h
rxfail 17 h

# master
set gyro_hardware_lpf = NORMAL
set gyro_lpf1_type = PT1
set gyro_lpf1_static_hz = 250
set gyro_lpf2_type = PT1
set gyro_lpf2_static_hz = 500
set gyro_notch1_hz = 0
set gyro_notch1_cutoff = 0
set gyro_notch2_hz = 0
set gyro_notch2_cutoff = 0
set gyro_calib_duration = 125
set gyro_calib_noise_limit = 48
set gyro_offset_yaw = 0
set gyro_overflow_detect = ALL
set yaw_spin_recovery = AUTO
set yaw_spin_threshold = 1950
set gyro_to_use = FIRST
set dyn_notch_count = 3
set dyn_notch_q = 300
set dyn_notch_min_hz = 100
set dyn_notch_max_hz = 600
set gyro_lpf1_dyn_min_hz = 250
set gyro_lpf1_dyn_max_hz = 500
set gyro_lpf1_dyn_expo = 5
set gyro_filter_debug_axis = ROLL
set acc_hardware = AUTO
set acc_lpf_hz = 25
set acc_trim_pitch = 0
set acc_trim_roll = 0
set acc_calibration = 45,-57,43,1
set mid_rc = 1500
set min_check = 1015
set max_check = 2000
set rssi_channel = 0
set rssi_src_frame_errors = OFF
set rssi_scale = 100
set rssi_offset = 0
set rssi_invert = OFF
set rssi_src_frame_lpf_period = 30
set rssi_smoothing = 125
set rc_smoothing = ON
set rc_smoothing_auto_factor = 25
set rc_smoothing_auto_factor_throttle = 25
set rc_smoothing_setpoint_cutoff = 0
set rc_smoothing_feedforward_cutoff = 0
set rc_smoothing_throttle_cutoff = 0
set rc_smoothing_debug_axis = ROLL
set fpv_mix_degrees = 0
set max_aux_channels = 14
set serialrx_provider = CRSF
set serialrx_inverted = OFF
set crsf_use_negotiated_baud = OFF
set airmode_start_throttle_percent = 25
set rx_min_usec = 885
set rx_max_usec = 2115
set serialrx_halfduplex = OFF
set msp_override_channels_mask = 0
set rx_spi_protocol = EXPRESSLRS
set rx_spi_bus = 3
set rx_spi_led_inversion = ON
set adc_device = 1
set adc_vrefint_calibration = 0
set adc_tempsensor_calibration30 = 0
set adc_tempsensor_calibration110 = 0
set min_throttle = 1070
set max_throttle = 2000
set min_command = 1000
set motor_kv = 1960
set dshot_idle_value = 600
set dshot_burst = AUTO
set dshot_bidir = ON
set dshot_edt = OFF
set dshot_bitbang = OFF
set dshot_bitbang_timer = AUTO
set use_unsynced_pwm = OFF
set motor_pwm_protocol = DSHOT300
set motor_pwm_rate = 480
set motor_pwm_inversion = OFF
set motor_poles = 12
set motor_output_reordering = 0,1,2,3,4,5,6,7
set thr_corr_value = 0
set thr_corr_angle = 800
set failsafe_delay = 15
set failsafe_off_delay = 10
set failsafe_throttle = 1000
set failsafe_switch_mode = STAGE1
set failsafe_throttle_low_delay = 100
set failsafe_procedure = DROP
set failsafe_recovery_delay = 5
set failsafe_stick_threshold = 30
set align_board_roll = 0
set align_board_pitch = 0
set align_board_yaw = 45
set bat_capacity = 0
set vbat_max_cell_voltage = 440
set vbat_full_cell_voltage = 410
set vbat_min_cell_voltage = 330
set vbat_warning_cell_voltage = 350
set vbat_hysteresis = 1
set current_meter = ADC
set battery_meter = ADC
set vbat_detect_cell_voltage = 300
set use_vbat_alerts = ON
set use_cbat_alerts = OFF
set cbat_alert_percent = 10
set vbat_cutoff_percent = 100
set force_battery_cell_count = 0
set vbat_display_lpf_period = 30
set vbat_sag_lpf_period = 2
set ibat_lpf_period = 10
set vbat_duration_for_warning = 0
set vbat_duration_for_critical = 0
set vbat_scale = 110
set vbat_divider = 10
set vbat_multiplier = 1
set ibata_scale = 250
set ibata_offset = 0
set ibatv_scale = 0
set ibatv_offset = 0
set beeper_inversion = ON
set beeper_od = OFF
set beeper_frequency = 0
set beeper_dshot_beacon_tone = 1
set yaw_motors_reversed = ON
set mixer_type = LEGACY
set crashflip_motor_percent = 0
set crashflip_expo = 35
set 3d_deadband_low = 1406
set 3d_deadband_high = 1514
set 3d_neutral = 1460
set 3d_deadband_throttle = 50
set 3d_limit_low = 1000
set 3d_limit_high = 2000
set 3d_switched_mode = OFF
set reboot_character = 82
set serial_update_rate_hz = 100
set imu_dcm_kp = 2500
set imu_dcm_ki = 0
set small_angle = 180
set imu_process_denom = 2
set auto_disarm_delay = 5
set gyro_cal_on_first_arm = OFF
set deadband = 0
set yaw_deadband = 0
set yaw_control_reversed = OFF
set pid_process_denom = 1
set runaway_takeoff_prevention = ON
set runaway_takeoff_deactivate_delay = 500
set runaway_takeoff_deactivate_throttle_percent = 20
set simplified_gyro_filter = ON
set simplified_gyro_filter_multiplier = 100
set tlm_inverted = OFF
set tlm_halfduplex = ON
set hott_alarm_int = 5
set pid_in_tlm = OFF
set report_cell_voltage = OFF
set telemetry_disabled_voltage = OFF
set telemetry_disabled_current = OFF
set telemetry_disabled_fuel = OFF
set telemetry_disabled_mode = OFF
set telemetry_disabled_acc_x = OFF
set telemetry_disabled_acc_y = OFF
set telemetry_disabled_acc_z = OFF
set telemetry_disabled_pitch = OFF
set telemetry_disabled_roll = OFF
set telemetry_disabled_heading = OFF
set telemetry_disabled_altitude = OFF
set telemetry_disabled_vario = OFF
set telemetry_disabled_lat_long = OFF
set telemetry_disabled_ground_speed = OFF
set telemetry_disabled_distance = OFF
set telemetry_disabled_esc_current = ON
set telemetry_disabled_esc_voltage = ON
set telemetry_disabled_esc_rpm = ON
set telemetry_disabled_esc_temperature = ON
set telemetry_disabled_temperature = OFF
set telemetry_disabled_cap_used = ON
set ledstrip_visual_beeper = OFF
set ledstrip_visual_beeper_color = WHITE
set ledstrip_grb_rgb = GRB
set ledstrip_profile = STATUS
set ledstrip_race_color = ORANGE
set ledstrip_beacon_color = WHITE
set ledstrip_beacon_period_ms = 500
set ledstrip_beacon_percent = 50
set ledstrip_beacon_armed_only = OFF
set ledstrip_brightness = 100
set ledstrip_rainbow_delta = 0
set ledstrip_rainbow_freq = 120
set osd_units = METRIC
set osd_warn_bitmask = 1571
set osd_rssi_alarm = 20
set osd_link_quality_alarm = 80
set osd_rssi_dbm_alarm = -60
set osd_rsnr_alarm = 4
set osd_cap_alarm = 2200
set osd_alt_alarm = 100
set osd_distance_alarm = 0
set osd_esc_temp_alarm = 0
set osd_esc_rpm_alarm = -1
set osd_esc_current_alarm = -1
set osd_core_temp_alarm = 70
set osd_ah_max_pit = 20
set osd_ah_max_rol = 40
set osd_ah_invert = OFF
set osd_logo_on_arming = OFF
set osd_logo_on_arming_duration = 5
set osd_tim1 = 2560
set osd_tim2 = 513
set osd_vbat_pos = 234
set osd_rssi_pos = 20
set osd_link_quality_pos = 2104
set osd_link_tx_power_pos = 234
set osd_rssi_dbm_pos = 4
set osd_rsnr_pos = 234
set osd_tim_1_pos = 234
set osd_tim_2_pos = 407
set osd_remaining_time_estimate_pos = 234
set osd_flymode_pos = 25
set osd_anti_gravity_pos = 234
set osd_g_force_pos = 234
set osd_throttle_pos = 6497
set osd_vtx_channel_pos = 234
set osd_crosshairs_pos = 205
set osd_ah_sbar_pos = 206
set osd_ah_pos = 78
set osd_current_pos = 234
set osd_mah_drawn_pos = 2456
set osd_wh_drawn_pos = 234
set osd_motor_diag_pos = 234
set osd_craft_name_pos = 6539
set osd_pilot_name_pos = 234
set osd_gps_speed_pos = 234
set osd_gps_lon_pos = 234
set osd_gps_lat_pos = 234
set osd_gps_sats_pos = 234
set osd_home_dir_pos = 234
set osd_home_dist_pos = 234
set osd_flight_dist_pos = 234
set osd_compass_bar_pos = 234
set osd_altitude_pos = 234
set osd_pid_roll_pos = 234
set osd_pid_pitch_pos = 234
set osd_pid_yaw_pos = 234
set osd_debug_pos = 321
set osd_power_pos = 234
set osd_pidrate_profile_pos = 234
set osd_warnings_pos = 2378
set osd_avg_cell_voltage_pos = 14721
set osd_pit_ang_pos = 234
set osd_rol_ang_pos = 234
set osd_battery_usage_pos = 234
set osd_disarmed_pos = 234
set osd_nheading_pos = 234
set osd_up_down_reference_pos = 205
set osd_ready_mode_pos = 234
set osd_esc_tmp_pos = 234
set osd_esc_rpm_pos = 234
set osd_esc_rpm_freq_pos = 234
set osd_rtc_date_time_pos = 234
set osd_adjustment_range_pos = 234
set osd_flip_arrow_pos = 2414
set osd_core_temp_pos = 234
set osd_stick_overlay_left_pos = 234
set osd_stick_overlay_right_pos = 234
set osd_stick_overlay_radio_mode = 2
set osd_rate_profile_name_pos = 234
set osd_pid_profile_name_pos = 234
set osd_profile_name_pos = 234
set osd_rcchannels_pos = 234
set osd_camera_frame_pos = 35
set osd_efficiency_pos = 234
set osd_total_flights_pos = 234
set osd_aux_pos = 234
set osd_sys_goggle_voltage_pos = 234
set osd_sys_vtx_voltage_pos = 234
set osd_sys_bitrate_pos = 234
set osd_sys_delay_pos = 234
set osd_sys_distance_pos = 234
set osd_sys_lq_pos = 234
set osd_sys_goggle_dvr_pos = 234
set osd_sys_vtx_dvr_pos = 234
set osd_sys_warnings_pos = 234
set osd_sys_vtx_temp_pos = 234
set osd_sys_fan_speed_pos = 234
set osd_stat_bitmask = 145060
set osd_profile = 1
set osd_profile_1_name = -
set osd_profile_2_name = -
set osd_profile_3_name = -
set osd_gps_sats_show_hdop = OFF
set osd_displayport_device = AUTO
set osd_rcchannels = -1,-1,-1,-1
set osd_camera_frame_width = 24
set osd_camera_frame_height = 11
set osd_stat_avg_cell_value = OFF
set osd_framerate_hz = 12
set osd_menu_background = TRANSPARENT
set osd_aux_channel = 1
set osd_aux_scale = 200
set osd_aux_symbol = 65
set osd_canvas_width = 30
set osd_canvas_height = 13
set osd_craftname_msgs = OFF
set system_hse_mhz = 8
set task_statistics = ON
set debug_mode = NONE
set rate_6pos_switch = OFF
set cpu_overclock = 108MHZ
set pwr_on_arm_grace = 5
set enable_stick_arming = OFF
set vtx_band = 4
set vtx_channel = 4
set vtx_power = 2
set vtx_low_power_disarm = OFF
set vtx_softserial_alt = OFF
set vtx_freq = 5800
set vtx_pit_mode_freq = 0
set vtx_halfduplex = ON
set vcd_video_system = NTSC
set vcd_h_offset = 0
set vcd_v_offset = 0
set max7456_clock = NOMINAL
set max7456_spi_bus = 2
set max7456_preinit_opu = OFF
set displayport_msp_col_adjust = 0
set displayport_msp_row_adjust = 0
set displayport_msp_fonts = 0,1,2,3
set displayport_msp_use_device_blink = OFF
set displayport_max7456_col_adjust = 0
set displayport_max7456_row_adjust = 0
set displayport_max7456_inv = OFF
set displayport_max7456_blk = 0
set displayport_max7456_wht = 2
set esc_sensor_halfduplex = OFF
set esc_sensor_current_offset = 0
set led_inversion = 0
set pinio_config = 1,1,1,1
set pinio_box = 255,255,255,255
set usb_hid_cdc = OFF
set rcdevice_init_dev_attempts = 6
set rcdevice_init_dev_attempt_interval = 1000
set rcdevice_protocol_version = 0
set rcdevice_feature = 0
set gyro_1_bustype = SPI
set gyro_1_spibus = 1
set gyro_1_i2cBus = 0
set gyro_1_i2c_address = 0
set gyro_1_sensor_align = CW180FLIP
set gyro_1_align_roll = 0
set gyro_1_align_pitch = 1800
set gyro_1_align_yaw = 1800
set gyro_2_bustype = NONE
set gyro_2_spibus = 0
set gyro_2_i2cBus = 0
set gyro_2_i2c_address = 0
set gyro_2_sensor_align = DEFAULT
set gyro_2_align_roll = 0
set gyro_2_align_pitch = 0
set gyro_2_align_yaw = 0
set i2c1_pullup = OFF
set i2c1_clockspeed_khz = 800
set i2c2_pullup = OFF
set i2c2_clockspeed_khz = 800
set i2c3_pullup = OFF
set i2c3_clockspeed_khz = 800
set mco2_on_pc9 = OFF
set expresslrs_uid = 36,102,107,121,240,214
set expresslrs_domain = ISM2400
set expresslrs_model_id = 255
set scheduler_relax_rx = 1
set scheduler_relax_osd = 1
set serialmsp_halfduplex = OFF
set timezone_offset_minutes = 0
set rpm_filter_harmonics = 1
set rpm_filter_weights = 100,100,100
set rpm_filter_q = 500
set rpm_filter_min_hz = 100
set rpm_filter_fade_range_hz = 50
set rpm_filter_lpf_hz = 150
set stats_min_armed_time_s = -1
set stats_total_flights = 0
set stats_total_time_s = 0
set stats_total_dist_m = 0
set craft_name = Justice
set pilot_name = Justice
set altitude_source = DEFAULT
set altitude_prefer_baro = 100
set altitude_lpf = 300
set altitude_d_lpf = 100
set box_user_1_name = -
set box_user_2_name = -
set box_user_3_name = -
set box_user_4_name = -

profile 0

# profile 0
set profile_name = -
set dterm_lpf1_dyn_min_hz = 75
set dterm_lpf1_dyn_max_hz = 150
set dterm_lpf1_dyn_expo = 5
set dterm_lpf1_type = PT1
set dterm_lpf1_static_hz = 75
set dterm_lpf2_type = PT1
set dterm_lpf2_static_hz = 150
set dterm_notch_hz = 0
set dterm_notch_cutoff = 0
set vbat_sag_compensation = 50
set pid_at_min_throttle = ON
set anti_gravity_gain = 80
set anti_gravity_cutoff_hz = 5
set anti_gravity_p_gain = 100
set acc_limit_yaw = 0
set acc_limit = 0
set crash_dthreshold = 50
set crash_gthreshold = 400
set crash_setpoint_threshold = 350
set crash_time = 500
set crash_delay = 0
set crash_recovery_angle = 10
set crash_recovery_rate = 100
set crash_limit_yaw = 200
set crash_recovery = OFF
set iterm_rotation = OFF
set iterm_relax = RP
set iterm_relax_type = SETPOINT
set iterm_relax_cutoff = 20
set iterm_windup = 85
set iterm_limit = 400
set pidsum_limit = 500
set pidsum_limit_yaw = 400
set yaw_lowpass_hz = 100
set throttle_boost = 5
set throttle_boost_cutoff = 15
set p_pitch = 77
set i_pitch = 69
set d_pitch = 74
set f_pitch = 220
set p_roll = 74
set i_roll = 66
set d_roll = 66
set f_roll = 211
set p_yaw = 74
set i_yaw = 66
set d_yaw = 0
set f_yaw = 211
set angle_p_gain = 50
set angle_feedforward = 50
set angle_feedforward_smoothing_ms = 80
set angle_limit = 60
set angle_earth_ref = 100
set horizon_level_strength = 50
set horizon_limit_sticks = 75
set horizon_limit_degrees = 135
set horizon_ignore_sticks = OFF
set horizon_delay_ms = 500
set abs_control_gain = 0
set abs_control_limit = 90
set abs_control_error_limit = 20
set abs_control_cutoff = 11
set use_integrated_yaw = OFF
set integrated_yaw_relax = 200
set d_min_roll = 66
set d_min_pitch = 74
set d_min_yaw = 0
set d_max_gain = 37
set d_max_advance = 0
set motor_output_limit = 100
set auto_profile_cell_count = 0
set launch_control_mode = NORMAL
set launch_trigger_allow_reset = ON
set launch_trigger_throttle_percent = 20
set launch_angle_limit = 0
set launch_control_gain = 40
set thrust_linear = 20
set transient_throttle_limit = 0
set feedforward_transition = 0
set feedforward_averaging = 2_POINT
set feedforward_smooth_factor = 75
set feedforward_jitter_factor = 3
set feedforward_boost = 18
set feedforward_max_rate_limit = 95
set dyn_idle_min_rpm = 0
set dyn_idle_p_gain = 50
set dyn_idle_i_gain = 50
set dyn_idle_d_gain = 50
set dyn_idle_max_increase = 150
set dyn_idle_start_increase = 50
set level_race_mode = OFF
set simplified_pids_mode = RPY
set simplified_master_multiplier = 110
set simplified_i_gain = 50
set simplified_d_gain = 200
set simplified_pi_gain = 150
set simplified_dmax_gain = 0
set simplified_feedforward_gain = 160
set simplified_pitch_d_gain = 100
set simplified_pitch_pi_gain = 100
set simplified_dterm_filter = ON
set simplified_dterm_filter_multiplier = 100
set tpa_mode = D
set tpa_rate = 65
set tpa_breakpoint = 1250
set tpa_rate_lower = 20
set tpa_breakpoint_lower = 1050
set tpa_breakpoint_lower_fade = ON

rateprofile 0

# rateprofile 0
set rateprofile_name = -
set thr_mid = 100
set thr_expo = 30
set rates_type = ACTUAL
set quickrates_rc_expo = OFF
set roll_rc_rate = 20
set pitch_rc_rate = 20
set yaw_rc_rate = 20
set roll_expo = 50
set pitch_expo = 50
set yaw_expo = 25
set roll_srate = 50
set pitch_srate = 50
set yaw_srate = 50
set throttle_limit_type = OFF
set throttle_limit_percent = 100
set roll_rate_limit = 1998
set pitch_rate_limit = 1998
set yaw_rate_limit = 1998

# end the command batch
batch end

# 

@Justicefpv
Copy link

I hope this video makes things clearer. You can see in the OSD that once the battery is connected, the LQ slowly drops to 0
https://youtu.be/9p1hH483Zic

@CapnBry
Copy link
Contributor Author

CapnBry commented Dec 8, 2023

I hope this video makes things clearer. You can see in the OSD that once the battery is connected, the LQ slowly drops to 0 https://youtu.be/9p1hH483Zic

That's really bizarre, but it seems like it loses sync then keeps losing sync more and more until it drops off. I'd bet if you changed to Wide switch mode (which doesn't allow desync) it would drop off instantly, or connect/disconnect over and over.

I only have MPU6000-based FCs (Pancake and CrazyF4) and they do not show this issue so there's something different about that board when the battery is connected. BMI270 interacting with bidir DSHOT somehow in a way that blocks the RX process momentarily? Does it do the same thing if you start with your handset off, plug in the battery, then turn on the handset with F500? Really strange because the code all takes the same amount of time regardless of if the packet was received with LoRa vs FLRC so I can't even wrap my head around why it would work with one and not the other.

@CapnBry
Copy link
Contributor Author

CapnBry commented Dec 8, 2023

It’s a little bit of sore point that the spi implementation on our side pushed our rc phase on 4.3 to 3-4 months and then elrs dropped support. It was a massive amount of work for something that was DOA. Happy model are also hell bent on continuing to use it and make new hardware with it also as a side note. Maybe they assist with with maintenance of it?

Yeah I agree, the timing was just really not good. We were still quickly changing the OTA as we settled in to what our requirements and functionality needed to be when almost out of nowhere this implementation appears. The code quality is great, and in use it has proven to be stable so there's no complaints at all there. Like you say though, it just came a little early and being a completely different implementation of the ELRS protocol in a major project on a different release schedule, it created some real mayhem.

It is possible finding a manufacturer to sponsor it might attract a developer to it, but I feel like somebody has to want to do it. There's another FC software that supports ELRS SPI (including FLRC) as well but Iiiii can not think of the name of it EDIT: Quicksilver. Their implementation was completely different so maybe whoever wrote that one would be interested in porting it over and maintaining both?

I do agree that we're all sort of scratching our head over who this burden falls to and I'm not exactly helping as I slowly try to back out of the room. I definitely don't think there's any rush on this code though, so as it gets figured out I have no problem at all pushing it back to 4.6 especially in light of JusticeFPV's report for which I have no real idea how to resolve.

@Justicefpv
Copy link

I hope this video makes things clearer. You can see in the OSD that once the battery is connected, the LQ slowly drops to 0 https://youtu.be/9p1hH483Zic

That's really bizarre, but it seems like it loses sync then keeps losing sync more and more until it drops off. I'd bet if you changed to Wide switch mode (which doesn't allow desync) it would drop off instantly, or connect/disconnect over and over.

I only have MPU6000-based FCs (Pancake and CrazyF4) and they do not show this issue so there's something different about that board when the battery is connected. BMI270 interacting with bidir DSHOT somehow in a way that blocks the RX process momentarily? Does it do the same thing if you start with your handset off, plug in the battery, then turn on the handset with F500? Really strange because the code all takes the same amount of time regardless of if the packet was received with LoRa vs FLRC so I can't even wrap my head around why it would work with one and not the other.

After a quick test, the receiver never connects when I turn on the radio after inserting the battery. The only difference I can think of is that the VTX is only powered when the battery is attached, which may have some relevance, as opposed to most AIOs, which power the onboard VTX when USB power is provided. I know he's a busy man, but maybe @SteveCEvans would have a better insight as to what might be happening here?

@nerdCopter
Copy link
Member

nerdCopter commented Jan 13, 2024

b7c091333.
more testing before moving off this firmware; have not been flying lately.
i feel results are inconclusive.

DVR at bottom

BETAFPVF4SX1280 ICM20689, on bench, TX maybe too close.
ELRS 3.3.1 ISM2G4 e051b8

500hz (not D500), TX powered on
pid demon 2 (4k)

# version
# Betaflight / STM32F411 (S411) 4.5.0 Dec  7 2023 / 15:12:04 (b7c091333) MSP API: 1.46
# config rev: 8c646d1
# board: manufacturer_id: BEFH, board_name: BETAFPVF4SX1280

# get pid_process_denom
pid_process_denom = 2
Allowed range: 1 - 16
Default value: 1

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10      19       1    0.0%    0.0%         2     10   2062      13
01 - (         SYSTEM)    970      31       1    3.0%    0.0%       190    641 200058       6
02 - (           GYRO)   8019      39       4   31.2%    3.2%      6142      0 1648745       0
03 - (         FILTER)   4003     102      21   40.8%    8.7%     18426      0 824372       0
04 - (            PID)   4006     146      53   58.4%   21.3%     41952      0 824373       0
05 - (            ACC)    954      43       3    4.1%    0.3%       689    560 197955      26
06 - (       ATTITUDE)     99      57      11    0.5%    0.1%       218     35  20407      33
07 - (             RX)    500      45      21    2.2%    1.0%      7035   1550 305316      18
08 - (         SERIAL)    100  486310       1 4863.1%    0.0%       900      0  20461      10
09 - (       DISPATCH)    990      33       1    3.2%    0.1%       187    663 200321       5
10 - (BATTERY_VOLTAGE)    198      33       2    0.6%    0.0%        96    132  40749      26
12 - ( BATTERY_ALERTS)      5      14       2    0.0%    0.0%         2      4   1032       7
13 - (         BEEPER)    100      30       1    0.3%    0.0%        22     58  20447      26
14 - (      TELEMETRY)    494      31       0    1.5%    0.0%        81    299 101335       6
15 - (            OSD)     12     108      24    0.1%    0.0%      1628    872  87069      55
16 - (     ESC_SENSOR)    100      27       1    0.2%    0.0%        27     64  20441      15
17 - (            CMS)     20      49       2    0.0%    0.0%         8     13   4115      39
18 - (        VTXCTRL)      5      66       0    0.0%    0.0%         2      3   1031      58
20 - (    ADCINTERNAL)      1      10       2    0.0%    0.0%         0      0    207       9
22 - (SPEED_NEGOTIATION)    100      30       1    0.3%    0.0%        31     57  20427      13
RX Check Function                  48       1                       930
Total (excluding SERIAL)                                34.7%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       5       0    0.0%    0.0%         2      2    732       8
01 - (         SYSTEM)    986      30       1    2.9%    0.0%       255    229  71195       5
02 - (           GYRO)   8006      39       3   31.2%    2.8%      8358      0 586615       0
03 - (         FILTER)   4005      99      21   39.6%    8.7%     25020      0 293308       0
04 - (            PID)   4005     146      52   58.4%   20.9%     56880      0 293307       0
05 - (            ACC)    974      38       3    3.7%    0.3%       934    231  70422      26
06 - (       ATTITUDE)     99      52      13    0.5%    0.1%       300     15   7259      41
07 - (             RX)    503      45      23    2.2%    1.1%      9607    426 109020      21
08 - (         SERIAL)    100    2408       1   24.0%    0.0%       915      0   7241      10
09 - (       DISPATCH)    968      29       1    2.8%    0.0%       253    230  71274      24
10 - (BATTERY_VOLTAGE)    199      31       2    0.6%    0.0%       130     45  14490      18
12 - ( BATTERY_ALERTS)      5      26       2    0.0%    0.0%         2      1    366      24
13 - (         BEEPER)    100      28       1    0.2%    0.0%        30      8   7241      26
14 - (      TELEMETRY)    496      27       0    1.3%    0.0%       108    150  36044      12
15 - (            OSD)     12      90      21    0.1%    0.0%      2206    230  30865      50
16 - (     ESC_SENSOR)    100      27       1    0.2%    0.0%        37     22   7237      21
17 - (            CMS)     20      27       4    0.0%    0.0%        10      0   1461      27
18 - (        VTXCTRL)      5       1       1    0.0%    0.0%         2      0    366      55
20 - (    ADCINTERNAL)      1       7       2    0.0%    0.0%         0      0     74       9
22 - (SPEED_NEGOTIATION)    100      31       1    0.3%    0.0%        42     14   7235      14
RX Check Function                  35       1                      1266
Total (excluding SERIAL)                                33.9%

F1000, TX powered on
pid demon 2 (4k)

# version
# Betaflight / STM32F411 (S411) 4.5.0 Dec  7 2023 / 15:12:04 (b7c091333) MSP API: 1.46
# config rev: 8c646d1
# board: manufacturer_id: BEFH, board_name: BETAFPVF4SX1280

# get pid_process_denom
pid_process_denom = 2
Allowed range: 1 - 16
Default value: 1

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       9       0    0.0%    0.0%         1      2    415      21
01 - (         SYSTEM)    967      28       0    2.7%    0.0%       107    213  40280      12
02 - (           GYRO)   8000      41       4   32.8%    3.3%      3598      0 333060       0
03 - (         FILTER)   4002     100      22   40.0%    8.8%     10724      0 166530       0
04 - (            PID)   4005     148      50   59.2%   20.2%     24664      0 166530       0
05 - (            ACC)    949      38       4    3.6%    0.3%       395    131  39557      25
06 - (       ATTITUDE)     98      58      17    0.5%    0.1%       131      8   4064      50
07 - (             RX)    990      43      22    4.2%    2.2%      6328    289 123816      19
08 - (         SERIAL)     99    3330       2   32.9%    0.0%       960      0   4104      27
09 - (       DISPATCH)    986      28       0    2.7%    0.0%       107    156  40269       7
10 - (BATTERY_VOLTAGE)    198      29       2    0.5%    0.0%        54     19   8204      28
12 - ( BATTERY_ALERTS)      5      14       2    0.0%    0.0%         1      0    208      24
13 - (         BEEPER)    100      26       1    0.2%    0.0%        12     12   4104      17
14 - (      TELEMETRY)    488      26       1    1.2%    0.0%        55     84  20191      10
15 - (            OSD)     12      92      24    0.1%    0.0%       959    432  17994      53
16 - (     ESC_SENSOR)     99      27       1    0.2%    0.0%        15     14   4095      20
17 - (            CMS)     20      27       2    0.0%    0.0%         5      3    829      26
18 - (        VTXCTRL)      5      13       0    0.0%    0.0%         3      0    207      62
20 - (    ADCINTERNAL)      1       8       2    0.0%    0.0%         0      0     42       7
22 - (SPEED_NEGOTIATION)     99      26       1    0.2%    0.0%        18     17   4099      23
RX Check Function                  36       1                       660
Total (excluding SERIAL)                                34.9%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10      14       0    0.0%    0.0%         1      3    609      16
01 - (         SYSTEM)    971      28       0    2.7%    0.0%       166    266  58915      13
02 - (           GYRO)   8006      38       4   30.4%    3.6%      5588      0 487703       0
03 - (         FILTER)   4002     101      23   40.4%    9.3%     16555      0 243851       0
04 - (            PID)   4003     142      49   56.8%   19.9%     38218      0 243852       0
05 - (            ACC)    972      32       3    3.1%    0.2%       609    205  58004      30
06 - (       ATTITUDE)     98      70      10    0.6%    0.1%       205      7   6207      48
07 - (             RX)    998      45      24    4.4%    2.3%     10671    767 181311      22
08 - (         SERIAL)    100   20723       1  207.2%    0.0%       993      0   5982      19
09 - (       DISPATCH)    981      28       1    2.7%    0.1%       165    287  59115       5
10 - (BATTERY_VOLTAGE)    198      29       1    0.5%    0.0%        84     59  12016      19
12 - ( BATTERY_ALERTS)      5       9       1    0.0%    0.0%         2      0    304      21
13 - (         BEEPER)     99      28       1    0.2%    0.0%        19     24   5982      25
14 - (      TELEMETRY)    487      26       0    1.2%    0.0%        79    142  29545      19
15 - (            OSD)     12      92      22    0.1%    0.0%      1486    614  26511      49
16 - (     ESC_SENSOR)     99      28       1    0.2%    0.0%        24     16   5979      14
17 - (            CMS)     20      29       2    0.0%    0.0%         7      3   1214      25
18 - (        VTXCTRL)      5      13       1    0.0%    0.0%         3      0    304      60
20 - (    ADCINTERNAL)      1      16       2    0.0%    0.0%         0      1     61      15
22 - (SPEED_NEGOTIATION)     98      31       2    0.3%    0.0%        27     13   5972      30
RX Check Function                  35       1                      1068
Total (excluding SERIAL)                                35.5%

F1000, TX powered on
pid demon 4 (2k)
had unexpected RXLOSS

# version
# Betaflight / STM32F411 (S411) 4.5.0 Dec  7 2023 / 15:12:04 (b7c091333) MSP API: 1.46
# config rev: 8c646d1
# board: manufacturer_id: BEFH, board_name: BETAFPVF4SX1280

# get pid_process_denom
pid_process_denom = 4
Allowed range: 1 - 16
Default value: 1

# status
MCU F411 Clock=108MHz (PLLP-HSE), Vref=3.27V, Core temp=42degC
Stack size: 2048, Stack address: 0x2001fff0
Configuration: CONFIGURED, size: 3371, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked dma
GYRO=ICM20689, ACC=ICM20689
OSD: MAX7456 (30 x 13)
BUILD KEY: 916867c6b84235e97a6d0c89210ee165 (4.5.0-zulu)
System Uptime: 65 seconds, Current Time: 2024-01-13T17:37:30.177+00:00
CPU:18%, cycle time: 125, GYRO rate: 8000, RX rate: 15, System rate: 9
Voltage: 5 * 0.01V (0S battery - NOT PRESENT)
I2C Errors: 0
Arming disable flags: RXLOSS NOPREARM CLI MSP

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10       8       0    0.0%    0.0%         1      5   1601       5
01 - (         SYSTEM)    993       8       1    0.7%    0.0%       139    241 158119       5
02 - (           GYRO)   8006      12       3    9.6%    2.8%      4417      0 1279503       0
03 - (         FILTER)   2002      41      27    8.2%    5.4%      8583      0 319875       0
04 - (            PID)   2002      74      46   14.8%    9.3%     14996      0 319876       0
05 - (            ACC)    991      12       3    1.1%    0.3%       501     32 158060       7
06 - (       ATTITUDE)    100      20      11    0.2%    0.1%       172     10  15962      17
07 - (             RX)     10      42      21    0.0%    0.0%       110     12   5067      23
08 - (         SERIAL)    100  500609       1 5006.0%    0.0%       880      0  15900       6
09 - (       DISPATCH)    995       9       1    0.8%    0.1%       145     57 158134       5
10 - (BATTERY_VOLTAGE)    200      10       1    0.2%    0.0%        68     13  31902       7
12 - ( BATTERY_ALERTS)      5       7       1    0.0%    0.0%         1      3    802       6
13 - (         BEEPER)    100       8       0    0.0%    0.0%        15     18  15899       5
14 - (      TELEMETRY)    498      23       0    1.1%    0.0%        58     88  79118       4
15 - (            OSD)     12      97      21    0.1%    0.0%      1153     83  64843      34
16 - (     ESC_SENSOR)    100       9       1    0.0%    0.0%        20     10  15898       5
17 - (            CMS)     20       9       1    0.0%    0.0%         6      2   3199       5
18 - (        VTXCTRL)      5      95       1    0.0%    0.0%         1      2    802      79
20 - (    ADCINTERNAL)      1       9       2    0.0%    0.0%         0      0    161       8
22 - (SPEED_NEGOTIATION)    100      13       1    0.1%    0.0%        22     19  15898       5
RX Check Function                  15       5                       386
Total (excluding SERIAL)                                18.0%

trying again
F1000, TX powered on
pid demon 4 (2k)

# status
MCU F411 Clock=108MHz (PLLP-HSE), Vref=3.27V, Core temp=45degC
Stack size: 2048, Stack address: 0x2001fff0
Configuration: CONFIGURED, size: 3371, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked dma
GYRO=ICM20689, ACC=ICM20689
OSD: MAX7456 (30 x 13)
BUILD KEY: 916867c6b84235e97a6d0c89210ee165 (4.5.0-zulu)
System Uptime: 27 seconds, Current Time: 2024-01-13T17:41:43.493+00:00
CPU:29%, cycle time: 125, GYRO rate: 8000, RX rate: 1000, System rate: 9
Voltage: 5 * 0.01V (0S battery - NOT PRESENT)
I2C Errors: 0
Arming disable flags: NOPREARM CLI MSP


# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10      19       1    0.0%    0.0%         1     16   1469      17
01 - (         SYSTEM)    991      29       0    2.8%    0.0%       135    629 144028       9
02 - (           GYRO)   8019      49       3   39.2%    3.1%      4706      0 1171796       0
03 - (         FILTER)   2004     112      48   22.4%    9.6%      8910      0 292949       0
04 - (            PID)   2000     147      53   29.4%   10.7%     16961      0 292949       0
05 - (            ACC)    974      42       3    4.0%    0.3%       486    452 143212      29
06 - (       ATTITUDE)     99      57      11    0.5%    0.1%       170     53  14584      43
07 - (             RX)   1003      49      21    4.9%    2.1%      9414   1442 410991      19
08 - (         SERIAL)    100  516645       1 5166.4%    0.0%       909      0  14499      13
09 - (       DISPATCH)    988      49       0    4.8%    0.0%       133    546 144048      10
10 - (BATTERY_VOLTAGE)    199      38       2    0.7%    0.0%        66     99  29165      23
12 - ( BATTERY_ALERTS)      5      20       1    0.0%    0.0%         1      7    735      17
13 - (         BEEPER)    100      26       0    0.2%    0.0%        15     56  14498      17
14 - (      TELEMETRY)    493      29       0    1.4%    0.0%        59    294  72039      11
15 - (            OSD)     12      98      26    0.1%    0.0%      1207   1568  62951      55
16 - (     ESC_SENSOR)    100      28       1    0.2%    0.0%        19     53  14494      10
17 - (            CMS)     20      27       1    0.0%    0.0%         6     18   2933      19
18 - (        VTXCTRL)      5      60       1    0.0%    0.0%         1      3    735      43
20 - (    ADCINTERNAL)      1      17       2    0.0%    0.0%         0      2    148      16
22 - (SPEED_NEGOTIATION)     99      30       1    0.2%    0.0%        22     57  14487      22
RX Check Function                  52       1                       874
Total (excluding SERIAL)                                25.9%

# tasks
Task list             rate/hz  max/us  avg/us maxload avgload  total/ms   late    run reqd/us
00 - (         SYSTEM)     10      13       1    0.0%    0.0%         2      7   1042      11
01 - (         SYSTEM)    972      29       0    2.8%    0.0%       232    457 102267      14
02 - (           GYRO)   8013      41       4   32.8%    3.3%      8112      0 834173       0
03 - (         FILTER)   2000     112      27   22.4%    5.4%     15295      0 208543       0
04 - (            PID)   2002     146      52   29.2%   10.5%     29196      0 208543       0
05 - (            ACC)    946      38       5    3.5%    0.4%       841    322 101663      28
06 - (       ATTITUDE)    100      69      10    0.6%    0.1%       289     14  10346      49
07 - (             RX)   1000      48      21    4.8%    2.1%     16497    950 310083      18
08 - (         SERIAL)    100   11347       2  113.4%    0.0%       940      0  10369      25
09 - (       DISPATCH)    987      31       0    3.0%    0.0%       228    432 102331       5
10 - (BATTERY_VOLTAGE)    199      31       2    0.6%    0.0%       115     57  20702      28
12 - ( BATTERY_ALERTS)      5      27       2    0.0%    0.0%         2      1    521      23
13 - (         BEEPER)    100      28       1    0.2%    0.0%        27     45  10367      12
14 - (      TELEMETRY)    496      28       0    1.3%    0.0%        99    259  51341      10
15 - (            OSD)     12      92      24    0.1%    0.0%      2082   1128  45326      57
16 - (     ESC_SENSOR)    100      28       1    0.2%    0.0%        34     35  10363      17
17 - (            CMS)     20      28       1    0.0%    0.0%        10     11   2081      26
18 - (        VTXCTRL)      5       8       1    0.0%    0.0%         2      0    521      38
20 - (    ADCINTERNAL)      1       9       2    0.0%    0.0%         0      0    104      15
22 - (SPEED_NEGOTIATION)    100      39       1    0.3%    0.0%        39     26  10354       9
RX Check Function                  48       3                      1516
Total (excluding SERIAL)                                21.8%

# status
MCU F411 Clock=108MHz (PLLP-HSE), Vref=3.27V, Core temp=51degC
Stack size: 2048, Stack address: 0x2001fff0
Configuration: CONFIGURED, size: 3371, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked dma
GYRO=ICM20689, ACC=ICM20689
OSD: MAX7456 (30 x 13)
BUILD KEY: 916867c6b84235e97a6d0c89210ee165 (4.5.0-zulu)
System Uptime: 264 seconds, Current Time: 2024-01-13T17:45:40.672+00:00
CPU:27%, cycle time: 125, GYRO rate: 8000, RX rate: 999, System rate: 9
Voltage: 5 * 0.01V (0S battery - NOT PRESENT)
I2C Errors: 0
Arming disable flags: NOPREARM CLI MSP

Flights DVR, stricty F1000:
initially slow to bind/telem.

  1. 4k-pidloop (slow to bind/telem) https://youtu.be/S5Sl2WMHJfg
  2. 2k-pidloop 4 (bind/telem fail until replug) (quicker low voltage on this one, maybe LiPo, unsure) https://youtu.be/dIwaIZ9FJjw

@hydra
Copy link
Contributor

hydra commented Feb 15, 2024

Have any of the maintainers tried this on an SPRacingH7RF which has an H730 CPU running at 520Mhz and using memory mapped flash? @haslinghuis you have one right?

@haslinghuis
Copy link
Member

Yes got a H7RF - but need a new ELRS module - waiting for upgrade [main] board for the TX16S.

@nerdCopter
Copy link
Member

  • please rebase on master (4.6)
  • wondering if the code-improvements and the F1000 should be different PR's. (or maybe they are not disparate enough?)
  • i noticed during testing, that my initial connection was slower on this PR than master. (noticed via the OSD rssi element.)

@CapnBry
Copy link
Contributor Author

CapnBry commented May 13, 2024

  • please rebase on master (4.6)

Done.

  • wondering if the code-improvements and the F1000 should be different PR's. (or maybe they are not disparate enough?)

There's two lines different between supporting F1000 and not supporting F1000. I believe there is no reason to not include it.

  • i noticed during testing, that my initial connection was slower on this PR than master. (noticed via the OSD rssi element.)

Excellent observation, it is slightly slower. An ExpressLRS receiver must check every possible packet rate to wait for an incoming connection since each has different RF parameters and therefore can not receive e.g. a LoRa 500 packet while in FLRC 500 mode. Adding new rates increases the total cycle time. F1000 adds 160ms, F500 adds 320ms and these come first in the rate list so the LoRa modes experience 480ms longer connect times on initial connection. Reconnects after failsafe are not affected by this delay.

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

Successfully merging this pull request may close these issues.

None yet

9 participants