Unable to print float values using PRINTF() in i.MX93EVK

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Unable to print float values using PRINTF() in i.MX93EVK

跳至解决方案
660 次查看
Vikas7Bal
Contributor II

I am working with an imx93evk sdk_2_16 (I am not sure how I generated it, will provide the generation steps in next post).

I observed that, the "PRINTF()" function is not able to print float values (it will only print textual content and remains blank in the place of float values)

I read in this query that, I need to enable some macros during project generation, but since my project is already generated, I couldn't regenerate it (there are many untracked changes which will be lost if I rebuild again)

So, is there a way where I can modify in the source code, so that I can achieve this. (I tried enabling the PRINT_FLOAT_ENABLE macro but yet it is not working)

This is the configuration, I currently have :
PRINT_FLOAT_ENABLE = 1
SDK_DEBUG_CONSOLE = 1

Thanks!

标签 (1)
0 项奖励
回复
1 解答
608 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

How did you modify your source code?

Please try to define these flags before fsl_debug_console.

// main.c
#define PRINTF_FLOAT_ENABLE 1
#define SDK_DEBUGCONSOLE 1

#include "fsl_debug_console.h"

 

If not work, then try to  modify LDFLAGS

-Wl,-u,_printf_float



Best Regards,
Zhiming

在原帖中查看解决方案

0 项奖励
回复
2 回复数
609 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

How did you modify your source code?

Please try to define these flags before fsl_debug_console.

// main.c
#define PRINTF_FLOAT_ENABLE 1
#define SDK_DEBUGCONSOLE 1

#include "fsl_debug_console.h"

 

If not work, then try to  modify LDFLAGS

-Wl,-u,_printf_float



Best Regards,
Zhiming

0 项奖励
回复
549 次查看
Vikas7Bal
Contributor II
Hi, Zhiming thanks for your quick response!

I have tried defining those flags before fsl_debug_console.h, but still no luck with it

However, I have tried -Wl,-u,_printf_float this linker flag and it started working!

Thanks!
0 项奖励
回复