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

dfu: Allow DFU coexistence with other interfaces (BTH, RNDIS, future one) #1597

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

kasjer
Copy link
Collaborator

@kasjer kasjer commented Aug 9, 2022

Describe the PR
dfu_moded_open() only works correct when its called on DFU interface
descriptor. It means that DFU is the only one interface in configuration
or driver is called after all others interface drivers were tried and
gave up.

If other interface is supported and but driver for DFU is called first
(this is the case for BTH and RNDIS).
Code after while loop (that was not entered) has an TU_ASSERT that will
make set_configuration to fail.

Now TU_VERIFY is called first to make sure open code is called for DFU
only and not other interface descriptors like in other drivers.

Additional context

dfu_moded_open() only works correct when its called on DFU interface
descriptor. It means that DFU is the only one interface in configuration
or driver is called after all others interface drivers were tried and
gave up.

If other interface is supported and but driver for DFU is called first
(this is the case for BTH and RNDIS).
Code after while loop (that was not entered) has an TU_ASSERT that will
make set_configuration to fail.

Now TU_VERIFY is called first to make sure open code is called for DFU
only and not other interface descriptors like in other drivers.
Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

spot-on, thank you for your PR.

@hathach
Copy link
Owner

hathach commented Aug 10, 2022

ci with rp2040 failed seem to be caused by changes in pico-sdk and have nothing with this PR. will merge and check/fix later as separate PR if needed

@hathach hathach merged commit 8a28e7c into hathach:master Aug 10, 2022
@kasjer kasjer deleted the kasjer/dfu-coexistence branch August 10, 2022 11:20
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