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

nrf5340 adding SPI Master driver to the sample project on board name nrf5340dk_nrf5340_cpuapp

Hi,

I have just started playing with nrf connect sdk.

Things I have achieved so far:

1. Build the code.

2. Download the sample codes.

3. Evaluate the performance of the peripheral by connecting to the nrf dongle(PC).

Things I am struggling with:

1. The projects for the board name "nrf5340dk_nrf5340_cpuapp" do not have spi drivers linked to the project.

I need help with:

1. How do I link the SPI drivers to the sample projects?

2. How can I create new .c and .h files and link to the main sample project?

3. Do you have any sample SPI libraries for ADS1298 made for nordic micros ?

Thanks.

  • Hi,

    1. The SPI driver is included by adding this config to prj.conf:

    CONFIG_SPI=y

    2. New source files can be added to the target sources in the CMakeLists.txt file, here is an example for a file at <Project>/src/new_file.c :

    target_sources(app PRIVATE src/main.c
        src/new_file.c)

    New header files can be added in the CMakeLists.txt file as well, here is an example for files in <Project>/include :

    zephyr_include_directories(include)

    Looking at the CMakeLists.txt of larger samples can also give you an idea how their files are organized and included.

    3. Unfortunately, I am not aware of any code for implementing ADS1298, but there are a handful of cases here on devzone if you search for "ADS1298". Those might be helpful.

Related