nRF9161 DK SPI Flash example

I'm looking for a beginner's guide to setting up external flash on the nRF9161 DK. I saw nRF Cloud Multi-service as an example, but its docs did not explain what was needed hardware-wise to set up the external flash memory (I found this). Basically, I have a spare Adafruit SPI Flash SD Card XTSD 4GB, and I'm looking to connect it to the DK if possible. I assume I need to modify the board overlay but I'm not sure where to go from here. Where are the pins for gd25wb256 in the sample defined? 

Parents Reply
  • Hi Hakon, can you please let me know what SD card module / SD card you are using for your test? I just get the following error when I run the sample:

    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    Sample program to r/w files on littlefs
    I: LittleFS version 2.9, disk version 2.1
    I: Card does not support CMD8, assuming legacy card
    E: Storage init ERROR!
    E: fs mount error (-134)

    I've tried several different SD card modules and different SD cards. I tried the littlefs sample (formatted the SD card with lfs tool) and the fat_fs sample (formatted the SD card as FAT32). I have been trying for days. Any pointers would be appreciated! Thanks again.

Children
  • nrao32 said:
    I: Card does not support CMD8, assuming legacy card

    Yes, this card is probably not SDHC compatible. I had the same issue, so I changed the SD card to a newer one. I use a SanDisk Ultra 16 GB SD card.

  • No dice. Bought this:
    https://www.amazon.com/dp/B0D3WY8DR6

    ... which explicitly states microSDHC support, and I still get the same "Card does not support CMD8, assuming legacy card" -- I tried variations of that overlay file like:

    &spi3 {
        gd25wb256: gd25wb256e3ir@1 {
            status = "disabled";
        };
        
        status = "okay";
        pinctrl-0 = <&spi3_default>;
        pinctrl-1 = <&spi3_sleep>;
        pinctrl-names = "default", "sleep";
        cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
        
        sdhc0: sdhc@0 {
            compatible = "zephyr,sdhc-spi-slot";
            reg = <0>;
            status = "okay";
            mmc {
                compatible = "zephyr,sdmmc-disk";
                status = "okay";
            };
            spi-max-frequency = <1000000>;
        };
    };

    I tried fiddling with the spi-max-frequency as well. Oddly, it works with my nRF9160 DK, but I can't for the life of me get this working on the 9161.

Related