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

connection: error handling #270

Merged
merged 4 commits into from
Oct 24, 2022

Conversation

maximeborges
Copy link
Contributor

Since we just swapped the two fields, we need to check error instead of status now.

I've been mainly working with the stub since I'm erasing the OTA partition when flashing.
After taking a better look at the error handling there I'm not really sure where the values from RomErrorKind are coming from, since they are neither in the C stub code nor the bootloader and bootloader_support components.

I added the generic errors from the stub. There is other values used in other places in there but they are not under an enum and it would take quite a bit of time to reference all of them for now.

If anyone has any clue where those are coming from, otherwise I'd say that we can remove them at some point.

@maximeborges maximeborges force-pushed the bugfix/connection_error-handling branch from db8d79e to 031fa68 Compare October 24, 2022 17:30
@maximeborges maximeborges changed the title Bugfix/connection error handling connection: error handling Oct 24, 2022
@maximeborges maximeborges marked this pull request as draft October 24, 2022 17:33
@maximeborges
Copy link
Contributor Author

Mmh I'm not able to flash anymore, I'm getting a NotEnoughData at the FlashDeflateEnd step, switching to draft to investigate.

@maximeborges maximeborges marked this pull request as ready for review October 24, 2022 19:29
The `size` field for `Command::FlashDeflateBegin` is the uncompressed size of the segment.
It was rounded up to the memory block size, and the stub was expecting more data when the flash ended,
even though the inflator was returning successfully.
@maximeborges maximeborges force-pushed the bugfix/connection_error-handling branch from a0711aa to 2a987d7 Compare October 24, 2022 19:29
@maximeborges
Copy link
Contributor Author

The size field for Command::FlashDeflateBegin is the uncompressed size of the segment.
It was rounded up to the memory block size, and the stub was expecting more data when the flash ended,
even though the inflator was returning successfully.

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

Thank you for this! Overall it looks good to me.

Sorry but there's just one small typo I'd like to see fixed please 😁

espflash/src/error.rs Outdated Show resolved Hide resolved
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

Thanks for fixing that!

@jessebraham jessebraham merged commit c29b1dd into esp-rs:main Oct 24, 2022
@maximeborges maximeborges deleted the bugfix/connection_error-handling branch October 26, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants