-
-
Notifications
You must be signed in to change notification settings - Fork 446
fix(pa01): SD storage hangs after copy a large file #6783
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
Conversation
|
@richardclli I have tested this PR on my V16, and it fixed the complete hang, and it was able to come back to live! (have tried at least 10x...) However, it seems like after the first boot, it takes very long to show the screen after disconnecting the USB cable. Additionally, while the copy job was active, I have seen a lot of Let me know if I can help further somehow. |
|
|
|
@pfeerick This is what I think as well. There is no point to have RF still active when the radio is in USB storage mode. Current implementation will call edgeTxClose() before entering USB storage mode and call edgeTxResume() when leaving. And the RF is only shutdown when it is going to shutdown. I think this need to be reviewed and fill in all need to be stopped and resumed properly. I bet there are still something missing. |
There may or may not be an open issue about that... I know it was a discussion we had before, and I thought Phil (the other Phil ;) ) opened an issue about it, but can't readily place a finger on it right now. Would have been something along the lines of how shutdown or optional inactivity power off works... i.e. if RF link/trainer link/etc active, and you try to enter storage mode, it should warn that the RF link is going to be cut, do you want to continue, blah blah blah. |
|
@3djc Would you mind kicking the tyres on this one also. It seems ok to me on V16, TProv2, PA01 and GX12. edit: I take back the GX12 ... it just finished a large file transfer, and all shoulder switches, and customisable switches are unresponsive... trims and main UI buttons still work fine. 🤔 edit2: gx12 repeatable with nightly... I just copied the entire sounds folder from radio (has both cn and en folders still, so about 35MB of files), and then back onto it again, overwriting existing files, and it lost sholder and customisable switches again), so probably unrelated to this PR ;) |
|
Well, per10ms() is simply ignored when connected, which does affect much more than just keys polling. Unsure where/when it will bite back. A proper fix would be to redesign our handling of the USB storage connection |
|
If we do that, we should do it for all radio that use PCA95xx. Let me know if I need to add some of those radio |
|
Yeah, it fixes a few other little things, so please do.
…On Wed, 26 Nov 2025, 5:50 pm 3djc, ***@***.***> wrote:
*3djc* left a comment (EdgeTX/edgetx#6783)
<#6783 (comment)>
If we do that, we should do it for all radio that use PCA95xx. Let me know
if I need to add some of those radio
—
Reply to this email directly, view it on GitHub
<#6783 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ66KLLHSC3JPDG2CLLKSL36VLTXAVCNFSM6AAAAACLXJKSU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZZHEYDOMRYG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Did copy a 105Mb file on GX12, got back switches on USB unplug |
|
The key problem is I2C HAL driver need proper timing to works properly. I have search quite a lot of information about STM32 I2C support. They are forced to make hardware a bit strange to avoid the patent infringement, and need proper software timing to make the communication stable. And USB access will disrupt the timing of the I2C communication, so after using USB, the I2C will just fail and because the timer task is higher priority than the UI task, the timer task just take up all MCU time and prohibit the GI task from running in PA01. And I did know why the I2C failure will cost all MCU time in the timer task, but it is the fact. |
So it fixes GX12 as well. |
|
The per10ms() did a lot of things, and actually nothing cause problems except I2C related device access, so it will be more precise to stop I2C related pollings instead of stopping the whole per10ms(), let me see if I can make it work. Current implementation may affect some timestamp related functionalities. |
I added support for it in this PR yes |
|
Build error..... because of the bootloader. This let me remember that this problem affect the bootloader of PA01 as well, it will hangs the bootloader after using SD storage to transfer a large file. Need more work to see how to make this better. Give me a few more days. |
|
No problem. Lets push this to 2.11.5 then, so I can close off 2.11.4 |
5b6c3dc to
24360b6
Compare
Already done, will make you a 2.11 version |
|
@richardclli Could you share a uf2 with this fix? :) |
|
Have a look under the "Checks" tab at the top... all PRs are automatically built ;) |
Awesome - thanks. This looks to fix the issue for me with USB hanging on PA01. |
|
Fantastic! Thanks for testing! 😍
…On Wed, 3 Dec 2025, 5:20 am jlpoltrack, ***@***.***> wrote:
*jlpoltrack* left a comment (EdgeTX/edgetx#6783)
<#6783 (comment)>
Have a look under the "Checks" tab at the top... all PRs are automatically
built ;)
Awesome - thanks. This looks to fix the issue for me with USB hanging on
PA01.
—
Reply to this email directly, view it on GitHub
<#6783 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ66KN4DA3Z5GY6FVD2ZDT37XRBPAVCNFSM6AAAAACLXJKSU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMBTGYYTKMZWGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Thank you. It fixes problem on HelloRadio V16. It was bothering me for quite some time |
|
I've done repeat test on GX12, switches are good me also! :) |
Co-authored-by: 3djc <[email protected]>
Fixes #6670
May work better than #6748
Summary of changes: