2023-12-26 09:51 PM - last edited on 2024-02-20 07:56 AM by Peter BENSCH
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.
Solved! Go to Solution.
2024-01-04 09:58 AM - edited 2024-01-04 10:10 AM
--- 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. 🙂
2024-01-01 05:47 AM
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.
2024-01-02 05:55 AM
Hi,
Can someone please help me?
Thanks,
John.
2024-01-02 06:26 AM
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.
2024-01-02 06:42 AM - edited 2024-01-02 06:43 AM
Hi,
I dont have the source - so what should i say about ? 🙂
Maybe you attach a xx.zip ...
2024-01-02 09:54 PM
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.
2024-01-02 10:50 PM
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.
2024-01-02 11:26 PM
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...
2024-01-03 06:36 PM
Thanks AScha.3,
I'll have a look into it.
2024-01-04 01:38 AM
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?