<?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>using spi in bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15045/using-spi-in-bootloader</link><description>Hi, 
 i&amp;#39;m doing my own bootloader and i want to use external flash to download image trough a spi. The bootloader project based on example from SDK11, now just an external flash interface is added by me.The problem is that spi only works if softdevice</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jul 2016 10:40:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15045/using-spi-in-bootloader" /><item><title>RE: using spi in bootloader</title><link>https://devzone.nordicsemi.com/thread/57414?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2016 10:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27552826-b6e8-4bc4-b86f-79fb9a1fb333</guid><dc:creator>Konstantin</dc:creator><description>&lt;p&gt;The problem is solved, it was my fault. I forget to set the CONFIG_NFCT_PINS_AS_GPIOS key for the bootloader project (since in my pCB spi uses pin 9 - shared this NFCT) but set it for my application project. So accidentally run of app set pin 9 as gpio and enables the SD. I misplaced that signs as enabling the SD in bootloader project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using spi in bootloader</title><link>https://devzone.nordicsemi.com/thread/57413?ContentTypeID=1</link><pubDate>Sun, 10 Jul 2016 00:19:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4fb5019-cae4-429c-b07b-fcd27a6f73a6</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Nothing comes to mind instantly. It&amp;#39;s not clock source, the SPI module will start the HF clock it needs when it needs it, it doesn&amp;#39;t need a LF clock so that&amp;#39;s not it.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re writing the registers directly and not getting anything then that&amp;#39;s even more odd. All these peripherals work just fine standalone and there&amp;#39;s very little that requires setting up before you use them, unlike other MCUs you don&amp;#39;t have to set up a complicated clock and power config, it&amp;#39;s all automatic.&lt;/p&gt;
&lt;p&gt;The only other thought I had was that just having SOFTDEVICE_PRESENT defined, which you do if you&amp;#39;re building something with a softdevice makes some of the library code use sd_ calls instead of native ones, however I didn&amp;#39;t find anything like that when I was looking.&lt;/p&gt;
&lt;p&gt;Try setting PSEL, FREQUENCY, TXD and RXD, CONFIG and ENABLE (make sure you write 7 to that) and starting the task, just to prove it works natively.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using spi in bootloader</title><link>https://devzone.nordicsemi.com/thread/57412?ContentTypeID=1</link><pubDate>Sat, 09 Jul 2016 19:01:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:532de333-4faa-4467-a680-800f862f4b44</guid><dc:creator>Konstantin</dc:creator><description>&lt;p&gt;Hi, RK&lt;/p&gt;
&lt;p&gt;I understand the spi does not require SD but in this my experience it doesn&amp;#39;t work without properly enabled SD, and i wonder why. Yes, the project uses SD, it is a bootloader for DFU via BLE.&lt;/p&gt;
&lt;p&gt;nrf_drv_spi.c, line 495, while (!nrf_spim_event_check(p_spim, NRF_SPIM_EVENT_END)){}
In that line the program is looped. That means we are waiting for an ending flag. In debugger all NRF_SPI1 module registers settings seems to be correct, but no any physical activity on spi pins. Direct write in debugger in NRF_SPI1-&amp;gt;START_TASK also has no effect. It seems like there is no any clock source for the spi module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using spi in bootloader</title><link>https://devzone.nordicsemi.com/thread/57411?ContentTypeID=1</link><pubDate>Sat, 09 Jul 2016 11:54:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e685fb1a-b18f-4c69-ad1c-c27bac90c448</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No it&amp;#39;s not true - the spi driver does not need the softdevice. You can see that for yourself just by looking through the c code, there are no sd_ calls in there. That driver works just fine standalone.&lt;/p&gt;
&lt;p&gt;So your problem may have something else to do with the fact it&amp;#39;s compiled for use with a softdevice but it&amp;#39;s not the spi driver.&lt;/p&gt;
&lt;p&gt;So hit break in your debugger and find out where you are, possibly you asserted or an error code was returned and you&amp;#39;re sitting in a spin loop in an error handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>