Showing results for 
Search instead for 
Did you mean: 

How to use virtual COM port with nucleo-H563ZI

Associate II


I am new in the STM world.

I am using the nucleo-H563ZI deverlopment board and I want to get the virtual COM port to work.

On github I found the examples of the Board. 

I opend the project "...\Projects\NUCLEO-H563ZI\Applications\USBX\Ux_Device_HID_CDC_ACM" and compiled it.

After that the PC recognize a vitual COM Port. So far so good.

Now I want to send or receive Data by the virtual COM port.

But I can't find the function for sending or receiving Data.


Is there anybody who can help me, please?


Best regards





Hi @Christian_Janz  , you have a lot to understand now - using a RTOS , no more "just" a program.

1. no more "main"  = the program ! now many "main" possible, all running (virtual) at same time.

2. read the comment in main.c , and believe it :


now your program is in processing tasks or threads !

so if you dont need this (maybe same me: had to use this Azure just because STM leaves us no choice anymore : want USB , Fat-file system ? then use Azure! )

you can use the first and only thread, that is generated by Cube if you let it do it :


then in core -> app_threadx.c :



i just rename this first thread to  >> tx_app_main_entry << , to see my "main" now by a similar name. 🙂

so write here, what you in old times wrote in "main" , here my H563 program begins:


void tx_app_main_entry(ULONG thread_input)
  /* USER CODE BEGIN tx_app_main_entry */
	printf("app_main start \n");
	/*##-2- Register the file system object to the FatFs module ##############*/
  	fresult = f_mount(&SDfs, (TCHAR const*)SDPath, 1);			// SD card mount
    	printf(" mount error ! \n");


- ( but i am using fatfs here , not filex )


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

Hi @AScha.3 ,

thanks for your help.

Yes, you are right. I have a lot to understand now.

That means in main.c  in the while(1) loop is nothing happening anymore?

So If i want to run code, I have to do this in the ux_device_cdc_acm.c?



no more "main" .

your program is in a thread.    maybe...the ux thread.

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

recommended: first read a "little" about ...



let Cube make a first thread for you , as i wrote . then write there, what you would/want write as your "main".

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