Re: Enable SPI driver on nrf52840

Jan Van Winkel <jan.van_winkel@...>

Hi Chuck,

On top of CONFIG_SPI you have to specify which SPI interface your are using, that it is a NRFX SPI and the associated pins in your prj.conf.

Here is an example for the nrf52840_pca10056 I used in a pull request (#6826):


On Thu, Aug 23, 2018 at 6:03 AM Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:
Hi Chuck,

All that I am sayings is, do not modify your repository, do not add anything to prj,conf file.
execute cmake, then either use make or ninja for the target config or menuconfig. Then you get to the Kconfig options for SPI and I2C drivers, select and fill all necessary details like the IRQ priorities and pins etc.
Mind you if the dependencies are not filled correctly, you will need to start all over again (clean, seems some issue with unassigned values to Kconfig options).

Meanwhile, issue with cmake or make failing fatally for missing dependencies will be looked into,

Sebastian / Ulf,
Seems the make menuconfig is un-usable if dependencies like pin assignments are missing after enabling SPI driver for nRF52840.


On 23 Aug 2018, at 04:16, cpmcparland@... wrote:


Thanks for being persistent in looking at this issue.  Sorry for some confusion, I probably didn't state
the behavior I'm seeing very clearly.  At this point, the issue is that the cmake does NOT properly
complete when I include "CONFIG_SPI=y" in the prj.conf file.  My comment about menuconfig  was
just that, in my situation, it was not usable because the make files had not been created by the
cmake script that failed......sorry if that caused some confusion.

When I add CONFIG_SPI=y to the prj.conf file and do a clean cmake for BOARD=nrg52840_pca10056, I
get the following error from cmake:

CMake Error at ../../../CMakeLists.txt:527 (message):
  The Zephyr library 'drivers__spi' was created without source files.  Empty
  (non-imported) libraries are not supported.  Either make sure that the
  library has the sources it should have, or make sure it is not created when
  it has no source files.

Cmake has created all directories in my target directory (......./build/nrf52840_pca10056/zephyr/drivers/......)
But, no source files have been copied into them from the kernel tree.

When I do the same operation, but targeting a different board (arduino_101), the directories get created
and, under target directory root (...../build/arduino_101/zephyr/drivers/spi), the correct board drivers have
been copied.  Cmake completes successfully and the make also completes successfully.

Is there a magic "CONFIG_XXX" that I just don't know about?


Join { to automatically receive all group messages.