<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66611/spi-i2c-step-on-nrf52833-to-read-bmi160-outputs</link><description>Hello, 
 
 I am trying to read BMI160 outputs using SPI protocol but I am struggling to get a successful build from my code. 
 The build fails at the first line of my code // static nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE( 0 ); // SPI instance// 
 The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2020 13:14:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66611/spi-i2c-step-on-nrf52833-to-read-bmi160-outputs" /><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/273766?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 13:14:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0c68a59-94ce-448d-bd49-9691142a94c5</guid><dc:creator>Katie Newell</dc:creator><description>&lt;p&gt;Thank you so so much Edwin. This is a very clear answer. I do understand now. This is helping getting familiar with the Nordic environment.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was using SDK 17.0.0. I just downloaded 17.0.2 and added my bmi160 program into the spi project. The project has successfully built whereas it hasn&amp;#39;t in the spi project of SDK 17.0.0.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/273753?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 12:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49088846-5305-41e7-97a3-49e923950e12</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Not on this particularly, as far as I know. Only the general documentation on infocenter.nordicsemi.com.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what SDK you are using, so I&amp;#39;ll try to explain using SDK17.0.2. If you are starting the development now, I suggest you use this SDK version.&lt;/p&gt;
&lt;p&gt;Take a look at the example found in SDK\examples\peripheral\spi\&lt;/p&gt;
&lt;p&gt;This example also uses SPI instance 0. If you search for &amp;quot;&lt;span&gt;NRF_DRV_SPI_INSTANCE_0&amp;quot; in this project, you will see that you will see some hits in the file nrf_drv_spi.h, but they are not that obvious what they are doing. On top of that there is the NRFX definitions and NRF definitions that seems to be fighting eachother, which may be quite confusing. I am sorry for this.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let us start from main.c:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_DRV_SPI_INSTANCE(SPI_INSTANCE) is a macro. Since SPI_INSTANCE is defined as 0, it basically says: NRF_DRV_SPI_INSTANCE(0);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_DRV_SPI_INSTANCE() is a macro that takes one parameter as input. This is defined in nrf_drv_spi.h on line 119.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_DRV_SPI_INSTANCE(id)    NRF_DRV_SPI_INSTANCE_(id)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_DRV_SPI_INSTANCE_(id) is another macro, which is set to:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_DRV_SPI_INSTANCE_ ## id, meaning that whenevery you write NRF_DRV_SPI_INSTANCE(0) it is translated to NRF_DRV_SPI_INSTANCE_0.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now, if this is not defined, you will get this error message that you are seeing because you set&amp;nbsp;nrf_drv_spi_t spi = something that is not defined.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you look further down in nrf_drv_spi.h, there are some definitions of NRF_DRI_SPI_INSTANCE_0, but they are only defined if some conditions are fulfilled:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if NRFX_CHECK(NRFX_SPIM0_ENABLED)
    #define NRF_DRV_SPI_INSTANCE_0 \
        { 0, { .spim = NRFX_SPIM_INSTANCE(0) }, true }
#elif NRFX_CHECK(NRFX_SPI0_ENABLED)
    #define NRF_DRV_SPI_INSTANCE_0 \
        { 0, { .spi = NRFX_SPI_INSTANCE(0) }, false }
#endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So either NRFX_CHECK(NRF_SPIM0_ENABLED) or NRFX_CHECK(NRFX_SPI0_ENABLED) needs to return true.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;the macro NRFX_CHECK() just checks that the define inside the parenthesis is defined&amp;nbsp;&lt;strong&gt;and&lt;/strong&gt; it is set to true/1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In this example, NRFX_SPIM0_ENABLED is actually true, although it is a bit confusing. If you look in sdk_config.h line 514, you see that it is defined to 0 (so it really shouldn&amp;#39;t have returned true). But if you search your project for NRFX_SPIM0_ENABLED, you see that it is used in a file called apply_old_config.h. Look at that file, line 811-871:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if defined(SPI_PRESENT) &amp;amp;&amp;amp; !defined(SPIM_PRESENT)

#undef NRFX_SPI0_ENABLED
#define NRFX_SPI0_ENABLED   SPI0_ENABLED
#undef NRFX_SPIM0_ENABLED
#define NRFX_SPIM0_ENABLED  0

#undef NRFX_SPI1_ENABLED
#define NRFX_SPI1_ENABLED   SPI1_ENABLED
#undef NRFX_SPIM1_ENABLED
#define NRFX_SPIM1_ENABLED  0

#undef NRFX_SPI2_ENABLED
#define NRFX_SPI2_ENABLED   SPI2_ENABLED
#undef NRFX_SPIM2_ENABLED
#define NRFX_SPIM2_ENABLED  0

#elif !defined(SPI_PRESENT) &amp;amp;&amp;amp; defined(SPIM_PRESENT)

