LPC1768 Writing to txt file located in local

Hello everyone,I have an mbed NXP LPC1768. I am trying to write some data in a .txt file which is located in “local” directory of mbed. My mbed OS version is 6.16 and firmware version is 141212.
My big problem is, after connect() function, I cannot use fopen() function, when fopen is executed, mbed is crushed. That’s why I cannot use – localfilesystem local(“local”) – command,

How to write my data to the .txt file without using localfilesystem class?


You may want to look through a previous thread on this subject LPC1768 using MbedOS6 with LocalFileSystem - #6 by Nathan_Biggs

No, my problem is different from this. It is far from mbed OS version. When I upload 16457 firmware version, then it is working, But I have to use 141212 version of mbed.

Are you able to run my example project OK? I tested this on an LPC1768 board with the “new” firmware and it works fine, except I have to re-plug the device before newly created files show up to the PC.

Hello Metehan_Uzun,

This problem with using fopen() after connect() has been known since 2018 but still has no solution to my knowledge.

It worked in Mbed 2 and Mbed OS 5.3.
You can find more information here:


If you just want to save settings in memory you can use the kvStore.
Otherwise the localfilesystem works before the connect() so I don’t know if it’s possible but combine kvStore and localfilesystem by restarting the mbed to update the .txt file

Have a nice day!