Using SD card on nRF9161 DK

Hello, we've a nRF9161 DK board a we saw on the back side a footprint for mounting an SD card holder and we found the SD card holder component in the BOM.

Unfortunately there is no mention about the usage of the SD card in for the nRF9161 DK anywhere in the documentation.

Is there any problem on using the SD card on nRF9161 DK (trough SPI I guess) ?

What do we have to do to connect the SD card to the nRF9161 module (excluding the soldering of the card holder)?

Thanks in advance for the support,

Joel

Parents
  • I was talking about J8 on the bottom side of the board listed on the BOM as "microSD Card Connector"...

  • Hello,

    Yes, I noticed that now. It built fine before v2.7.0, when sysbuild was introduced. Since it is in the zephyr part of NCS, we do not have direct control over these samples, so not all of them work out of the box.

    I got it running for the nRF52840 DK by adding this pm_static.yml file to the application folder:

    storage_partition:
      affiliation: disk
      extra_params: {
          disk_name: "littlefs",
          disk_cache_size: 4096,
          disk_sector_size: 512,
          disk_read_only: 0
        }
      address: 0xfa000
      end_address: 0x100000
      placement:
        before:
        - end
      region: flash_primary
      size: 0x6000

    (I was not allowed to upload .yml file, but you can take this one, and rename it "pm_static.yml"

    storage_partition:
      affiliation: disk
      extra_params: {
          disk_name: "littlefs",
          disk_cache_size: 4096,
          disk_sector_size: 512,
          disk_read_only: 0
        }
      address: 0xfa000
      end_address: 0x100000
      placement:
        before:
        - end
      region: flash_primary
      size: 0x6000

    Then, you must build using the build command: west build -d <board name> -d build -- -DCONFIG_APP_MSC_STORAGE_SDCARD=y

    as described here:

    https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/subsys/usb/mass/README.html#sd_card_example

    Best regards,

    Edvin

  • Hello, thanks... this explains a lot of things... with your input I'm now able to build LittleFS for nRF52840 too.

    Question about the pm_static.yml you provided ... doesn't  "region: flash_primary" means that you're placing the storage_partition into the main flash instead of the desired external SD flash ? 

    I tried the format sample by substituting LittleFS with FAT_FILESYSTEM_ELM and it is working perfectly using "SD:"as ID ... the issue is related to the usage of LittleFS.

    Joel

  • I am sorry, but I have not played around too much with SD cards in Zephyr/NCS. Did you test it? Does it actually use the SD card? 

    I would test it, but we are very limited on resources right now, due to summer holiday season in Norway, and I don't think I will be able to set aside the time to test it before leaving in two days. 

    If there is no SPI activity on the SD card gpios, can you compare the behavior with NCS v2.6.X? There the sample built without any modifications. Alternatively, you can reach out to the Zephyr support forum, as the SD card library is really not maintained by Nordic Semiconductor.

    Or, I can have a look when I return in end of July. I am terribly sorry for the inconvenience!

    Best regards,

    Edvin

  • Ok, unfortunately I do not have an nRF52840DK board. I just have a nRF9161DK and the sample do not builds for this target, it is therefore impossible for me to follow your advice.

     Regards, Joel

  • It shouldn't matter whether it is an nRF9161DK or nRF52840DK when it comes to SD card. 

    Or did I misunderstand you?

    Best regards,

    Edvin

Reply Children
  • Hello... I'm a little confused ... mass storage example is building with success when i set nrf52840dk/nrf52840 as board (which has its dt overlay under boards).

    west build -b nrf52840dk/nrf52840 -d build -- -DCONFIG_APP_MSC_STORAGE_SDCARD=y is ok

    If I set nrf9161dk/nrf9161 the build ends with errors ... 

    west build -b nrf9161dk/nrf9161 -d build -- -DCONFIG_APP_MSC_STORAGE_SDCARD=y fails

    C:/ncs/v3.0.2/zephyr/samples/subsys/usb/mass/src/main.c:36:2: error: #error No supported disk driver enabled
       36 | #error No supported disk driver enabled

    Joel

Related