cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Com port not working with CubeIDE and ST-Link?

MHoop.1
Senior

I am attempting to debug an Azure RTOS example (NX_TCP_Server_Echo) but I am not receiving any messages on the VCOM port. In device manager I can see that the STLink Virtual Com Port is assigned to COM8 at 115200 bps. So I attach my Hercules Setup utility to Serial COM8 at 115200 bps. But when starting the debug session I receive no messages. So I cannot attach remotely to the target server application.

Is there some magic configuration parameter that needs to be set in order to use the VCOM port?

10 REPLIES 10
MMARC.1
ST Employee

Hello, can you please let us know which Nucleo or Discovery board you are targeting?

Normally in our Nx_TCP_Echo_Server examples UART is set by default as follows:

  • BaudRate = 115200 baud
  • Word Length = 8 Bits
  • Stop Bit = 1
  • Parity = None
  • Flow control = None

Can you please double check the above vs you're acutal settings in Hercules ?

Also please try to check which UART is used in your example, it might not be the one connected to onboard STLINK....

Thanks

Pavel A.
Evangelist III

> Is there some magic configuration parameter that needs to be set in order to use the VCOM port?

No - but the real UART of the STM32 must be set up correctly.

Also, some boards have jumpers that connect the STM32 UART to the VCP pins of the debugger.

MHoop.1
Senior

Gents,

I'm afraid I have some other IDE installation configuration issue that may be affecting this.

I installed the CubeIDE in a different location than my root (C:\Program Files (x86)\STMicroelectronics\Software\CubeIDE\STM32CubeIDE_1.11.0\STM32CubeIDE) since my other STM apps are located here. But each time I start the CubeIDE, it creates a new CubeIDE folder at C:\Users\mike\STM32CubeIDE\workspace_1.11.0\.metadata. The .metadata folder contains a file called .ide.log that seems to be attempting to initialize a logger of some kind.

2023-01-03 12:30:34,697 [INFO] Activator:179 - 
 
 
2023-01-03 12:30:34,712 [INFO] Activator:180 - !SESSION log4j initialized
2023-01-03 12:31:00,396 [ERROR] LogOutputStream:74 - [STDERR_REDIRECT] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2023-01-03 12:31:00,396 [ERROR] LogOutputStream:74 - [STDERR_REDIRECT] SLF4J: Defaulting to no-operation (NOP) logger implementation
2023-01-03 12:31:00,396 [ERROR] LogOutputStream:74 - [STDERR_REDIRECT] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Is there some setting in CubeIDE that needs to be set to my current workspace or program location?

Thanks,

Mike

MHoop.1
Senior

Ok. So I re-installed CubeIDE in its default location (C:\ST), re-downloaded the example and appropriate software packs, built the project, then debugged the project. Examined the Device Manager to see COM8 at 115200 bps being used by STLink Virtual Com Port. Opened my Hercules terminal on that port. Still no activity.

Target Nucleo-NUCLEO-F429ZI

USART3 connected to STLink internally.

USART3 configured by CubeIDE to 115200,8,none,1

Hercules set to COM8 115200,8,none,1

FYI, the example builds OK and runs. But is stuck in the __tx_ts_wait: loop. So it looks like the processor is running but no interrupts are firing, So no TCP IP traffic is flowing. And there is only one thread showing in the ThreadX List (see below).

I am questioning whether the Example structure is correct. Can someone verify that this specific example runs as it is supposed to?

Thanks,

MikeH

MHoop.1
Senior

This appears to be a problem with the project structure generated by CubeIDE rather than with VCOM.

The projects that were not communicating with VCOM were actually not running correctly. The code generated by CubeIDE was incomplete (I think). Therefore the only thing that was running was the MCU and its basic functions. The actual Azure code was not running.

I WAS able to get one project to run, and it DID communicate with VCOM port. Here is the example file structure of the working project.

0693W00000Y7JxWQAV.pngBut below is a typical file structure (generated by CubeIDE). This project does NOT work, nor does it communicate with the VCOM port.

0693W00000Y7JyZQAV.pngNotice that the working file structure has a STM32CubeIDE folder, but the non-working project does not.

Can someone point out what I am doing wrong?

Thanks,

MikeH

> But below is a typical file structure (generated by CubeIDE). This project does NOT work, nor does it communicate with the VCOM port.

It's hard to tell what is wrong in the generated project without debugging. But [more often than not] cube-generated projects do not work as is, need some manual adjustment.

So it is recommended to always start from a ready example rather than generate from scratch.

MHoop.1
Senior

Pavel,

"So it is recommended to always start from a ready example rather than generate from scratch."

I totally agree. So I need a "ready example" of a TCP Server running on a Nucleo-F429 board. Where can I find one?

" But [more often than not] cube-generated projects do not work as is, need some manual adjustment."

Isn't the purpose of CubeIDE to generate example code for folks like me that don't have enough experience to do "manual adjustments"? I would expect that ST would fully test these examples prior to releasing them.

"It's hard to tell what is wrong in the generated project without debugging."

So, I was able to begin a debug session. But, as I am sure you are aware, Azure RTOS is overwhelmingly complex. I don't know where to begin debugging. I have watched all of the videos and have read the documentation. I can get the code to run, but what am I looking for? It appears that the code is running, but none of the callbacks are firing. How do you debug that? I can see a single Tx thread running, but it just sits in the __tx_ts_wait: loop. It seems to me that something is missing in the generated code. And since I don't know what to look for, I am having trouble debugging.

Thanks for your feedback.

MikeH

AScha.3
Chief II

>but none of the callbacks are firing

just - you enabled callbacks in cube ? (project manager -> advanc.settings )

+ also interrupts ( + set priority ) ? (in nvic setting )

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

Mike,

> I need a "ready example" of a TCP Server running on a Nucleo-F429 board. Where can I find one?

The starting point normally is the ST Cube package for the board. It is installed by CubeMX or CubeIDE, or can be found on github.

https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F429ZI-Nucleo

Unfortunately there is only one Ethernet example

https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F429ZI-Nucleo/Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS

So that's it.

At least, it can be useful to see the hardware in action and verify that the board works.

Next step: find a similar board that has a needed example. Google.

Next step... persuade somebody else to make an example: ideally your ST support engineer.

It can be a consultant or contractor.

> Isn't the purpose of CubeIDE to generate example code for folks like me

Sure it is. Ideally the Cube could be like the Github Copilot, AI that can be asked in natural language to write code, that knows all the manuals, app notes and errata.

But we are where we are.

> Azure RTOS is overwhelmingly complex. I don't know where to begin debugging.

You're trying to do several complex things at once. Ethernet on STM32 is complicated enough because of DMA, memories, caches, MPU, and now there is the Microsoft RTOS.

Maybe, start from something simple: get the UART working first. Get some interrupt working.