Skip to content

Commit 28c4665

Browse files
committed
Chibios: Fix a HardFault bug (wait after start).
1 parent 30cac1d commit 28c4665

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

protocol/chibios/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ int main(void) {
101101
while(USB_DRIVER.state != USB_ACTIVE)
102102
chThdSleepMilliseconds(50);
103103

104+
/* Do need to wait here!
105+
* Otherwise the next print might start a transfer on console EP
106+
* before the USB is completely ready, which sometimes causes
107+
* HardFaults.
108+
*/
109+
chThdSleepMilliseconds(50);
110+
104111
print("USB configured.\n");
105112

106113
/* init TMK modules */

0 commit comments

Comments
 (0)