This repository was archived by the owner on Mar 26, 2026. It is now read-only.
fix potential race condition in boot-cypress#19
Closed
purdeaandrei wants to merge 1 commit into
Closed
Conversation
6070c58 to
be6013d
Compare
Member
|
You should be able to easily test the change with a Glasgow, since for the purpose of the bootloader it's just like any other devboard with a 2-address-byte EEPROM. Sounds good? |
Contributor
Author
|
Closing this, since the fix is now included in PR 18. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR depends on PR #18
IMPORTANT: I have not tested this change,
Note that I have tested similar changes in glasgow firmware, with success (will send a PR for that soon).
Note that this also potentially fixes any errors going unnoticed.
If we set HSNAK when we arm the buffer, the host will complete its status stage as soon as it sends the data stage, and will not wait for
eeprom_writeto finish. TheSTALL_EP0()call that we execute on line 154, will not have an effect, because the following setup packet will clear it (this is how the FX2 works), so this error would go undetected by the host!Note that this change should still be tested before being merged, because before this change,
the firmware was not sensitive to potential spurious errors returned by eeprom_write.
If
eeprom_writehad a spurious errors problem, then this PR could introduce a regression,so I suggest not merging this PR without testing it first.
Note that
STALL_EP0()already setsHSNAK, so it's not necessary to callACK_EP0();on failure.