diff --git a/firmware/targets/f5/Src/main.c b/firmware/targets/f5/Src/main.c index 45a6ce36..9cf853d7 100644 --- a/firmware/targets/f5/Src/main.c +++ b/firmware/targets/f5/Src/main.c @@ -27,7 +27,11 @@ int main(void) { // Initialize FURI layer furi_init(); - // Initialize ST HAL hardware + // USB must be initialized as soon as possible + MX_USB_Device_Init(); + FURI_LOG_I("HAL", "USB OK"); + + // Initialise the rest of HAL HAL_Init(); SystemClock_Config(); MX_USART1_UART_Init(); @@ -42,8 +46,6 @@ int main(void) { FURI_LOG_I("HAL", "SPI1 OK"); MX_SPI2_Init(); FURI_LOG_I("HAL", "SPI2 OK"); - MX_USB_Device_Init(); - FURI_LOG_I("HAL", "USB OK"); MX_TIM1_Init(); FURI_LOG_I("HAL", "TIM1 OK"); MX_TIM2_Init(); diff --git a/firmware/targets/f6/Src/main.c b/firmware/targets/f6/Src/main.c index 45a6ce36..ec0fed26 100644 --- a/firmware/targets/f6/Src/main.c +++ b/firmware/targets/f6/Src/main.c @@ -30,6 +30,12 @@ int main(void) { // Initialize ST HAL hardware HAL_Init(); SystemClock_Config(); + + // USB must be initialized as soon as possible + MX_USB_Device_Init(); + FURI_LOG_I("HAL", "USB OK"); + + // Initialise the rest of HAL MX_USART1_UART_Init(); FURI_LOG_I("HAL", "USART OK"); MX_RTC_Init(); @@ -42,8 +48,6 @@ int main(void) { FURI_LOG_I("HAL", "SPI1 OK"); MX_SPI2_Init(); FURI_LOG_I("HAL", "SPI2 OK"); - MX_USB_Device_Init(); - FURI_LOG_I("HAL", "USB OK"); MX_TIM1_Init(); FURI_LOG_I("HAL", "TIM1 OK"); MX_TIM2_Init();