Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

unable to initialize to micro SD card using custom board

Chevalier_nRF52840_schema_v0.pdf

Hello all,

I have some troubles to initialize the micro SD card with my custom board.

I have used the nRF 52 DK to write a basic code and do some test. For micro card SD with the nRF 52 DK I have used this micro card SD reader

Here you can find the basic code. With my custom board the code can not do the initialization function. As the result disk_state = disk_initialize(0); is always true.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "nrf_drv_spi.h"
#include "app_util_platform.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "boards.h"
#include "app_error.h"
#include <string.h>
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "SEGGER_RTT.h"
#include "nrf.h"
#include "bsp.h"
#include "ff.h"
#include "diskio_blkdev.h"
#include "nrf_block_dev_sdc.h"
#include "app_sdcard.h"
#define SPI_INSTANCE 1 /**< SPI instance index. */
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The file to configure the custom board is this one :

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "boards.h"
#ifndef BOARD_CUSTOM_H
#define BOARD_CUSTOM_H
#ifdef __cplusplus
extern "C" {
#endif
#define LEDS_NUMBER 4
#define LED_1 NRF_GPIO_PIN_MAP(1,6)
#define LEDS_ACTIVE_STATE 0
#define LEDS_LIST { LED_1}
#define LEDS_INV_MASK LEDS_MASK
#define BSP_LED_0 13
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and in the make file I have add the path to the file custom_board.h and I have changed the CFLAG like this

CFLAGS += -DBOARD_CUSTOM
# CFLAGS += -DBOARD_PCA10056

Do you have an idea why I can not initialize the micro SD card ?

When looking at the schematic if you find something strange with the antenna or related with the BLE you may have spotted another error as I can not connect to the BLE (but I am able to detect it ! ).

Thank you very much for the help. As you can understand when looking at the custom board schematic, I have spend a lot of time and energy on this project and I start to feel low when running in so complicated problem.

Best regards,

Loïc