This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

fat32 sd card with nrf9160

hi 

i was trying to interface sd card with nrf9160 in segger emstudio. i was following the ticket Reading SD card on nRF9160dk - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com) but no output message is printing on terminal all the settings are same as discussed in ticket. please guide me for solving the issue.

Parents Reply Children
  • Ok, and what error code do you get? Did you try using the samples found under ncs/zephyr/samples/subsys/fs/fat_fs

  • yes i am not getting any error but the sd card is not working by this looks like code is get stuck somewhre. nothing as output  on terminal i check uart is working fine if i removed the card i got error -5

  • zephyr\lib\libc\minimal\include\errno.h gives the following description of error -5

    #define EIO 5		/* I/O error */

    Here is what I get from the output, when running on nRF9160DK without a SD card reader:

    2021-02-23T09:46:48.291Z DEBUG modem << *** Booting Zephyr OS build v2.4.0-ncs2  ***
    2021-02-23T09:46:48.297Z DEBUG modem << Flash regionsDomainPermissions
    2021-02-23T09:46:48.299Z DEBUG modem << 00 00 0x00000 0x08000 Securerwxl
    2021-02-23T09:46:48.301Z DEBUG modem << 01 31 0x08000 0x100000 Non-Securerwxl
    2021-02-23T09:46:48.310Z DEBUG modem << Non-secure callable region 0 placed in flash region 0 with size 32.
    2021-02-23T09:46:48.478Z DEBUG modem << SRAM regionDomainPermissions
    2021-02-23T09:46:48.482Z DEBUG modem << 00 07 0x00000 0x10000 Securerwxl
    2021-02-23T09:46:48.486Z DEBUG modem << 08 31 0x10000 0x40000 Non-Securerwxl
    2021-02-23T09:46:48.489Z DEBUG modem << PeripheralDomainStatus
    2021-02-23T09:46:48.494Z DEBUG modem << 00 NRF_P0               Non-SecureOK
    2021-02-23T09:46:48.496Z DEBUG modem << 01 NRF_CLOCK            Non-SecureOK
    2021-02-23T09:46:48.499Z DEBUG modem << 02 NRF_RTC0             Non-SecureOK
    2021-02-23T09:46:48.502Z DEBUG modem << 03 NRF_RTC1             Non-SecureOK
    2021-02-23T09:46:48.504Z DEBUG modem << 04 NRF_NVMC             Non-SecureOK
    2021-02-23T09:46:48.510Z DEBUG modem << 05 NRF_UARTE1           Non-SecureOK
    2021-02-23T09:46:48.513Z DEBUG modem << 06 NRF_UARTE2           SecureSKIP
    2021-02-23T09:46:48.515Z DEBUG modem << 07 NRF_TWIM2            Non-SecureOK
    2021-02-23T09:46:48.518Z DEBUG modem << 08 NRF_SPIM3            Non-SecureOK
    2021-02-23T09:46:48.521Z DEBUG modem << 09 NRF_TIMER0           Non-SecureOK
    2021-02-23T09:46:48.528Z DEBUG modem << 10 NRF_TIMER1           Non-SecureOK
    2021-02-23T09:46:48.531Z DEBUG modem << 11 NRF_TIMER2           Non-SecureOK
    2021-02-23T09:46:48.533Z DEBUG modem << 12 NRF_SAADC            Non-SecureOK
    2021-02-23T09:46:48.536Z DEBUG modem << 13 NRF_PWM0             Non-SecureOK
    2021-02-23T09:46:48.539Z DEBUG modem << 14 NRF_PWM1             Non-SecureOK
    2021-02-23T09:46:48.545Z DEBUG modem << 15 NRF_PWM2             Non-SecureOK
    2021-02-23T09:46:48.547Z DEBUG modem << 16 NRF_PWM3             Non-SecureOK
    2021-02-23T09:46:48.552Z DEBUG modem << 17 NRF_WDT              Non-SecureOK
    2021-02-23T09:46:48.554Z DEBUG modem << 18 NRF_IPC              Non-SecureOK
    2021-02-23T09:46:48.556Z DEBUG modem << 19 NRF_VMC              Non-SecureOK
    2021-02-23T09:46:48.564Z DEBUG modem << 20 NRF_FPU              Non-SecureOK
    2021-02-23T09:46:48.566Z DEBUG modem << 21 NRF_EGU1             Non-SecureOK
    2021-02-23T09:46:48.568Z DEBUG modem << 22 NRF_EGU2             Non-SecureOK
    2021-02-23T09:46:48.569Z DEBUG modem << 23 NRF_DPPIC            Non-SecureOK
    2021-02-23T09:46:48.577Z DEBUG modem << 24 NRF_GPIOTE1          Non-SecureOK
    2021-02-23T09:46:48.579Z DEBUG modem << 25 NRF_REGULATORS       Non-SecureOK
    2021-02-23T09:46:48.585Z DEBUG modem << SPM: NS image at 0xc000
    2021-02-23T09:46:48.586Z DEBUG modem << SPM: NS MSP at 0x200111d0
    2021-02-23T09:46:48.587Z DEBUG modem << SPM: NS reset vector at 0xdc4d
    2021-02-23T09:46:48.589Z DEBUG modem << SPM: prepare to jump to Non-Secure image.
    2021-02-23T09:46:48.597Z DEBUG modem << *** Booting Zephyr OS build v2.4.0-ncs2  ***
    2021-02-23T09:46:48.598Z DEBUG modem << Error mounting disk.
    2021-02-23T09:46:48.600Z DEBUG modem << [00:00:00.004,058] [1;31m<err> main: Storage init ERROR![0m
    2021-02-23T09:46:48.604Z DEBUG modem << [00:00:00.004,089] [1;31m<err> fs: fs mount error (-5)[0m
    

    How have you connected your SD card to the board?

    What pins are you using? Please make sure to use pins that are not controlled by the board controller.

    If you are using pins controlled by it, have you configured the board controller?

    Have you verified correct output to pins in your overlay? Please measure the output on the pins connected to your SD card to verify functionality using a oscilloscope. 

    Kind regards,
    Øyvind

  • i am not using the kit we designed a custom pcb which includes the sd card so not role of the kit controller settings i think.

  • Øyvind said:
    Have you verified correct output to pins in your overlay? Please measure the output on the pins connected to your SD card to verify functionality using a oscilloscope. 

     You did not answer my question.

Related