AnsweredAssumed Answered

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

Question asked by Peter Krause on Oct 24, 2014
Latest reply on Oct 29, 2014 by Peter Krause



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