Cannot use fprintf in MCUxpresso SDK

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

Cannot use fprintf in MCUxpresso SDK

793 次查看
mjkimbravo
Contributor III

Hello,

I am wanting to print contents to a file using the C function "fprintf()," but it does not work. 

My device is QN9080 and I run some SDKs in MCUxpresso IDE. I set library/header to semihost config (already test every setting like Redlib, Newlib, NewlibNano in semihost). Some parts of my very simple code is below (send_data is a data which I want to write in .csv)

mjkimbravo_0-1716530499428.png

 

Here, .csv file is generated well, but code makes some errors at fprintf(); The error is...

 

mjkimbravo_1-1716530606595.png

mjkimbravo_2-1716530622711.png

Of course I include "stdio.h", "stdlib.h", and other kinds of headers. I also try to find a solution in "MCUXpresso IDE user guide.pdf" but it failed. I already found similar questions with me in NXP community, but those are not helpful for me.

Would you please help me?

 

Thanks,

 

 

 

标记 (4)
0 项奖励
回复
2 回复数

771 次查看
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

Hope you are doing well. I would recommend checking these posts:

 

Solved: semihosting fopen path - NXP Community

Solved: Re: Writing to a file (fprintf) in MCUXpresso IDE (11.3.1) - NXP Community

 

Hope this helps!

 

Regards,

Ricardo

0 项奖励
回复

456 次查看
mjkimbravo
Contributor III

Thank you for your reply.

As I mentioned in my main post, of course I already have read the posts you inform. But those are not helpful to me. I think my problem is a different kind of errors (something like I cannot use fprintf() itself). Would you please see the picture I uploaded in my main post and consider my problem? (Same error appears when using like fputs(), fwrite()).

fopen() works well, and file generated in SDK folders well, but writing has an issue.

Why this kind of errors happen?:

Can't find a source file at "/opt/jenkins/workspace/Libraries_ElevenNine/Redlib/redlib_clib/armv7e-m_fpu/.../src/fpprintf.c

 

Thanks,

0 项奖励
回复