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

Storing Packets in SD card and reading it efficiently using nRF9160

I am exploring options to store and read data in an organized way with SD card. I am able to properly store Binary data in the .txt file using (v1.3.0\zephyr\samples\subsys\fs\fat_fs) but accessing the data seems difficult because the data is unorganized. Hence I was thinking of using CSV file for the same so that I can store the data column wise. But I didnt find any usage examples for the same.

Is there any way where I can map my SD card in certain blocks and access it block by block so that its efficient? Or is CSV a better option to do it?

Can I access the page table of the SD card to MAP it according to my needs? I am confused how to proceed forward.

Parents
  • Hi,

    There is no difference between .txt and .csv files, other than the format of the data inside.

    So you can use the same functions you use to create and wite the .txt file, but simply write the data as a set of comma separated values instead.

     

    Is there any way where I can map my SD card in certain blocks and access it block by block so that its efficient?

     While I haven't looked into the APIs available in Zephyr, I expect that it is possible to read and write single blocks using the underlying API. However, unless you format your data correctly, you will not be able to read the data from a computer. "Formatting the data correctly" in this case means implementing the FAT filesystem, which brings you back to your first question.

     

    Can I access the page table of the SD card to MAP it according to my needs? I am confused how to proceed forward.

     What exactly are you trying to achieve?

    Best regards,

    Didrik

Reply
  • Hi,

    There is no difference between .txt and .csv files, other than the format of the data inside.

    So you can use the same functions you use to create and wite the .txt file, but simply write the data as a set of comma separated values instead.

     

    Is there any way where I can map my SD card in certain blocks and access it block by block so that its efficient?

     While I haven't looked into the APIs available in Zephyr, I expect that it is possible to read and write single blocks using the underlying API. However, unless you format your data correctly, you will not be able to read the data from a computer. "Formatting the data correctly" in this case means implementing the FAT filesystem, which brings you back to your first question.

     

    Can I access the page table of the SD card to MAP it according to my needs? I am confused how to proceed forward.

     What exactly are you trying to achieve?

    Best regards,

    Didrik

Children
Related