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

Difference between the libraries of littlefs and nvs

Hi,

I want to use flash area of nrf9160. To do it, I have created simple example using predefined samples on zepyhr project. My goal is to write a data to flash and read it. To write data, I'm using the following scripts which I found that https://devzone.nordicsemi.com/f/nordic-q-a/27428/read-and-write-specific-flash-pages-from-a-computer

I have a little bit confused about using flash area. According to my research, I can use littlefs and nvs. Both are supported by zephyr. But, which one is more useful for my goal? My data is approximately 300KB and it will be the format of ZIP. 

Parents Reply
  • It would be nice with some more clarification. What are you going to store in the ZIP file and what are you going to do with that data? The reason I am asking is that this information is needed in order to give you the best recommendations on how to go about this.

    Feel free to make the ticket private if you are going to share any confidential information.

    Best regards,

    Simon

Children
  • Of course, I can give more details about work. My main work is the following:

    1) Download the firmware for nrf52 from Internet. The format of this firmware will be ZIP. While this firmware belongs to nrf52, it will be stored on nrf91. 

    2) After storing this ZIP, the second step is sending the firmware to nrf52 through UART. I have achieved it for basic data like char array. In addition, I created post about this issue before. You may want to read it also: https://devzone.nordicsemi.com/f/nordic-q-a/58636/sending-data-larger-than-ram-through-uart

    3) After taking firmware through UART, I want to update it using DFU in nRF52.

    Now, I'm at the first step which is storing data on nrf91. Do you have suggestion for my work and issues?

  • Okay, thanks for the detailed explanation.

    Regarding the DFU, I am not sure how to go about it as this is not my area of expertise, but I will try to present what I currently know. I will read more about this and update the thread when I get a better overview.

    → If you want to perform a DFU from the nRF9160 to an nRF52 through a serial link, the approach depends on the SDK you are using with the nRF52.

    • If you are using the nRF5 SDK on the nRF52, you need to perform the DFU according to the Serial DFU protocol. Check out the DFU Bootloader blog and section 6. DFU Master code
    • If you are using NCS/Zephyr on the nRF52, you need to do the following:
      • On the nR52, you need to implement MCUBoot and the application with SMP support.
      • On the nRF9160, you need to implement the mcumgr library and transfer the image to the nRF52 over SMP 
      • The SMP instance on the nRF52 will then receive the firmware and save it in flash. The MCUBoot will then execute it
      • (Take a look at the Device Management section in the Zephyr Documentation as well.)

    → Regarding the storage, I'll come back to you about this.

    Best regards,

    Simon

  • Could you tell me if you are using nRF5 SDK or NCS on the nRF52 device?

    Best regards,

    Simon

Related