Commit 2b2ae66
committed
pbio/drv/usb_ev3: fix USB not working after firmware update
Fix the USB being in a bad state after a firmware update.
The firmware updater uses the USB to transfer the new firmware and then
jumps to the new firmware without resetting the USB controller. Calling
USBReset() was not enough to reset the USB controller. Even after this
we would never get any interrupts, so requests from a host would time
out. This is fixed by using the PSC to reset the USB controller instead
of USBReset().
Also, before we reset things, we need to tell the host to disconnect
from the firmware update USB device. When we reconfigure things the EV3
will appear as a completely different USB device.
Fixes: pybricks/support#22951 parent 43f7da7 commit 2b2ae66
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
816 | 823 | | |
817 | 824 | | |
818 | 825 | | |
819 | 826 | | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | 827 | | |
825 | 828 | | |
826 | 829 | | |
| |||
0 commit comments