lynxis lazus has uploaded this change for review.

View Change

dfu: MANIFEST: mainloop: wait 5 ms before handling the state

Gives the USB stack some time to deliver the last USB message before
going through the state machine which might end in a too quick system reset.

Change-Id: If9178120eed46f75089abf1898db3176cce93df2
---
M usb_start.c
1 file changed, 3 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/77/42177/1
diff --git a/usb_start.c b/usb_start.c
index 7b164a0..185cd28 100644
--- a/usb_start.c
+++ b/usb_start.c
@@ -199,6 +199,9 @@
case USB_DFU_STATE_DFU_MANIFEST: // we can start manifestation (finish flashing)
// in theory every DFU files should have a suffix to with a CRC to check the data
// in practice most downloaded files are just the raw binary with DFU suffix
+ /* give the previous GET STATUS packet some time to arrive, because otherwise
+ the board might go into reset to fast through MANIFEST_WAIT_RESET */
+ delay_ms(5);
CRITICAL_SECTION_ENTER();
dfu_manifestation_complete = true; // we completed flashing and all checks
if (usb_dfu_func_desc->bmAttributes & USB_DFU_ATTRIBUTES_MANIFEST_TOLERANT) {

To view, visit change 42177. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-Change-Id: If9178120eed46f75089abf1898db3176cce93df2
Gerrit-Change-Number: 42177
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>