cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Nucleo U575ZI-Q Board implemnetation of usart2 via USB C

Sathees_medtronic
Associate II

I have a raw dataset in header file; I have to do some post processing with it ; So How can I get it done with USART by plotting the waveform .
even After Configuring USART2 and UCPD with CDC also I dont find USART is detected; If I Am wrong Correct me and How to approach this?

 

7 REPLIES 7

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 


@Sathees_medtronic wrote:

I have a raw dataset in header file; I have to do some post processing with it ; So How can I get it done with USART by plotting the waveform .


I'm not sure what you're actually asking here?

If the data is in a header file, can't you just take it direct from there?

Do you really just want to know how to transfer data - any data - via UART?

More specifically, via the Virtual COM Port (VCP) provided in the ST-Link on your Nucleo U575ZI board?

As you can see in the User Manual for the board, the ST-Link's VCP connects to a UART on the STM32U5 Target chip:

AndrewNeil_3-1744710054034.png

 

This give you a UART connection to the Host PC via the ST-Link's USB connection (Micro USB; CN1) without the need for any USB code in the STM32U5 Target chip.

 

This Virtual COM Port is, by default, connected to LPUART1 on PA9,10:

AndrewNeil_2-1744709816581.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@Sathees_medtronic wrote:

 After Configuring USART2 and UCPD with CDC also I don't find USART is detected; If I Am wrong Correct me and How to approach this?


To create a "virtual" UART link over USB, you would not use a real UART on the Target microcontroller at all - the comms would be purely through the USB software.

 

As noted above, by far the simplest way to get UART comms with a PC is to use the ST-Link's VCP.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Sathees_medtronic
Associate II

Duplicate merged as clarification


How to Use USB-C Port on Nucleo-U575ZI-Q Board for USART/CDC Communication?

Hi ST Community,

I’m working on the STM32 Nucleo-U575ZI-Q board and I need some guidance. I usually work with USART using the standard TX/RX pins, but this time, I want to use the USB-C port on the board to perform serial communication — specifically, sending data to a serial monitor on my PC.

Here’s what I’m trying to do:

  • I have a dataset stored in a header file on the MCU.
  • I want the STM32 to read this dataset and send each data point through the USB-C interface.
  • On the PC side, I want to view this data on a serial monitor (like Tera Term or PuTTY), and eventually plot it in real-time.

I understand this should be done using the USB CDC class, but I’m completely new to configuring the USB-C interface as a virtual COM port.

Could someone please guide me

Thanks for clarifying that you do actually want to use just USB.

But this still doesn't make sense:

 


@Sathees_medtronic wrote:
  • I have a dataset stored in a header file on the MCU.

header files are not stored on the MCU - they get compiled into the Flash image.

So the file has to be available on the PC at the time you do the compilation.

So, as you have this data in a file on the PC, why not just take it directly from that file - why compile it and program it into an MCU, only to read it out again?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Yes They are stored in Flash,So How can Do it with CDC or How should I approach this!

 

Is there not an example in CubeIDE (ie, in the firmware pack) ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

For the south end USB connection you'd need to work the USB Device CDC examples. 

You could read internal flash with something like a MSC or MTP device. Writing via USB might be more problematic as the internal flash can stall the MCU and not ideal for real-time operation. Could make a RAM drive, or use external QSPI NOR FLASH 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..