Report
3 years, 12 months ago.

How can I save data in nRF51822 ?

Hi, all

I have a question about nRF51822 . The nRF51822 support the file system? I try to the code from Handbook

FileSystem

#include "mbed.h"
 
LocalFileSystem local("local");               // Create the local filesystem under the name "local"
 
int main() {
    FILE *fp = fopen("/local/out.txt", "w");  // Open "out.txt" on the local file system for writing
    fprintf(fp, "Hello World!");
    fclose(fp);
}

But LocalFileSystem only works on the two original mbed boards (LPC1768 and LPC11u24).

So how can I save data if nRF51822 is power off?

Thanks!

Question relating to:

Nordic stack and drivers for the mbed BLE API
Comment on this question

1 Answer

3 years, 12 months ago.

Try using the pstorage module from nordic-sdk. perhaps you'll find some useful information here:

https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00140.html#pstorage_intro

https://developer.mbed.org/forum/mbed/topic/16580/

with future versions of mbed, there will be a cross-platform on-chip filesystem, but that is at least a few months away.

Does SPI based SDFileSystem work with the nRF51-DK?

I tried to use Neil Thiessen's version of SDFileSystem. It compiles, but hangs after attempting to access any file.

https://developer.mbed.org/users/neilt6/code/SDFileSystem/

...kevin

Rohit,

How about for the nRF52-preview?

posted by Kevin Braun 26 Aug 2015

no, it doesn't.

posted by Rohit Grover 26 Aug 2015

You need to log in to post a question