<?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>how to integrate twi code with another spi code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24061/how-to-integrate-twi-code-with-another-spi-code</link><description>Hi, 
 I having an nrf52832 board and using gnu arm, nrfjprog to program the device. i reading data from two different sensors using spi and TWI in two different codes. now i need to combine the two project to one, so i tried to add the twi to the spi</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 05 Aug 2017 08:16:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24061/how-to-integrate-twi-code-with-another-spi-code" /><item><title>RE: how to integrate twi code with another spi code</title><link>https://devzone.nordicsemi.com/thread/94747?ContentTypeID=1</link><pubDate>Sat, 05 Aug 2017 08:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9f2ec36-ffb0-4d94-a79b-6216823b4d02</guid><dc:creator>madblue</dc:creator><description>&lt;p&gt;thank you Roger Clark, the informations you have shared is very helpful and appreciate it very much :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to integrate twi code with another spi code</title><link>https://devzone.nordicsemi.com/thread/94750?ContentTypeID=1</link><pubDate>Sat, 05 Aug 2017 08:15:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0317cf67-bd38-40f3-a8c3-8b8fe6ff9942</guid><dc:creator>madblue</dc:creator><description>&lt;p&gt;Thank you so much Nguyen Hoan Hoang,
it did solve my issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to integrate twi code with another spi code</title><link>https://devzone.nordicsemi.com/thread/94749?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 08:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb59ff20-091a-45f9-8706-f56ad95ef19c</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@madblue: This is stated in the Memory section of the nRF52832 Product Specification, &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html?cp=2_1_0_7_3#topic"&gt;here&lt;/a&gt; is the link. You will need to change either&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SPI_INSTANCE  0 /**&amp;lt; SPI instance index. */
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TWI_INSTANCE_ID     0
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in your code to use another instance, e.g. &lt;code&gt;TWI_INSTANCE_ID 1&lt;/code&gt; in addition to enabling this in the sdk_config.h file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to integrate twi code with another spi code</title><link>https://devzone.nordicsemi.com/thread/94748?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 00:09:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e766686-c77b-4b62-b1a8-2ebd4e4d1bbb</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;SPI and TWI are shared resources.  You cannot use SPI0 at the same time with twi0.  You can use spi0 and twi1 or vice versa.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to integrate twi code with another spi code</title><link>https://devzone.nordicsemi.com/thread/94746?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 23:56:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:230ec328-1703-4741-b7f4-f4b3782d7547</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Many commercial GUI&amp;#39;s are available that you could use, e.g. Keil, IAR and Segger Embedded Studio.
But I think the cheapest of these is Segger Embedded Studio and the cost is around $1000 USD for a commercial license (rather than a demo license). Keil and IAR are much more expensive&lt;/p&gt;
&lt;p&gt;I doubt if any of the commercial GUI / Toolchains would tell you where the problem is.&lt;/p&gt;
&lt;p&gt;Segger Embedded Studio is just a wrapper for GCC.
Keil and IAR both use their own compilers so will give a different output, but it would basically tell you the same thing.&lt;/p&gt;
&lt;p&gt;i.e you have a multiple definition of&lt;/p&gt;
&lt;p&gt;SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler&lt;/p&gt;
&lt;p&gt;You should look in your code for this function, as you have defined it twice, or somehow included implementations of it twice&lt;/p&gt;
&lt;p&gt;Then probably change your code so that the same function in the two differences has different names, and adjust your setup code accordingly to use the new function names.&lt;/p&gt;
&lt;p&gt;BTW.
This is development 101, its not specific to the Nordic products / SDK / API or toolchain&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>