nRF5 SDK v17.1.0
SD Card Example

The SD Card Example demonstrates the use of an SD memory card with the nRF5 chip using the SD Card library and the FatFs file system library.

The example initializes the card and performs basic operations like mounting the FAT volume, listing the files, and writing the example file.

To run the example, connect the SD card to the nRF5 DK in the following way:

SD Card pin Arduino pin nRF52832 DK (PCA10040)nRF52840 DK (PCA10056)
1 - D3 / CS D10 P0.22 P1.12
2 - DI / MOSI D11 P0.23 P1.13
3 - GND GND GND GND
4 - Vcc (3,3V)3V3 Vdd Vdd
5 - CLK D13 P0.25 P1.15
6 - GND GND GND GND
7 - D0 / MISO D12 P0.24 P1.14
8 - D1 - - -
9 - D2 - - -
Note
The pin configuration presented in the table above was wrong in documentation for nRF5 SDK v12.2.0 and has now been corrected.

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\fatfs

Testing

Test the SAADC Example application by performing the following steps:

  1. Compile and program the application.
  2. Connect the SD card as shown above and make sure that the write protection switch is not enabled.
  3. Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 115.200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
  4. Check the output and observe that the following happens:
    1. After reset, information about the initialization status is displayed on UART.
    2. If the initialization has succeeded, the example outputs a file list in the root directory.
    3. Message about writing the example is printed.
  5. Connect the card to a different host device (such as a PC with a USB card reader) and observe that the example file NORDIC.txt exists and that one line of text was appended to the file.

Documentation feedback | Developer Zone | Subscribe | Updated