AnsweredAssumed Answered

STM32 Writing to a Text File

Question asked by Khaled Aljehani on Oct 3, 2017
Latest reply on Oct 6, 2017 by Clive One

Hi,

 

I am trying to write data to a text. The code is shown below. I am using STM32L152D board with Keil V5.

When I exceute the code, nothing works at all.

 

 

#include <stdio.h>

 

main()
{
FILE *fp;
fp = fopen("/tmp/test.txt", "w+");
fprintf(fp, "This is testing for fprintf...\n");
fputs("This is testing for fputs...\n", fp);
fclose(fp);
}

 

So, how can I write to a text file? and also reading.

 

Best regards.

Outcomes