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

Improved Monitor&WD handling in DeviceBootloader #922

Merged
merged 5 commits into from
Dec 11, 2023

Conversation

themarpe
Copy link
Collaborator

@themarpe themarpe commented Nov 9, 2023

Fixes a rare case of infinite wait time upon creation of Device (or DeviceBootloader), if a device had an connectivity/booting issue

Diff is rather large due to the main "try catch" block adding identation, but it boils down to spinning up the Monitor&WD combo between each BL interaction, not just upon connecting to the main BL.

Bug was easily reproducible by placing a 5s sleep between:

          // Device already in bootloader mode.
            // Connect without booting
            connection = std::make_shared<XLinkConnection>(deviceInfo, X_LINK_BOOTLOADER);

            // If type is specified, try to boot into that BL type
            stream = std::make_unique<XLinkStream>(connection, bootloader::XLINK_CHANNEL_BOOTLOADER, bootloader::XLINK_STREAM_MAX_SIZE);

// <-- add 5s sleep

            // Retrieve bootloader version
            version = requestVersion();

Then boot device, wait for sleep section and disconnect before "requestVersion".

Affected mostly ETH based devices

@moratom moratom merged commit 7930da4 into develop Dec 11, 2023
27 of 31 checks passed
@moratom moratom deleted the device_bl_init_lock_bugfix branch December 11, 2023 19:49
This was referenced Dec 13, 2023
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.

None yet

3 participants