-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix image upload hanging when MTU is increased #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good! The offset is sent as well, so Zephyr probably drops the packet as well, if there is a race condition, and it would probably also help with USB communication problems when something gets stuck. Just a few minor comments. Will have time to test it tomorrow, then I can merge it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it and it work.
@Frank-Buss I tried it with the approach in #8 and it still hangs for me. Here is a truncated verbose output where I replaced lots of it with ... to eliminate a lot of the data
This is with our production bootloader on the target, which presumably has the CDC ACM driver bugfix in place. |
Yes, our production bootloader has the patch and the larger buffer sizes. So looks like #8 is another problem and we can't close it with this PR. But nevertheless this PR looks useful for lost packages and it helps the author of the PR, so maybe check if it still works on your side with the default sizes for line length and MTU, and then you can merge it. |
PS: the bootloader needs like 20 s to erase the flash before writing the first block. Also it should fail after 60 s, and not hang indefinitely. |
Yes, this PR works fine for me with |
Description
When working with Zephyr OS i came across a similar issue as discussed in #8.
I did some investigation and found that the client was waiting indefinitly for a response from the mcu, on the chunk start markers.
I'm assuming the mcu did not receive a valid frame and dropped it without sending an answer.
Changes
Lowered the read timeout and added a retry to send the unanswerd data chuncks again.
I was able to upload an image through uart at 921600b | MTU 1024 | line len 8192.