<?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>System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20993/system-crash-when-both-use-softdevie-and-spi</link><description>Dear all, 
 My chip is nrf52832, and sdk version is SDK12.1.0_0d232a. And tried to use ble service and spi master function. 
 I create a timer to send spi command every 4 ms. 
 void spi_master_init(void)
{ 
 nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Apr 2017 12:54:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20993/system-crash-when-both-use-softdevie-and-spi" /><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82049?ContentTypeID=1</link><pubDate>Thu, 06 Apr 2017 12:54:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2711b0ce-c941-463a-b8b8-70f54989ffb2</guid><dc:creator>Kevin</dc:creator><description>&lt;p&gt;Hi Kristin,&lt;/p&gt;
&lt;p&gt;I debug using the method that you suggested. And the bug occurred when spi transfer too slow that appeared 0xFF in received data.&lt;/p&gt;
&lt;p&gt;It will overflow and makes crash. After i give the client high priority and check data should not be 0xFF. It looks working normal until now.&lt;/p&gt;
&lt;p&gt;I appreciate your kind assistance!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82048?ContentTypeID=1</link><pubDate>Thu, 06 Apr 2017 08:44:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4584bc6a-ce61-4067-9b0b-9146981c37d4</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Could you upload a screenshot of the Keil window when the hardfault occur?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82047?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 11:31:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec947d5d-b5af-4311-a5e2-9bdc49499f6b</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;&lt;a href="http://www.keil.com/appnotes/files/apnt209.pdf"&gt;This&lt;/a&gt; app note from Keil, section &amp;quot;Debugging Faults with uVision&amp;quot; can be useful for determining where the hardfault occurs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82046?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 06:26:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59cdf6be-0641-41fe-b349-a2a0a75aa00a</guid><dc:creator>Kevin</dc:creator><description>&lt;p&gt;Hi Kristin,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how to see the &lt;strong&gt;hardfault originates from&lt;/strong&gt;. I set break point at HardFault_Handler, i don&amp;#39;t see any other message. Is there any example or method?&lt;/p&gt;
&lt;p&gt;I have tried debug, and it occurred at a strange place.&lt;/p&gt;
&lt;p&gt;I called a function in timer, i can see the debug print in timer. But i don&amp;#39;t see the debug print in called function.&lt;/p&gt;
&lt;p&gt;the code as follow:&lt;/p&gt;
&lt;p&gt;In timer:&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Send spi data\r\n&amp;quot;);&lt;/p&gt;
&lt;p&gt;send_spi_command(type, command, data, 128);&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Send spi data\r\n&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;static uint8_t send_spi_command(uint8_t type, uint8_t command, uint8_t* data, uint8_t length)
{
NRF_LOG_INFO(&amp;quot;Command : %d(%d)\r\n&amp;quot;, command, spi_send_buf);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;memset(data_tmp[spi_send_buf - 1], 0xFF, 256);

data_tmp[spi_send_buf - 1][0] = spi_send_buf;

data_tmp[spi_send_buf - 1][1] = type;

data_tmp[spi_send_buf - 1][2] = command;

if (data != NULL) {

    memcpy(&amp;amp;data_tmp[spi_send_buf - 1][3], data, length);

}

spi_send_counter++;

return 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;static void spi_schedule_handler(void * p_context)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(spi_send_counter &amp;amp;&amp;amp; spi_xfer_done) {

    memset(spi_rx_buf, 0, spi_length);

    nrf_drv_spi_transfer(&amp;amp;spi, data_tmp[spi_send_buf_count - 1], spi_length, spi_rx_buf, spi_length);

    spi_xfer_done = false;

    spi_send_counter--;

    goto end;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I call the function (send_spi_command) to send data, and i print message before and after the command. It only print the first message.&lt;/p&gt;
&lt;p&gt;And it did&amp;#39;t print &lt;strong&gt;NRF_LOG_INFO(&amp;quot;Command : %d(%d)\r\n&amp;quot;, command, spi_send_buf);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82045?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2017 08:56:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4252f7b-a285-4722-9a0d-e05ac4f31258</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;If you run the chip in debug mode, and set a breakpoint in the hardfault handler which location does the hardfault originates from? (When doing this, do not single step, but make the application run until it hits the hardfault.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82044?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 13:31:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fae5d0f8-32ee-403f-9a21-aaf25823257c</guid><dc:creator>Kevin</dc:creator><description>&lt;p&gt;Hi Kristin,&lt;/p&gt;
&lt;p&gt;I print message and it always stoped after timer or spi  handler. If I use debug mode step by step trace, it always happened fatal error.&lt;/p&gt;
&lt;p&gt;I have searched, but I didn&amp;#39;t see the same similar case. No one use timer to do long data transfer(200 bytes) and use both spi master and softdevice&lt;/p&gt;
&lt;p&gt;Thanks!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System crash when both use softdevie and spi</title><link>https://devzone.nordicsemi.com/thread/82043?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 12:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b48f76f-6bce-4258-a978-00a340a8b9fe</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;At which location does your application hardfault?&lt;/p&gt;
&lt;p&gt;Do you have tried to search the forum for a similar case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>