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

NRF52832 FatFs "Disk initialization failed"

Hi,

I'm trying to run fatfs example in sdk. I only changed the spi pin numbers. What is wrong with that?

* @defgroup fatfs_example_main main.c
 * @{
 * @ingroup fatfs_example
 * @brief FATFS Example Application main file.
 *
 * This file contains the source code for a sample application using FAT filesystem and SD card library.
 *
 */


#include "nrf.h"
#include "bsp.h"
#include "ff.h"
#include "diskio_blkdev.h"
#include "nrf_block_dev_sdc.h"


#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"

#define FILE_NAME   "NORDIC.TXT"
#define TEST_STRING "SD card example."

#define SDC_SCK_PIN     5  ///< SDC serial clock (SCK) pin.
#define SDC_MOSI_PIN    6  ///< SDC serial data in (DI) pin.
#define SDC_MISO_PIN    0  ///< SDC serial data out (DO) pin.
#define SDC_CS_PIN      8  ///< SDC chip select (CS) pin.

/**
 * @brief  SDC block device definition
 * */
NRF_BLOCK_DEV_SDC_DEFINE(
        m_block_dev_sdc,
        NRF_BLOCK_DEV_SDC_CONFIG(
                SDC_SECTOR_SIZE,
                APP_SDCARD_CONFIG(SDC_MOSI_PIN, SDC_MISO_PIN, SDC_SCK_PIN, SDC_CS_PIN)
         ),
         NFR_BLOCK_DEV_INFO_CONFIG("Nordic", "SDC", "1.00")
);

Here is RTT screen.

My schematic is;

CS-------------P0.08
MOSI----------P0.06
SCK-----------P0.05
MISO----------P0.00

Thanks..

Parents
  • Hi

    Ok. I recommend (like @awneil suggests) you try this out with a development kit or something similar to narrow down the sources of the problem. If the example works using a development kit, there is likely an issue with your custom board. If it doesn't work using the DK, there's a software issue. This will give us a much better starting point to work from.

    Best regards,

    Simon

Reply
  • Hi

    Ok. I recommend (like @awneil suggests) you try this out with a development kit or something similar to narrow down the sources of the problem. If the example works using a development kit, there is likely an issue with your custom board. If it doesn't work using the DK, there's a software issue. This will give us a much better starting point to work from.

    Best regards,

    Simon

Children
No Data
Related