#undef NRFX_SPI0_ENABLED
#define NRFX_SPI0_ENABLED   0
#undef NRFX_SPIM0_ENABLED
#define NRFX_SPIM0_ENABLED  SPI0_ENABLED

#undef NRFX_SPI1_ENABLED
#define NRFX_SPI1_ENABLED   0
#undef NRFX_SPIM1_ENABLED
#define NRFX_SPIM1_ENABLED  SPI1_ENABLED

#undef NRFX_SPI2_ENABLED
#define NRFX_SPI2_ENABLED   0
#undef NRFX_SPIM2_ENABLED
#define NRFX_SPIM2_ENABLED  SPI2_ENABLED

#else // -&amp;gt; defined(SPI_PRESENT) &amp;amp;&amp;amp; defined(SPIM_PRESENT)

#undef NRFX_SPI0_ENABLED
#define NRFX_SPI0_ENABLED   (SPI0_ENABLED &amp;amp;&amp;amp; !SPI0_USE_EASY_DMA)
#undef NRFX_SPIM0_ENABLED
#define NRFX_SPIM0_ENABLED  (SPI0_ENABLED &amp;amp;&amp;amp; SPI0_USE_EASY_DMA)

#undef NRFX_SPI1_ENABLED
#define NRFX_SPI1_ENABLED   (SPI1_ENABLED &amp;amp;&amp;amp; !SPI1_USE_EASY_DMA)
#undef NRFX_SPIM1_ENABLED
#define NRFX_SPIM1_ENABLED  (SPI1_ENABLED &amp;amp;&amp;amp; SPI1_USE_EASY_DMA)

#undef NRFX_SPI2_ENABLED
#define NRFX_SPI2_ENABLED   (SPI2_ENABLED &amp;amp;&amp;amp; !SPI2_USE_EASY_DMA)
#undef NRFX_SPIM2_ENABLED
#define NRFX_SPIM2_ENABLED  (SPI2_ENABLED &amp;amp;&amp;amp; SPI2_USE_EASY_DMA)

#endif // -&amp;gt; defined(SPI_PRESENT) &amp;amp;&amp;amp; defined(SPIM_PRESENT)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So first, if SPI_ENABLED is defined (which it is) and&amp;nbsp;then there are a few #ifs that are not true:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#if defined(SPI_PRESENT) &amp;amp;&amp;amp; !defined(SPIM_PRESENT)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#elif !defined(SPI_PRESENT) &amp;amp;&amp;amp; defined(SPIM_PRESENT)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;which both return false.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That means that we jump to:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#else // -&amp;gt; defined(SPI_PRESENT) &amp;amp;&amp;amp; defined(SPIM_PRESENT)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;which is true.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;then NRFX_SPIM0_ENABLED is &lt;strong&gt;undefined&lt;/strong&gt;, and defined to:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(SPI0_ENABLED &amp;amp;&amp;amp; SPI0_USE_EASY_DMA)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To be clear, NRFX_SPI0_ENABLED will be false (0), and NRFX_SPIM0_ENABLED will be set to true (1).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now, since NRFX_SPIM0_ENABLED is defined to 1, that means that the original check in nrf_drv_spi.h will be:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#if NRFX_CHECK(NRFX_SPIM0_ENABLED) which will return true, and&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; #define NRF_DRV_SPI_INSTANCE_0 \&lt;br /&gt; { 0, { .spim = NRFX_SPIM_INSTANCE(0) }, true }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;will define NRF_DRV_SPI_INSTANCE_0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is why I asked you to set SPI_ENABLED to 1, SPI_ENABLED to 1 and SPI0_USE_EASY_DMA to 1. Using that combination, apply_old_config.h will set the rest. Is apply_old_config.h included in your project? in the spi example this is included via:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrfx_glue.h, which is included by nrfx.h, which is included by a lot of files, among others from nrf_drv_spi.h, nrfx_spi.h, nrfx_spim.h and a lot more.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/273663?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 08:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05b68eaf-91ab-4dc9-875c-068c98bf0ee1</guid><dc:creator>Katie Newell</dc:creator><description>&lt;p&gt;Hi Edwin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am new to Embedded code. I am really to struggling to set everything up properly. I believe there are many settings I am not aware of. Is there a document/guide to help me with this?&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/273580?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 17:23:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a95a0f1a-d60f-4f32-b12f-86e6a9fb53b0</guid><dc:creator>Katie Newell</dc:creator><description>&lt;p&gt;Thank you Edwin.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;did the settings in&amp;nbsp;&lt;span&gt;sdk_config.h.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am having the follwoing error in nrf_drv_spi.h:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;#39;NRF_DRV_SPI_INSTANCE_0&amp;#39; undeclared here (not in a function); did you mean &amp;#39;NRF_DRV_SPI_INSTANCE_&amp;#39;?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand why. It is exactly like in the spi example.&amp;nbsp;Could you help me please?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/272875?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 07:41:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e376647-5eb0-4e3c-b83d-9b0186cffbcc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So you want to use the SPI 0 instance. Please make sure these are set in sdk_config.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define SPI_ENABLED 1
#define SPI0_ENABLED 1
#define SPI0_USE_EASY_DMA 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;These are the same settings that are set in the spi example from SDK\examples\peripheral\spi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/272632?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 20:35:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b5d196b-7b7c-4744-9bf5-dad9a2500260</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;not used an&amp;nbsp;nRF52833, so don&amp;#39;t know.&lt;/p&gt;
&lt;p&gt;suggest you start with an SDK example which has working SPI ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/272627?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 19:10:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2da4d9b9-b29c-4748-a225-4d7949a9a748</guid><dc:creator>Katie Newell</dc:creator><description>&lt;p&gt;Thank you Awneil.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry for the code post. I repost it below.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you tell me please what settings I need to made into&amp;nbsp;&lt;strong&gt;sdk_config.h&lt;/strong&gt; ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/272625?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 19:06:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33260c2e-c5c7-42e9-80b1-0555d49e15ae</guid><dc:creator>Katie Newell</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_drv_saadc.h&amp;quot;
#include &amp;quot;nrf_drv_ppi.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;nrf_drv_twi.h&amp;quot;
#include &amp;quot;nrf_drv_spi.h&amp;quot;
#include &amp;quot;nrf_drv_spis.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;sdk_config.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf_gpio.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#include &amp;quot;bmi160.h&amp;quot;


