cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 USB CDC Class from CubeMX

mihnea95rusu
Associate II
Posted on February 18, 2015 at 14:44

Hey all,

I'm trying to implement a USB CDC device on an STM32F072B-Discovery (uses the STM32F072RBT6 device) to simply send some values over to the serial console.

I've not had much luck with this using the code generated by STM32CubeMX. The initialisation is successful and the device correctly enumerates as CDC, however the moment I try to send some data using either CDC_Transmit_FS (inside of usb_cdc_if.c) or the combination of USBD_CDC_SetTxBuffer + USBD_CDC_TransmitPacket (inside of usbd_cdc.c), it neither sends the data nor enumerates as a USB device anymore.

In order to try to isolate this (to me, apparent bug) I've commented out functions one by one and found that when I just call USBD_CDC_TransmitPacket WITHOUT calling USBD_CDC_SetTxBuffer or USBD_CDC_SetRxBuffer a priori, it still enumerates correctly. The problem must therefore be with the Tx/Rx Buffer functions...

I would be very happy if someone could provide some insight into this!

Thanks in advance.

#cdc #vcp #stm32f0 #usb #stm32
0 REPLIES 0