Browse Source

Prevent USB peripheral fault when restarting USB on WB32 MCUs (#18058)

Co-authored-by: Joy <chang.li@westberrytech.com>
Joy Lee 2 years ago
parent
commit
b5a52b4cff

+ 4 - 0
platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c

@@ -80,3 +80,7 @@ void __early_init(void) {
 void boardInit(void) {
 
 }
+
+void restart_usb_driver(USBDriver *usbp) {
+  // Do nothing. Restarting the USB driver on these boards breaks it.
+}

+ 4 - 0
platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c

@@ -80,3 +80,7 @@ void __early_init(void) {
 void boardInit(void) {
 
 }
+
+void restart_usb_driver(USBDriver *usbp) {
+  // Do nothing. Restarting the USB driver on these boards breaks it.
+}

+ 2 - 0
platforms/chibios/boards/GENERIC_WB32_FQ95XX/configs/config.h

@@ -18,3 +18,5 @@
 #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
 #    define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
 #endif
+
+#define USB_ENDPOINTS_ARE_REORDERABLE