cancel
Showing results for 
Search instead for 
Did you mean: 

Keil and stm32CubeMX generated USB CDC project

Stm32User
Associate II
Posted on February 13, 2015 at 17:40

I generated a USB CDC driver using Cube MX for the STM32L0538 DISCO. This compiled and linked and connected to a PC.

I tried to send some bytes using CDC_Transmit() but I then get USB NOT RECOGNIZED.Seems to be a hardfault in the call to USBD_CDC_SetTxBuffer()

Any ideas ?

Can anyone offer any guidance on how to use these function or an example to crib ?
6 REPLIES 6
mihnea95rusu
Associate II
Posted on February 27, 2015 at 04:40

Hey,

I have the same problem, just on an STM32F072 Discovery board instead. Have you found a fix yet? I've contacted ST support about this, I'll post on here as soon as they respond.
mihnea95rusu
Associate II
Posted on March 02, 2015 at 15:24

ST responded. They directed me to

http://www.emcu.it/STM32Cube/STM32Cube.html

 . I still can't figure out how to do it... If anyone has implemented the CDC class on an STM32F0, please tell us how you did it!
edward
Associate
Posted on March 27, 2015 at 09:11

Did you figure out what the problem was? I'm on a STM32L053C8 Discovery board and I have exactly the same problem - usb code generated by CubeMX doesn't work, albeit the example applications from the Cube package do.

Amel NASRI
ST Employee
Posted on March 30, 2015 at 10:46

Did you increased the stack size (Ex: 0x2000)?

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

stm32cube-t
Senior III
Posted on July 01, 2015 at 11:45

Fixed in MX 4.7

The issue was PB0,PB1, PA2,PA3,PA6,PA7 not configured properly.

mahesh
Associate
Posted on July 07, 2015 at 07:15

Hi all,

I have created  code  using CUBEMX for stm32 L0.I am able to send and receive data only one time but multiple time receive and sending is not happening . what may be the issue ..