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

How to write SDcard with fatfs on different pin.

Hi,

I am using fatfs of nRF5_SDK_15.0.0_a53641a.

I am writing a program with keil.

I am currently doing SPI communication with BLENanov2(nRF52832) and SD card with fatfs. 

#define SDC_SCK_PIN     2   ///< SDC serial clock (SCK) pin.
#define SDC_MOSI_PIN    29  ///< SDC serial data in (DI) pin.
#define SDC_MISO_PIN    30  ///< SDC serial data out (DO) pin.
#define SDC_CS_PIN      28  ///< SDC chip select (CS) pin.

I tried writing fatfs by SPI communication with the pin setting as above and it was possible to write without problem.

At this time, in sdk_config

// <e> SPI0_ENABLED - Enable SPI0 instance
//==========================================================
#ifndef SPI0_ENABLED
#define SPI0_ENABLED 1
#endif
// <q> SPI0_USE_EASY_DMA  - Use EasyDMA
 
#ifndef SPI0_USE_EASY_DMA
#define SPI0_USE_EASY_DMA 1
#endif
// </e>
// <e> SPI1_ENABLED - Enable SPI1 instance
//==========================================================
#ifndef SPI1_ENABLED
#define SPI1_ENABLED 0
#endif
// <q> SPI1_USE_EASY_DMA  - Use EasyDMA
 
#ifndef SPI1_USE_EASY_DMA
#define SPI1_USE_EASY_DMA 1
#endif
// </e>
// <e> SPI2_ENABLED - Enable SPI2 instance

It has become like.
Here,SPI communication will be done with a different pin
#define SDC_SCK_PIN     8   ///< SDC serial clock (SCK) pin.
#define SDC_MOSI_PIN    6  ///< SDC serial data in (DI) pin.
#define SDC_MISO_PIN    7  ///< SDC serial data out (DO) pin.
#define SDC_CS_PIN      3  ///< SDC chip select (CS) pin.
When I set the pin like this,I can not write SDcard.
Please tell me how to resolve.
Thank you.
Related