Skip to main content
Stm32User
Associate III
February 13, 2015
Question

Keil and stm32CubeMX generated USB CDC project

  • February 13, 2015
  • 6 replies
  • 1397 views
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 ?
    This topic has been closed for replies.

    6 replies

    mihnea95rusu
    Associate II
    February 27, 2015
    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
    March 2, 2015
    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
    Visitor II
    March 27, 2015
    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 Technical Moderator
    March 30, 2015
    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 "Best Answer" on the reply which solved your issue or answered your question.
    stm32cube-t
    ST Employee
    July 1, 2015
    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
    Visitor II
    July 7, 2015
    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 ..