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

SPI Master initialization with BLE

Hi,

I've been trying to implement a SPI master module in the example ble_app_hrs_c_s120 on the nRF51 DK with nRF51422 (I copied the code of the example of spi_master in the BLE example).

It compiles without error nor warnings but doesn't work. After debugging, I found out that it's the configuration of the SPIM that causes a HardFault at the exact line :

// Configure SPI master.
spi_master_config_t spi_config = SPI_MASTER_INIT_DEFAULT;

The symbol is defined as :

#define SPI_MASTER_INIT_DEFAULT                                             \
{                                                                           \
    SPI_FREQUENCY_FREQUENCY_M1, /**< Serial clock frequency 1 Mbps. */      \
    SPI_PIN_DISCONNECTED,       /**< SCK pin DISCONNECTED. */               \
    SPI_PIN_DISCONNECTED,       /**< MISO pin DISCONNECTED. */              \
    SPI_PIN_DISCONNECTED,       /**< MOSI pin DISCONNECTED. */              \
    SPI_PIN_DISCONNECTED,       /**< Slave select pin DISCONNECTED. */      \
    APP_IRQ_PRIORITY_LOW,       /**< Interrupt priority LOW. */             \
    SPI_CONFIG_ORDER_LsbFirst,  /**< Bits order LSB. */                     \
    SPI_CONFIG_CPOL_ActiveHigh, /**< Serial clock polarity ACTIVEHIGH. */   \
    SPI_CONFIG_CPHA_Leading,    /**< Serial clock phase LEADING. */         \
    0                           /**< Don't disable all IRQs. */             \
};

I really can't figure out why it doesn't find the symbol. It's defined in spi_master.h that I included in the main.

The SD S120 is downloaded on the board and I use uvision 5.14 with the SDK 8.0.

Do you have any idea?

Thank you so much for your help, I'm stuck.

Yann

Parents Reply Children
No Data
Related