cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575 : simple USB VCP UART

tjaekel
Lead

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).

 

17 REPLIES 17

Happy New Year !

+ with 64 pin case 🙂

 

Just - if you anyway make a pcb and want test QSPI - why not put a connected so8 beside the cpu ?

Hi speed signals to a free air wired QSPI chip might produce more funny signals for the scope, but less reliable function.

If you feel a post has answered your question, please click "Accept as Solution".

Happy New Year !

FYI,
I do NOT want to test the OCTASPI (QSPI) in STM32 chip (I trust it will work as a QSPI master). An external QSPI memory is NOT my target (no benefit if I would solder a QSPI memory chip to test against it).

The intension is: to test an external slave device with a QSPI interface. It is a chip under development (I cannot disclose which one and for what), so I need a QSPI master talking to this "new" chip (or an FPGA emulating this chip before we will tape-out).

I need this STM MCU as a QSPI  test vehicle to verify an external chip (which is NOT a memory chip): QSPI is used instead of regular SPI in order to access, program and configure... a new chip in development and for verification/characterization I need QSPI. BTW: QSPI can be used on any chip/board, even it is not a memory chip.

All fine: I know the issue with flying wires (and ribbon cables, impedance matching, signal termination ...). I would need anyway a "long cable", because: for testing - this new chip will sit in an oven (for temperature tests/characterization). So, I need a QSPI as master, talking to a QSPI slave device (chip) with the options to tweak the QSPI timing (esp. "round trip delay").
Luckily, the STM32 MCU provides several great features, such as DLYB block, additional half-clock-cycle delay of CLK for reading QSPI response, 1V8 MCU operation (actually, I would need also 1V2, but 1V8 as QSPI level is ok for now).

Other QSPI test vehicles, like TotalPhase PROMIRA, are not really good (and have flaws). Therefore, I need STM32 (and familiar with STMs) as a flexible QSPI test interface (with options to tweak the "round trip delay").

It will be a great year 2024, because I am sure the new PCB with LQFP64 will do the job (I am a big fan of STM32 MCUs and tools).

After I got a NUCLEO-U5A5ZJ-Q board working fine with 1V8 VDD - and USB - I tried to create a smaller board (and I did this mistake with "USB FS requires 2,7V...3V3") - the new board should be fine (and the year 2024 is secured).

See you here...

 

New PCB is here - but NOT working (with 1.8V and USB on 3.3V)!

USBVDD power pin is 3.3V, all other VDD pins 1.8V (coming from a 1.8V LDO).
But my LDOs (I tried four parts) provide a voltage like 1.791V, 1.794V - and it FAILS!!!!

I need at least (tested with power supply) 1.804V.

So,
powering the VDDs with 1.8V and below - even USBVDD is 3.3V - it does NOT work - with USB (even MCU seems to be running fine).

When I shortcut briefly (but not permanently) VDDSMPS and VDD11) it starts, USB comes up and keeps running.
But USB does not work if VDD is below 1.8V (and a permanent short-cut does not help: it seems to be just needed to start the SMPS).
And the debugger becomes very flaky: 50% of the time it does not find the target (if VDD is not above 1.8V).

So, my conclusions:

  • make sure, VDD is a bit above 1.8V, e.g. 1.804V - if VDD drops to 1.793V - USB will not work anymore (even MCU boots and seems to run)
  • MCU keeps running, after it could boot with >1.8V - until VDD drops to 1.793V (USB gets lost)

"rrrr": all my ordered 1.8V LDOs show a nominal voltage (when soldered) in range of 1.79xV - and this is too low for getting USB working!

A cross-check on a NUCLEO-U5A5 board (I used U575): VDD is 1.799V (a bit above my one).

So,
VDD 1.8V and VDDUSB 3.3V works JUST when VDD is a bit above 1.8V, never below 1.8V !
Therefore, it becomes "not possible" to use 1.8V because my ordered 1.8V LDOs can drop down to 1.793V (beside the fact that debugger starts with trouble to see target if voltage gets "so low" - just millivolts meter and I would be running right at the edge...).

Just -- how did you set the thresholds ?

AScha3_0-1704869191593.png

+ btw 1,8V is the lowest value i see in the ds tables (for standby/stop modes)

AScha3_1-1704869653018.png

and for wakeup 3,0V :

AScha3_2-1704869781441.png

--- just (maybe i forgot...) Why you want to run at lowest possible voltage hi-speed QSPI ?

If you feel a post has answered your question, please click "Accept as Solution".

no clue yet why it fails with 1.8V

I thought:
if my CMOS oscillator fails at 1.8V - it could explain, e.g.:
external clock stalls, "Clock Security Engine" (? CSE) falls back to internal RC-Osc clock (48 MHz ?), then my PLL config, e.g. for USB, is wrong. Therefore no USB.

BUT it is not this case:
I have checked:
I use 8 MHz as MC2520Z8,00000C19XSH, It is intended for VDD 1.71 ... 3.63V. So, the OSC should be OK.

And it does. Just why would a brief shortcut between VDDSMPS and VDD11 "release" the MCU?

BTW:
MCU is specified (datasheet) as VDD 1.71...3.6V. VDDSMPS is VDD (therefore same range, just the SMPS frequency should drop from 3 MHz to 1.5 MHz if VDD <1.9V).

I need to run MCU with 1.8V because I need all I/O signals (esp. QSPI) as 1V8 LVCMOS logic level.

 

"hmmm": SMPS with an issue?

When SMPS frequency drops with VDD <1.9V - does it mean I need a different inductance there?

I have 2.2 microH plus 2.2 microF on VDD11 (but on both/each VDD11 pins, so in parallel as 4.4 microF).

Could it be that for 1.8V with SMPS I need a change on external inductor or capacitors?

BTW: I tried to run on LDO, not to switch to use SMPS. It fails in the exact same way (and needs this "trick" with a brief shortcut to "enable" USB).

>I need to run MCU with 1.8V because I need all I/O signals (esp. QSPI) as 1V8 LVCMOS logic level.

ok,

but isnt the VDDIO for this , just for the I/O drivers and not get problems for the core .

AScha3_0-1704954770056.png

 

If you feel a post has answered your question, please click "Accept as Solution".

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