6 months ago.

Write to an txt file on local memory. nucleo 144.

I have tried :

  1. include "mbed.h"

LocalFileSystem local("local");

int x = 0;

int main() { FILE *fp; fp = fopen("/local/123.txt", "w"); for(int a = 0; a < 100; a++) { x++; fprintf(fp, "%d ", a); if( x == 10 ) { fprintf(fp, "\r\n"); x = 0; } } fclose(fp); }

But get error code 20, the only thing i want is to write txt and close it.

Comment on this question

1 Answer

6 months ago.

Hi,

LOCALFILESYSTEM is only available for some NXP targets - containing older "mbed interface". Look at FlashIAP, it provides functionality to write to internal flash memory.


You need to log in to post a question