Fixing enumeration when rebooting into the program from bootloader #91
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.
Boards that doesn't have a dedicated DPU pin, can't properly re-enumerate from
b003
tod003
after rebooting from bootloader. To fix this we need to pull down D- pin for a short period of time. To make this hassle free to the end user, I implemented it in the bootloader code plus corresponding changes to minichlink. This requires extra space, but it fits.If you are still using dedicated DPU pin, only changes will be the extra 4 bytes used by the updated linker script.
Also fixed added one missing line to the soft reboot into bootloader function. Without it bootloader was booting straight into user code.
The last commit ensures that resulted bin will always be
1920
bytes, so we always rewrite whole boot partition and no junk could be left in the end of it from previous bootloader. This is somewhat important, because with updated minichlink we are looking into last 4 bytes of the partition. And in some edge cases we could see unwanted behavior.