5 years, 7 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.

1 Answer

5 years, 7 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.