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

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

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

跳至解决方案
825 次查看
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 解答
773 次查看
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 回复数
774 次查看
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 项奖励
回复
714 次查看
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 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2078853%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%97%A0%E6%B3%95%E5%9C%A8%20i.MX93EVK%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20PRINTF()%20%E6%89%93%E5%8D%B0%E6%B5%AE%E7%82%B9%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2078853%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20imx93evk%3C%2FSPAN%3E%20%3CSTRONG%3Esdk_2_16%3C%2FSTRONG%3E%20%3CSPAN%3E%EF%BC%88%E6%88%91%E4%B8%8D%E7%A1%AE%E5%AE%9A%E6%98%AF%E5%A6%82%E4%BD%95%E7%94%9F%E6%88%90%E5%AE%83%E7%9A%84%EF%BC%8C%E5%B0%86%E5%9C%A8%E4%B8%8B%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0%E4%B8%AD%E6%8F%90%E4%BE%9B%E7%94%9F%E6%88%90%E6%AD%A5%E9%AA%A4%EF%BC%89%E3%80%82%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%E6%88%91%E5%8F%91%E7%8E%B0%EF%BC%8C%E2%80%9C%3C%2FSPAN%3E%3CSTRONG%3E%20PRINTF()%E2%80%9D%E5%87%BD%E6%95%B0%E6%97%A0%E6%B3%95%E6%89%93%E5%8D%B0%E6%B5%AE%E7%82%B9%E5%80%BC%EF%BC%88%3C%2FSTRONG%3E%3CSPAN%3E%20%3C%2FSPAN%3E%3CSTRONG%3E%E5%AE%83%E5%8F%AA%E4%BC%9A%E6%89%93%E5%8D%B0%E6%96%87%E6%9C%AC%E5%86%85%E5%AE%B9%EF%BC%8C%E5%B9%B6%E4%B8%94%E5%9C%A8%E6%B5%AE%E7%82%B9%E5%80%BC%E7%9A%84%E4%BD%8D%E7%BD%AE%E4%BF%9D%E6%8C%81%E7%A9%BA%E7%99%BD%3C%2FSTRONG%3E%3CSPAN%3E%20%EF%BC%89%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%E6%88%91%E5%9C%A8%E8%BF%99%E4%B8%AA%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMCUXpresso-IDE%2FPrintf-won-t-print-floats%2Fm-p%2F1093045%23M6046%22%20target%3D%22_self%22%3E%20%E6%9F%A5%E8%AF%A2%3C%2FA%3E%3CSPAN%3E%20%E4%B8%AD%E8%AF%BB%E5%88%B0%20%EF%BC%8C%E6%88%91%E9%9C%80%E8%A6%81%E5%9C%A8%E9%A1%B9%E7%9B%AE%E7%94%9F%E6%88%90%E6%9C%9F%E9%97%B4%E5%90%AF%E7%94%A8%E4%B8%80%E4%BA%9B%E5%AE%8F%EF%BC%8C%E4%BD%86%E7%94%B1%E4%BA%8E%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E5%B7%B2%E7%BB%8F%E7%94%9F%E6%88%90%EF%BC%8C%E6%89%80%E4%BB%A5%E6%88%91%E6%97%A0%E6%B3%95%E9%87%8D%E6%96%B0%E7%94%9F%E6%88%90%E5%AE%83%EF%BC%88%20%E6%9C%89%E8%AE%B8%E5%A4%9A%E6%9C%AA%E8%B7%9F%E8%B8%AA%E7%9A%84%E6%9B%B4%E6%94%B9%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%88%91%E5%86%8D%E6%AC%A1%E9%87%8D%E5%BB%BA%EF%BC%8C%E8%BF%99%E4%BA%9B%E6%9B%B4%E6%94%B9%E5%B0%86%E4%BC%9A%E4%B8%A2%E5%A4%B1%3C%2FSPAN%3E%3CSTRONG%3E%20%3C%2FSTRONG%3E%3CSPAN%3E%EF%BC%89%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%E9%82%A3%E4%B9%88%EF%BC%8C%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B9%E6%B3%95%E5%8F%AF%E4%BB%A5%E4%BF%AE%E6%94%B9%E6%BA%90%E4%BB%A3%E7%A0%81%E6%9D%A5%E5%AE%9E%E7%8E%B0%E8%BF%99%E4%B8%80%E7%82%B9%E5%90%97%EF%BC%9F%EF%BC%88%E6%88%91%E5%B0%9D%E8%AF%95%E5%90%AF%E7%94%A8%3C%2FSPAN%3E%3CSTRONG%3E%20PRINT_FLOAT_ENABLE%3C%2FSTRONG%3E%3CSPAN%3E%20%E5%AE%8F%EF%BC%8C%E4%BD%86%E4%BB%8D%E7%84%B6%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%89%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%E8%BF%99%E6%98%AF%E6%88%91%E7%9B%AE%E5%89%8D%E7%9A%84%E9%85%8D%E7%BD%AE%EF%BC%9A%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSTRONG%3E%20%E6%89%93%E5%8D%B0%E6%B5%AE%E5%8A%A8%E5%90%AF%E7%94%A8%20%3D%201%3CBR%20%2F%3E%20SDK_DEBUG_CONSOLE%20%3D%201%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3CSPAN%3E%20%E8%B0%A2%E8%B0%A2%EF%BC%81%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2078853%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E5%BC%80%E5%8F%91%E6%9D%BF%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2083233%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%97%A0%E6%B3%95%E5%9C%A8%20i.MX93EVK%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20PRINTF()%20%E6%89%93%E5%8D%B0%E6%B5%AE%E7%82%B9%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2083233%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E5%BF%97%E6%98%8E%EF%BC%8C%E8%B0%A2%E8%B0%A2%E4%BD%A0%E7%9A%84%E5%BF%AB%E9%80%9F%E5%9B%9E%E5%A4%8D%EF%BC%81%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%88%91%E5%B0%9D%E8%AF%95%E5%9C%A8fsl_debug_console.h%E4%B9%8B%E5%89%8D%E5%AE%9A%E4%B9%89%E8%BF%99%E4%BA%9B%E6%A0%87%E5%BF%97%EF%BC%8C%E4%BD%86%E4%BB%8D%E7%84%B6%E6%B2%A1%E6%9C%89%E8%BF%90%E6%B0%94%3CBR%20%2F%3E%3CBR%20%2F%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%88%91%E5%B7%B2%E7%BB%8F%E5%B0%9D%E8%AF%95%E4%BA%86%20-Wl%2C-u%2C_printf_float%20%E8%BF%99%E4%B8%AA%E9%93%BE%E6%8E%A5%E5%99%A8%E6%A0%87%E5%BF%97%E5%B9%B6%E4%B8%94%E5%AE%83%E5%BC%80%E5%A7%8B%E5%B7%A5%E4%BD%9C%E4%BA%86%EF%BC%81%3CBR%20%2F%3E%3CBR%20%2F%3E%E8%B0%A2%E8%B0%A2%EF%BC%81%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2079771%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%97%A0%E6%B3%95%E5%9C%A8%20i.MX93EVK%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20PRINTF()%20%E6%89%93%E5%8D%B0%E6%B5%AE%E7%82%B9%E5%80%BC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2079771%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%82%A8%E6%98%AF%E5%A6%82%E4%BD%95%E4%BF%AE%E6%94%B9%E6%BA%90%E4%BB%A3%E7%A0%81%E7%9A%84%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%E8%AF%B7%E5%B0%9D%E8%AF%95%E5%9C%A8%20fsl_debug_console%20%E4%B9%8B%E5%89%8D%E5%AE%9A%E4%B9%89%E8%BF%99%E4%BA%9B%E6%A0%87%E5%BF%97%E3%80%82%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E%2F%2F%20main.c%0A%23define%20PRINTF_FLOAT_ENABLE%201%0A%23define%20SDK_DEBUGCONSOLE%201%0A%0A%23include%20%22fsl_debug_console.h%22%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E5%A6%82%E6%9E%9C%E4%B8%8D%E8%A1%8C%EF%BC%8C%E9%82%A3%E5%B0%B1%E5%B0%9D%E8%AF%95%E4%BF%AE%E6%94%B9LDFLAGS%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E-Wl%2C-u%2C_printf_float%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3CBR%20%2F%3E%E5%BF%97%E6%98%8E%3C%2FP%3E%3C%2FLINGO-BODY%3E