cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Team I am using STM32F401RE I wanted to print the message using the printf on the console But I am not able to see any prints Can you please let me know what is the settings that I have to change to enable printf on the console Kindly please help

DRAME.1
Associate II
 
9 REPLIES 9
Olivier GALLIEN
ST Employee

Hi @DRAME.1​ 

Please have a look to AN4989 STM32 Debug Toolbox chapter 7 Printf Debugging

Hope it help

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

What is "console" here? What's your hardware?

JW

0693W000003QVL9QAO.pngHi Oliver

Thanks for your response I have done the following settings.

I am trying to add the code below in the main file ,But i see that its giving an error

.\Objects\esfree_deepak_abhi.axf: Error: L6218E: Undefined symbol ITM_SendChar (referred from main.o).

I am not sure How to include this call Please let me know what files/library i have to enable to get this working

What are the other files to enable to get this working Screen shot shows the module enabled in my project

#include "stdio.h"
int fputc(int ch, FILE *f)
{
 ITM_SendChar(ch);
 return(ch);
}

Usually pulled in via stm32f4xx.h (compiler command line define for CPU STM32F401xE)

STM32Cube_FW_F4_V1.25.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f401xe.h

STM32Cube_FW_F4_V1.25.0\Drivers\CMSIS\Core\Include\core_cm4.h

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Dupe https://community.st.com/s/question/0D53W00000GX0QPSA1

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Clive

Thanks for your swift reply!

we resolved the error related to compilation adding headers

we see that there is no printf coming on the serial window I have attached the screen shot where we see the function getting called but no print appears in serail window

Kindly help us we are in final stage to get the output prints


_legacyfs_online_stmicro_images_0693W000003QVOIQA4.png
_legacyfs_online_stmicro_images_0693W000003QVO8QAO.png

Guessing you have the NUCLEO-F401RE

The Core Speed needs to accurately reflect how you have the chip running.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Clive,

Yes the hardware is stm NUCLEOF401RE board. and the core clock speed is 10.000000 Mhz , whats the maximum core clock frequency we can set and whether its safe to change the core clock frequency from the tool and flash the code , hope that doesn't trouble the functioning of the board.

The part typically runs at 84 MHz if the PLL is set up, if you don't program the clock it will be at 16 MHz via HSI clock

You're using Port 0, so those need checked. Other functionality does not

0693W000003QVRHQA4.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..