2023-11-20 06:40 AM
Hello,
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.
https://github.com/STMicroelectronics/STM32CubeH5
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
Christian
Solved! Go to Solution.
2023-11-27 06:21 AM - edited 2023-11-27 06:30 AM
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
if(fresult)
{
printf(" mount error ! \n");
.....
- ( but i am using fatfs here , not filex )
2023-11-29 06:51 AM
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?
2023-11-29 07:31 AM
right.
no more "main" .
your program is in a thread. maybe...the ux thread.
2023-11-29 09:02 AM
recommended: first read a "little" about ...
https://learn.microsoft.com/en-us/azure/rtos/
+
let Cube make a first thread for you , as i wrote . then write there, what you would/want write as your "main".