Skip to main content
Visitor II
December 26, 2023
Solved

STM32U575 : simple USB VCP UART

  • December 26, 2023
  • 2 replies
  • 7380 views

I have my own little board: with STM32U575CIT6Q (LQFP48 package). The USB is very simple and just DM (PA11) and DP (PA12) are connected. No USB-C, no USB-C Power Detector neither external chips for USB-C (as on NUCLEO-Board for USB-C-power).

I want to bring-up a simple USB VCP (CDC) UART, in FS mode. But all the code (generated by CubeMX) and example codes in CubeMX drivers/demo/application download does not work:

a) I do NOT want to use USB-C stuff, assuming "UCPD", e.g. MX_UCPD1_Init(); means "USB-C Power Detection"! There is not anay USB-C power detection, unit etc.
b) biggest problem: when code enters call: CHECK_CAD_FUNCTION_CALL in file "usbpd_pdm_core.c" - my external debugger (ST-Link2 via SWD pins (PA13 = SWDIO, PA14 = SWCLK) is disconnected (debugger in GUI is lost).

This function CHECK_CAD_FUNCTION_CALL comes from a pre-compiled LIB "USBPDCORE_NOPD_CM33_wc32.a" - what is it doing?

==> how to create a simple USB FS VCP UART with STM32U575 chip? (w/o any USB-C stuff)

Unfortuantely,
the simple ST Middleware with USB Device is gone. All is now ThreadX, USBX based (OK, I can go with a "new" RTOS", FreeRTOS/CMSIS_RTOS seems to be gone).

But why is it so complicated to generate a FW for my own board? (NUCLEO boards are working fine, but designing your own board and bring up a FW for it is much harder now).

 

    This topic has been closed for replies.
    Best answer by tjaekel

    I have one PCB now working (details below).

    On chips with VDDIO2 (my LQFP64 package does not have) - some GPIOs can be driven with 1.8V (even MCU is on 3.3V), but not all. Pretty cool feature (I like it),
    Unfortunately, not the QSPI signals are on VDDIO2.
    So, I had to run entire MCU with 1.8V in order to get all my needed GPIO signals as 1.8V logic (e.g. also I2C, some GPIOs).
    Never mind.

    1.8V VDD:
    One board is now working!

    The change I did:
    there is a (deblocking) cap on VDDSMPS: it was 1 microF or 0.1 microF before - NOT 10 microF. Changing it to 10 microF (and cap is very close to pin) - seems to be the root cause.

    I had also an external pull-up on nRST (as 10K) - now as DNI (because I saw: nRST has an internal pull-up already, but I guess this was not the cause).

    I can confirm as:

    If VDD drops below 1.796V (with external PSU) - USB does not work anymore.

    Ext. OSC still OK, SMPS seems to be OK, even with lower voltage (both are still oscillating). But MCU does not come up on USB with VDD "too low" (even still in spec. range).

    No idea what happened: the same external LDOs ICs I tried before (for fix 1.8V) show me now 1.801V - and it works.
    I got impression: when VDD is too low, the board draws more current and the voltage on VDD drops (I have used the current limiter on external PSU).

    Never mind: works now entire MCU as 1.8V (on one board).

    QSPI_MCU_1_8V.jpg

    Best regards,
    Torsten

    2 replies

    Graduate
    December 26, 2023

    Do it exactly as you would with any other STM32 chip or board. UCPD is not related to USB device other than by sharing the connector. Do not configure/enable UCPD, just do the USB device CDC VCP stuff.

    tjaekelAuthor
    Visitor II
    December 26, 2023

    Than you. Yes: I am thinking to take the ST USB Middleware (stack) from another project and merge it to this MCU. Let's see.

    tjaekelAuthor
    Visitor II
    December 30, 2023

    Thank you for your great hints, very helpful.
    After I have studied several repositories and projects - I went with my USB VCP working on another board
    (Portenta H7, based on a STM32H7xx). Was a bit easier (and the same USB FS stack works).

    It was easier to "merge" the old Middlewares/ST/STM32_USB_Device_Library into my new project.
    -- IT WORKS --

    Great,
    now I have USB VCP working on my own PCB, with a STM32U575CIT6Q chip.
    And I have my QSPI tester working (I need QSPI as interface for external chips). It works.

    Here my board:

    QSPI_MCU_U757.jpg

    Just strange:

    It works only if I configure UART1, I have to do (otherwise USB does not work, even not using UART1 yet):

    #if 1

    /* XXXX: why is it necessary to get UART VCP working??? */

    MX_USART1_UART_Init();

    #endif

     

    Super User
    December 30, 2023

    :thumbs_up:

    +

    If you dont want to be forced to use ThreadX (like me), look also here :

     

    https://github.com/STMicroelectronics/stm32h5-classic-coremw-apps

    STM32H5 Classic Core Middleware

    • ST's proprietary stacks: ST USB Device and ST USB Host
    • Third parties' stacks: FreeRTOS, FatFS, and LwIP