Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Correct way to merge examples from SDK?

Hi,

I'm using SDK 15.0.0 and NRF52840 DK.

I want to merge couple examples from SDK in one project. As "base" example ble_app_uart was choosed (..nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_uart).

But when I tried to add other peripheral examples, I got errors, which are pretty similar:

Error[Pe020]: identifier "NRF_DRV_SPI_INSTANCE_0" is undefined

and

Error[Pe020]: identifier "NRF_DRV_TWI_INSTANCE_0" is undefined

 

Looks like I need to set some additional settings, but I'm not sure where and what settings, since in preprocessor everything is included as in examples.

Regards!

 

  • As a general approach to this kind of thing, get the peripheral examples working on their own.

    Then you have a reference point to see how it should work: at the points where the above errors occur in your non-working project, go and look at the corresponding place in the working project(s) - and see where the definition is coming from ...

  • This errors came from wrong settings in sdk_config.h file - needed peripherals wasnt enabled there.

    I.e. for spi need to change 0 to 1.