cancel
Showing results for 
Search instead for 
Did you mean: 

STSW-EDUKIT: How can I view the sprintf messages.

JMazu.1
Associate III

Hi Folks,

Managed to get the source compiled and loaded for the inverted pendulum project.  Rather impressive.

In the source code there's sprintf statements to inform the user on what's going on.

My question is: How can I view these messages?

I'm a bit rusty with STF401 code, just forgotten how to do things.

Can someone please help me?

Thanks,
John.

1 ACCEPTED SOLUTION

Accepted Solutions

--- most times : 115200 --- but just look in the source (UART2 setting, in MX_UART2_init), you said, you have it. I dont.

+

in my ide 1.13.1 , it was there ... afair. But not sure about this. 🙂

 

 

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

View solution in original post

13 REPLIES 13
JMazu.1
Associate III

Hi,

Still stuck.

The project is peppered with sprintf commands, however I have no idea how to view these messages.

I'm assuming I have to run in Debug mode.

What do I have to do to view these messages?

Thanks,
John.

JMazu.1
Associate III

Hi,

Can someone please help me?

Thanks,
John.

Hi,

I've searched the Internet and unfortunately they all use ioc as a stepping stone.

With the STSW-EDUKIT project everything is done in code, the long way.  No ioc.
The main.c file is over 6,000 lines long.  Everything is in main.c.

Surely there must be some way to view these sprintf messages in some  sort of a console.

I'll keep looking, but don't be shy if you know the answer.

Thanks,
John.

Hi,

I dont have the source - so what should i say about ? 🙂

Maybe you attach a xx.zip ...

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

Hi AScha.3,

This is a typical pair of lines.

 

sprintf(msg, "\n\rSystem Starting Prepare to Enter Mode Selection... ");
HAL_UART_Transmit(&huart2, (uint8_t*) msg, strlen(msg), HAL_MAX_DELAY);


Thanks,
John.

 

So serial data is sent by UART 2 , you just need some connection to this, maybe there is already a driver to connect a PC or you need to connect a USB serial converter to get the strings to a terminal program on your PC.

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

Hi, I just looked - there is a nucleo-f401 board, that has vcp, so when you connect the USB to the st-link you should see a comport on your PC and if you open a terminal program, connect to the new comport, you see the text from the program messages.

Try...

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

Thanks AScha.3,

I'll have a look into it.

JMazu.1
Associate III

Just a bit of background AScha.3,

In Arduino Land, the message is sent via Serial.print.
In the Arduino IDE, you select which port to use and that's it, everything appears in the console.

I was hoping for something similar with the STMCubeIDE environment.
Wishful thinking eh?