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

SPI problem with ble_app_beacon example nrf52832

Hi everyone!

I want to implement SPI with "ble_app_beacon" example with the following hw/sw.

DK : nrf52832

SDK : nRF5_SDK_14.2.0_17b948a

IDE : Segger Studio 3.34

OS : Windows10

I have tested both examples standalone and both are working fine. But when I add SPI code into "ble_app_beacon" code, I get the following errors. 

undefined reference to `nrf_drv_spi_init'

undefined reference to `nrf_drv_spi_transfer'

 All include files which are in the SPI example are included in ble_app_beacon example. I have notice that all code of  "nrf_spi_drv.c" file are grayed out. looks like code is already included. Can anyone please help me to resolve these problem.

SPI instance 0, priority 7

Thanks in advance

--vijay

Parents
  • Hello Vijay,

      Have you read the documentation about the SPI driver?

    What SPI code/example are you referring to?

    I would recommend you to take a look at the SPI master example and use that for reference for your SPI.

    You can go into the sdk_config.h file and enable the SPI1:

    With regards to "nrf_drv_spi.h" and "nrf_spi.h": You can see that the "nrf_spi.h" is included in the "nrf_drv_spi.h" file.

    The "nrf_spi.h" is for the SPI HAL, so it is recommended that you include "nrf_drv_spi.h" in your main file and use the freq. parameters as listed there.

    (Anyway, If you right-click and go to definition on the freq. parameters in "nrf_drv_spi.h" you will see that they are defined in "nrf_spi.h")

     

Reply
  • Hello Vijay,

      Have you read the documentation about the SPI driver?

    What SPI code/example are you referring to?

    I would recommend you to take a look at the SPI master example and use that for reference for your SPI.

    You can go into the sdk_config.h file and enable the SPI1:

    With regards to "nrf_drv_spi.h" and "nrf_spi.h": You can see that the "nrf_spi.h" is included in the "nrf_drv_spi.h" file.

    The "nrf_spi.h" is for the SPI HAL, so it is recommended that you include "nrf_drv_spi.h" in your main file and use the freq. parameters as listed there.

    (Anyway, If you right-click and go to definition on the freq. parameters in "nrf_drv_spi.h" you will see that they are defined in "nrf_spi.h")

     

Children
Related