danieleff / STM32GENERIC

Generic implementation of Arduino for STM32 boards
https://danieleff.github.io/STM32GENERIC/
116 stars 88 forks source link

USB doesnt work for STM32F3xx #52

Open Hoel opened 6 years ago

Hoel commented 6 years ago

Hi, i made a target folder for STM32F303CCT6 based on the indications so using a USB VCP STM32CubeMx project, in variant.c i used the clock configuration from the STM32CubeMX project, i also added usbd_conf_F3.c in the core USB folder (taken from the working STM32CubeMX project).

When i test with blink example If i set USB : Serial (Virtual COM port) the board stalls at runtime, if i set USB : disabled, it blinks as it should, what could be the problem? variant.c.zip usbd_conf_F3.c.zip

arpruss commented 6 years ago

I got it working here: https://github.com/arpruss/STM32GENERIC The trick was to drop in the usbd_conf_F3.c file and add this to the USBDevice.cpp:

//F3 extern "C" void USB_LP_CAN_RX0_IRQHandler(void) { HAL_PCD_IRQHandler(&hpcd_USB_FS); }