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

Move uart writes from ISR on STM32 #1874

Merged
merged 1 commit into from Oct 18, 2022

Conversation

alteman
Copy link
Contributor

@alteman alteman commented Oct 11, 2022

EDIT: related issue #1873

OK, here's a draft PR - I'm still testing, so at this point unsure if the issue is actually fixed.

The alternative workaround is increasing Arduino tx buffer to 128 bytes using -DSERIAL_TX_BUFFER_SIZE=128

@alteman
Copy link
Contributor Author

alteman commented Oct 11, 2022

Testing in progress; test script should get to 1000 RX power cycles in about a week. It powers the receiver for 5-10 minutes (random) then powers off, waits 30-60 seconds and repeats. Serial activity is monitored and logged; serial data timeout is 10 seconds; no data for 10 seconds marks the attempt as a failure.

@alteman
Copy link
Contributor Author

alteman commented Oct 12, 2022

Preliminary test results:
With old firmware (3.0.0 tag) I got 6 failsafes out of 32 test runs (didn't seem to make sense to run it for much longer).
test_log_3.0.0.txt

On this PR branch I got 0 errors out of 100 test runs; so far so good.
test_log_PR.txt

Fun fact: I had to switch to R9M TX module because Happymodel ES900TX doesn't have external power and TX16S battery was discharging even when connected to a USB charger putting out 11W (5V 2.1A).

@robustini
Copy link

robustini commented Oct 13, 2022

Finally maybe someone has found where the problem was, I'm testing now, I'll update you, thank you very much for now.
If you read my comments in the issue you will find that I had reported that it could have been a buffer saturation problem or something like that, I shot it at random but maybe I had caught it.

@robustini
Copy link

robustini commented Oct 13, 2022

After 5 hours of testing no problems found, normally no one has ever exceeded 3 hours without a firmware lock, sometimes even after few minutes.
So this fix looks very promising (my ten R9Mini are happy)!

@robustini
Copy link

Made about ten FPV flights, never a problem, when before at least once out of three the rx stopped working.
In my opinion this draft can be switched to PR. excellent hunting, thanks again!

@alteman alteman marked this pull request as ready for review October 14, 2022 11:32
@alteman
Copy link
Contributor Author

alteman commented Oct 14, 2022

No errors after 400 test cycles, I think it's ready for merging :)

Copy link
Collaborator

@pkendall64 pkendall64 left a comment

Choose a reason for hiding this comment

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

Nice catch @alteman

@JyeSmith
Copy link
Member

Should this be targeting the v3 maintenance branch and we can get it in the 3.0.1 release?

@pkendall64
Copy link
Collaborator

Should this be targeting the v3 maintenance branch and we can get it in the 3.0.1 release?

I think that would be a very sensible idea!

@alteman alteman changed the base branch from master to 3.x.x-maintenance October 18, 2022 07:45
@robustini
Copy link

robustini commented Oct 18, 2022

Should this be targeting the v3 maintenance branch and we can get it in the 3.0.1 release?

If there are no other things immediately to enter 3.0.1 should be released because this problem is not irrelevant imho.
Those who own R9MM or R9Mini may have serious problems with 3.0, the update should be done before unexpected crashes.
Or simply a warning not to use 3.0 with the rx ones, even if many have already understood this at their own expense.

@JyeSmith JyeSmith merged commit 2470fce into ExpressLRS:3.x.x-maintenance Oct 18, 2022
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

4 participants