This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I want to create text file in device storage or my PC.

Hi,

I want to create a file and save it to device storage or my computer.

As a result, I want to save a large amount of data in a text file, compress it, and send it to BLE advertising.

I'm using nrf52832 and fatfs example in SDK 15.3.0, but fatfs example needed the external sd memory.

 I tried to use the f_open and f_mount functions to save text file in my PC but it failed.

Does anyone know how to do this or any other good examples,sites?

Thank you

  • a large amount of data

    How "large" ?

    in a text file

    Why, specifically, in a text file?

    As you've seen, the nRF52832 has no native file system.

    But you can simply save data in RAM (volatile) or Flash (non-volatile).

    The sizes of Flash and, in particular, RAM are limited - so, again, how "large" is your data?

    send it to BLE advertising

    The amount of data you can send in a BLE advertising packet is extremely limited - only a few bytes.

    fatfs example needed the external sd memory

    Because using a file system is usually only appropriate when you have a large storage medium - much larger that the internal memory of an nRF52.

     I tried to use the f_open and f_mount functions to save text file in my PC but it failed

    You can't just directly open files on your PC from the nRF52 (or any other microcontroller, for that matter).

    Does anyone know how to do this

    It's not clear what you're actually trying to achieve here.

    Please explain your goal - then people can make suggestions as to how you might achieve that.

    http://www.catb.org/esr/faqs/smart-questions.html#goal

  • To awneil.
    thank you for your reply.

    Amount of My data is about min 1.8Mb, max 30Mb data from sensing the Biological signal sensor. Because I would like to see the flow of data in addition to the measured values, the data is large..

    The reason I want to create the text file, I was told from someone NRF could create a text file inside the chip, save it, compress it(like .zip file) and send it to BLE. 

    So I thought it was my first task to create a text file and store the data.

     

  • I was told from someone

    Who?

    If you don't (fully) understand their suggestion, then get them to explain it more fully!

    Just because something can be done does not mean that it should be done; nor that it's useful or appropriate in any particular situation!

    Storing data as text is extremely inefficient - far better to choose an efficient storage format in the first place!

    You would need over 99.9% compression to store 30MB in an nRF52 without external storage.

    Again, your goal is not clear - so it is impossible to make informed suggestions.

  • That's not how you respond to someone who is trying to learn. Have you ever answered a question before?

    Here's a great website on how to properly respond to questions!

    Hope it helps your attitude, you clearly need to be humbled Slight smile

    https://www2.le.ac.uk/offices/ld/all-resources/presentations/questions

Related