#define SPI_SS_PIN 28 
#define SPI_MISO_PIN 12 
#define SPI_MOSI_PIN 25
#define SPI_SCK_PIN 29

static nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE( 0 );  // SPI instance
struct bmi160_dev sensor ; // bmi160 sensor struct 


void user_delay_ms(uint32_t period) { 
	// delay time
	
	
  nrf_delay_ms( period ) ;
} // user_delay_ms()

static uint8_t       no_use = 0xFF ;

int8_t spi1_read_transfer(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t length)
{
	ret_code_t ret ;
	uint8_t read_temp[ length + 1 ] ;
	
    ret = nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;reg_addr, 1, read_temp, length + 1 ) ;	
	nrf_delay_ms(5); 
	
	for( int i = 1 ; i &amp;lt; length + 1 ; i ++ )
	  reg_data[i-1] = read_temp[i] ;
	
	return (int8_t)ret;	
}

int8_t spi1_write_transfer(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t length)
{
	ret_code_t ret;
	uint8_t write_temp[ length + 1 ] ;
	write_temp[0] = reg_addr ;
	for( int i = 1 ; i &amp;lt; length + 1 ; i ++ )
	  write_temp[i] = reg_data[i-1] ;

    ret = nrf_drv_spi_transfer(&amp;amp;spi, write_temp, length + 1, &amp;amp;no_use, 1 ) ;
	nrf_delay_ms(5) ;
	
	return (int8_t)ret;	
}

int main(void){   
	
    bsp_board_init(BSP_INIT_LEDS);
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

  	// init spi // 
  	nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG; 
        spi_config.ss_pin   = SPI_SS_PIN; 
        spi_config.miso_pin = SPI_MISO_PIN;
        spi_config.mosi_pin = SPI_MOSI_PIN;
        spi_config.sck_pin  = SPI_SCK_PIN;

    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, NULL, NULL));
		
  	// init bmi160 sensor // 
	sensor.id = 0 ; 
        sensor.interface = BMI160_SPI_INTF;
        sensor.read = spi1_read_transfer;
        sensor.write = spi1_write_transfer;
        sensor.delay_ms = user_delay_ms;

	int8_t rslt = BMI160_OK;
        uint8_t reg_addr = BMI160_CHIP_ID_ADDR; // chip_id address // chip_id
        uint8_t data;
        uint16_t len = 1;
    rslt = bmi160_get_regs(reg_addr, &amp;amp;data, len, &amp;amp;sensor); // read sensor chip_id // 

    // print result // 
		SEGGER_RTT_printf( 0, &amp;quot;rslt = %d \n&amp;quot;, rslt ) ; 
		SEGGER_RTT_printf( 0, &amp;quot;data = %d \n&amp;quot;, data ) ; 
		
} 





&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI/I2C Step on nRF52833 to read BMI160 outputs</title><link>https://devzone.nordicsemi.com/thread/272622?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 18:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c2272ed-3aa7-4c65-a711-9082d716e542</guid><dc:creator>awneil</dc:creator><description>[quote userid="93931" url="~/f/nordic-q-a/66611/spi-i2c-step-on-nrf52833-to-read-bmi160-outputs"]The complier doesn&amp;#39;t recognise NRF_DRV_SPI_INSTANCE even though it is in the libraries into nrf_drv_spi library[/quote]
&lt;p&gt;Have you made the necessary settings in &lt;strong&gt;sdk_config.h&lt;/strong&gt; ?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601577668937v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>