Description
Describe the bug
Windows 10 reports a transfer error after writing the last block. Similar to #46. The transfer is successful.
Set up (please complete the following information)
- Board: Nordic PCA10100
- OS: Windows 10 1903
- N/A
To Reproduce
Steps to reproduce the behavior:
- Enter bootloader
- Copy file
Expected behavior
It shouldn't print an error after copying.
Additional context
This is, admittedly, an extremely hacked-down version of this bootloader located at https://github.com/simmel-project/bootloader. One difference is that we have LTO enabled (-flto
) which caused issues with the vector table generation and weak symbols. Symbols such as SVC_Handler
were getting stuck as their infinite-loop variants rather than getting overridden.
Having said that, everything appears to work just fine, it's just that Windows is doing something like queueing multiple LUNs, and the bootloader looks like it's rebooting after only one LUN is acknowledged.
The workaround I've made in simmel-project/bootloader@037d350 fixes the problem, but doesn't feel right, during board teardown just before USB is disconnected:
unsigned int i;
for (i = 0; i < 100; i++) {
tud_task();
NRFX_DELAY_MS(1);
}