Skip to main content
gbm
Lead III
June 11, 2018
Question

CubeMX 4.26 - new problems with STM32L4 USB device

  • June 11, 2018
  • 6 replies
  • 1718 views
Posted on June 11, 2018 at 16:58

I tried to re-create my 4 well-tested USB device demos with 4.26. While HID mouse and MSC work flawlessly, two others do not work:

CDC - COM port shows in device manager but cannot be opened in terminal; same basic code (just a simple echo) works ok with 4.25.1 and 4.24 (broken PLL programming in 4.25).

HID keyboard - no data received.

I noticed that 'custom HID' used for keyboard was heavily changed in 4.26, and the changes ar not good - DataIn callback was removed - bad

:(

.
    This topic has been closed for replies.

    6 replies

    Sven Köhler
    Associate III
    June 12, 2018
    Posted on June 12, 2018 at 03:33

    Shouldn't you also mention the version of the STM32L4 package that you use? After all, you can use STM32CubeMX with various version of the STM32L4 package.

    I have a project using STM32L4 1.8.1: USB works on Windows and Linux (kind of, data ist lost here and there)

    I have a project using STM32L4 1.12.0: USB works on Linux but not Windows 

    STM32CubeMX 4.26.0 gets stuck on generating code on Windows while it works fine on Linux.

    I can't downgrade cause I don't find old version for download.

    Khouloud GARSI
    Technical Moderator
    June 12, 2018
    Posted on June 12, 2018 at 10:33

    Hello,

    Mazur.Grzegorz

    ‌, thanks for your feedback. This is now under check. We will update you ASAP.

    sven.koehler

    ‌, with the current version of STM32CubeMX version , the STM32L4 Cube package V1.0 should be used. This is mentioned in the

    http://www.st.com/content/ccc/resource/technical/document/release_note/b2/02/4b/e3/81/32/49/c4/DM001076pdf/files/DM001076pdf/jcr:content/translations/en.DM001076pdf

    .

    Khouloud.

    Sven Köhler
    Associate III
    June 12, 2018
    Posted on June 12, 2018 at 14:05

    So I shouldn't use 

    STM32L4 

    1.8.1 with recent CubeMX? You cannot expect me to upgrade all my projects, especially since there are bugs with the most recent version of 

    STM32L4

    . Do I have to keep multiple versions of CubeMX? Will using recent CubeMX together with old 

    STM32L4 package versions result in broken code?

    Khouloud GARSI
    Technical Moderator
    June 13, 2018
    Posted on June 13, 2018 at 12:00

    Hi

    sven.koehler

    ‌,

    The current version of CubeMX is compatible with firmware package L4 V1.0. Using an old firmware version with a recent version of the tool may cause incompatibility issues.

    especially since there are bugs with the most recent version of

    STM32L4

    .

    -> Could you please precise the bugs you're seeing. We will check them and correct them if confirmed.

    Khouloud.

    taraben
    Associate III
    July 12, 2018
    Posted on July 12, 2018 at 19:48

    Hello,

    what is the workaround to this problem?

    I upgraded a project to recent CubeMX 4.26 and L4-1.12 and now it shows that symptom.

    USB COM port visible in Windows but not connectable.

    I can reproduce this on an NUCLEO -L476RG.

    connecting DP to A12, DM to A11, GND to GND.

    So sad.

    Any hints on this?

    Regards, Adib.

    taraben
    Associate III
    July 12, 2018
    Posted on July 12, 2018 at 20:05

    I found that for my NUCLEO L476RG board it helps to 'downgrade' to L4-1.11 library version.

    I can do that by manually edit the .ioc file.

    I will test with my other application.

    Please ST: fix this problem. Also it would be very helpfull you provide a list with known problems of the current version.

    regards, Adib.

    Jerome Godbout
    Associate II
    September 13, 2018

    I have the same issue with 1.12, I move from 1.8 to 1.12 and my usb composite (CDC Virtual COM and HID) are showing all kind of weird behavior (long hang when doing descriptor fetch with USB Tree View or when opening the COM port under TeraTerm, bad descriptor most of the time, sometime it work but most of the time it failed, but the firmware did answer the descriptor and the data seem valid). 1.12 seem riddle with bug on my end, same descriptors byte array and same application. I was trying to update to see if one of the bug we see was fix, but it did bring more bug then it solves so far. It make our device unusable.

    If anybody have a stable version, would be nice to know which one is, thanks. I will try 1.11 to see if it does work properly.

    BTW, my bug under 1.8 was the hid report I ask to send a single byte, but once in a while (every 8 minutes or so) it send a 5 byte report even if application layer asked for a single bytes (made a runtime assert of this without problem). The faulty packet was observed with a hardware USB tracer.

    Jerome Godbout
    Associate II
    September 13, 2018

    Just to confirm, 1.11.0 is working fine on my side too. Thanks for th tips. 1.12.0 is breaking everything over here!

    Pavel A.
    Super User
    September 13, 2018

    <quiote> but once in a while (every 8 minutes or so) it send a 5 byte report even if application layer asked for a single bytes (made a runtime assert of this without problem). The faulty packet was observed with a hardware USB tracer.</quote>

    Jerome, can you post a piece of the USB trace with this error, please?

    And what is your HID device: something shrink wrapped or self-made?

    What is its endpoint max. packet size and report size?

    I have a similar problem, but with F4. Pondering if this can be caused by Cube or libraries version.

    Thanks,

    -- pa