fopen() and fprintf() with Semihosting on Kinetis K10

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

fopen() and fprintf() with Semihosting on Kinetis K10

ソリューションへジャンプ
1,669件の閲覧回数
peterkrause
Contributor I

Hello,

I want to do some automated unit testing of my firmware modules. I'm using Sput Unit Testing Framework and want to save the results in a text file via Semihosting. For this purpose I need fopen() and fprintf() to open a file and write text to it. At the moment I'm able to output my reults to the console via printf (I changed all fprintf() to printf() in Sput Framework). But I was not able to get working fopen() and fprintf(). In the EWL C reference manual is a chapter about the configuration of the library. I set "_EWL_OS_DISK_FILE_SUPPORT" macro to "1" in the "ansi_prefix.ARM.h" header file to enable supoort of the functions, but it didn't work.

How can I enable the file support?

My setup:

Kinetis MK10DX256VLH7

Segger J-Link Debugger

CodeWarrior 10.6

Windows 7 64-Bit

ラベル(1)
0 件の賞賛
1 解決策
950件の閲覧回数
Rick_Li
NXP Employee
NXP Employee

to enable the file support, an OS and a filesystem is needed first.

if you do not use OS such like MQX in your application, then, a file name and his path can not be resolved and fopen can not recognize it.

regarding your case, even if Marco "_EWL_OS_DISK_FILE_SUPPORT" is enable, you can't use fopen this feature in your application.

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
951件の閲覧回数
Rick_Li
NXP Employee
NXP Employee

to enable the file support, an OS and a filesystem is needed first.

if you do not use OS such like MQX in your application, then, a file name and his path can not be resolved and fopen can not recognize it.

regarding your case, even if Marco "_EWL_OS_DISK_FILE_SUPPORT" is enable, you can't use fopen this feature in your application.

0 件の賞賛
950件の閲覧回数
peterkrause
Contributor I

OK, thanks for your answer. With this info I'm not able to enable the file support, but I know the problem now.

At the moment I send my results to the console via printf() and save the console in a text file using the retarget option in the debugger.

0 件の賞賛
950件の閲覧回数
peterkrause
Contributor I

Is there no one with an idea?

0 件の賞賛