Log to nrf52 thingy internal flash

I am working on a prototype using the nRF Connect SDK v2.1.0 on the nRF52 Thingy platform.

For my prototype, I need to store normal log output on the internal flash of the nRF52 Thingy in FAT format. The reason behind this is: I will put my Thingys in a testing environment to collect data. After some days, I want to collect the Thingys and read the log data via USB.

What is the best way to implement that?

I have been trying the https://docs.zephyrproject.org/latest/samples/subsys/usb/mass/README.html#fat-fs-example, but the FLASH configuration does not work (not on the Thingy and not on the nRF52840DK platform).

Best regards,

Michael

  • Do you by any chance know, how to configure the Zephyr FAT FS so that I can mount it on Windows without needing to format it?

    With your fix, I am able to mount it, but I think the config is wrong. When I format it in Zephyr, Windows cannot read it. When I format it in Windows, Zephyr cannot read it.

    I could not find anything about FAT configuration for Windows compatibility in this forum.

    All the best,

    Michael

  • Hi Michael,

    I know windows has a limited set of supported filesystem formats.
    My best guess is that you will need to figure out if windows supports FAT at all, and then what specific settings windows needs for FAT.

    I do not think we have anything on this, but I can try to look a bit more into it in the next couple of days.

    Regards,
    Sigurd Hellesvik

  • A colleague gave me an idea:

    The fat_fs sample worked for them, but they formatted the SD card on the windows first, then used it with the nRF.

    Would this work for you?
    To format it with windows first and then use it.

    Regards,
    Sigurd Hellesvik

  • Thanks for getting back that fast.
    Unfortunately, formatting the FAT filesystem with Windows first does not fix the problem.

    The firmware on the nRF52 detects that the filesystem configuration (perhaps the block size) is not correct and formats the filesystem again with its parameters.

    Do you know of a filesystem config (e.g., block size, sectors, ...) windows and Zephyr can read?

    Thank you,
    Michael

  • Hi Michael

    Sigurd is currently on leave, so I will help you with this case. 

    Just for my own curiosity, how are you planning to read data over USB from the Thingy52? 
    The Thingy52 uses the nRF52832, which doesn't support USB, and the USB port on the board is used for charging the device only. 

    I did some testing myself, and using an nRF52840DK I have no issues to format the disk in Windows and access it locally, but so far I have only tested using the MX25 QSPI flash device on the DK. Are you able to share the project you are using to set up the internal flash rather than the external one? 

    Then I can test it locally, and see if I can reproduce your issue. 

    Best regards
    Torbjørn

Related