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"...

  • Can you try to format it using the mass storage sample? If you insert it and connect the DK with the nRF's USB port, does it show up at all in the listed drives attached to your computer? If not, do you have one of these USB->SD-card adapters that you can try to use?

    Best regards,

    Edvin

  • Hello... I formatted no the SD card with a FAT filesystem (to get at leas a starting point) ... I will switch to LittleFS later once things are working... 

    I'm using SDK v3.0.2 on visual studio code ith the v3.0.2 tool-chain. Looking at the README.rst description to build the usb mass storage it should be enough:

    - create a new application using copy from sample (usb mass storage) sample 

    - add a build configuration with Board target set to nrf9161dc/nrf9161

    - at this point (to build for SD card with SPI interface ) the README requires to invoke the build with the option -DCONFIG_APP_MSC_STORAGE_SDCARD=y (which I suppose is defining the symbol CONFIG_APP_MSC_STORAGE_SDCARD and sets it to the value y). Since I'm calling the build directly from VSCode... how should I set CONFIG_APP_MSC_STORAGE_SDCARD to y ? directly in prj.conf ? using Kconfig GUI ? ... 

    If I just build the application without any modification I get a compilation error stating:

    C:/ncs/MyApp/mass_2/src/main.c:36:2: error: #error No supported disk driver enabled
       36 | #error No supported disk driver enabled

    Same thing if I add CONFIG_APP_MSC_STORAGE_SDCARD=y directly to prj.conf.

    What do I need to set to successfully build this sample for SD card on SPI interface with FAT filesystem on nrf9161DK ?

  • Just to understand if there is something wrong with the sample or my SDK (v3.0.2 ) installation I generated a new mass storage project for nrf52840dk/nrf52840 (which is listed in the README file as a compatible board).

    The sample doesn't build ... 

    C:/ncs/v3.0.2/nrf/include/flash_map_pm.h:47:22: error: 'PM_storage_partition_ID' undeclared (first use in this function)
       47 | #define PM_ID(label) PM_##label##_ID

    ...

    How shall I proceed to get this sample be configured and build correctly ?

    Joel

  • 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

  • Ok thx... this explains why I get all these troubles....

    How do I cal west build -d <Board name>  -d build -- -DCONFIG_APP_MSC_STORAGE_SDCARD=y from within the visual studio code nRF Connect extension ? I only see Actions->build ... 

Reply Children
No Data
Related