libopencm3-examples icon indicating copy to clipboard operation
libopencm3-examples copied to clipboard

usb_cdcacm example on STM32F303RD not working

Open arendwierks opened this issue 3 years ago • 2 comments

If I upload the code to my STM32F303RDT6 board the USB is not working. Windows returns an error, and the usb device is not recognized in device manager. When I create a project via STM32Cube IDE the usb cdc works fine, so I believe something is wrong/missing in this driver.

arendwierks avatar Jan 26 '21 15:01 arendwierks

The STM32 F3 series uses two different memory organizations for USB buffers. For this series, libopencm3 only supports one of them, and it's not the one used in your MCU. So I'm afraid the USB stack does not work on your board.

Also see this comment: https://github.com/libopencm3/libopencm3/blob/master/include/libopencm3/stm32/common/st_usbfs_v1.h#L26

The mentioned MCUs use an implementation that is more or less the st_usbfs_v2 implementation. However, the current libopencm3 always uses the st_usbfs_v1 implementation for the F3 series.

If you want to modify the library, have a look at issue https://github.com/libopencm3/libopencm3/issues/841.

manuelbl avatar Jan 26 '21 18:01 manuelbl

Hi Manuel, Thanks for the help, I didn't find Gussy's issue yesterday, but I will try that.

arendwierks avatar Jan 27 '21 08:01 arendwierks