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

Undefine reference to driver files (linker) - nRF Connect SDK v1.4.2

Hi there!

I am using the bluetooth/peripheral_hr sample as a basis for my application, on top of which I need to include the nrfx_qspi driver. However, I get a "undefined reference to nrfx_qspi_init" error during linking. I have tried to move the source file to my /src/drivers directory, modified my prj.conf file to include "CONFIG_NRFX_QSPI=y", and modified my CMakeLists.txt file as follows:

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(peripheral_hr)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE
  ${app_sources}
  )

zephyr_include_directories(src)
zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)

add_subdirectory(src/drivers)



I have looked at a lot of the older forum questions related to this topic. The older ones mention something about a "sdk_config.h" file, but I do not see anything of the sorts.

Any information on how I can move forward would be much appreciated! Thanks in advance.


Parents
  • Hi,

     

    There's no need to copy files and alter the CMakeLists.txt file, unless you are specifically adding your own implementation/handling of the qspi driver.

      

    You should set this config in your project:

    CONFIG_NRFX_QSPI=y

     

    And then include the header in your main.c file:

    #include <nrfx_qspi.h>
     

     

    Then you can add your implementation of the nrfx_qspi driver.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    There's no need to copy files and alter the CMakeLists.txt file, unless you are specifically adding your own implementation/handling of the qspi driver.

      

    You should set this config in your project:

    CONFIG_NRFX_QSPI=y

     

    And then include the header in your main.c file:

    #include <nrfx_qspi.h>
     

     

    Then you can add your implementation of the nrfx_qspi driver.

     

    Kind regards,

    Håkon

Children
No Data
Related