<?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>Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42994/segmentation-fault-after-enabling-ble-stack</link><description>I have my system working with softdevice compiled in but not enabled. System communicates with external chip using SPIM peripheral, everything is working fine until I enable the softdevice. 
 As soon as I issue 
 ret_code_t err_code; err_code = nrf_sdh_enable_request</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Feb 2019 10:31:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42994/segmentation-fault-after-enabling-ble-stack" /><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/169026?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 10:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46b099b9-19a4-4222-8949-02c905bfc666</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Thank you Andreas!&lt;/p&gt;
&lt;p&gt;With this workaround I have no issues running both the isolated test code or my production code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168987?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 08:00:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e63397f-994c-42be-a9e6-1dd48bf26cf9</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi again.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve found this workaround to work without any issues so far:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;THIS WORKAROUND ONLY WORKS WITHOUT THE SOFTDEVICE&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I made the following modifications in the driver file &lt;strong&gt;modules\nrfx\drivers\src\nrfx_spim.c&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;(Starting from line 129)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void app_mwu_enable(void) //WORKAROUND ADDED 2-1-2019
{
  NRF_MWU-&amp;gt;REGIONENSET
    = ((MWU_REGIONENSET_RGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_RGN0WA_Pos) | (MWU_REGIONENSET_PRGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_PRGN0WA_Pos));
  NRF_MWU-&amp;gt;REGIONEN;
}

void app_mwu_disable(void) //WORKAROUND ADDED 2-1-2019
{
  NRF_MWU-&amp;gt;REGIONENCLR
    = ((MWU_REGIONENCLR_RGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_RGN0WA_Pos) | (MWU_REGIONENCLR_PRGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_PRGN0WA_Pos));
  NRF_MWU-&amp;gt;REGIONEN;
}

static uint32_t m_anomaly_198_preserved_value;

static void anomaly_198_enable(uint8_t const * p_buffer, size_t buf_len)
{
    m_anomaly_198_preserved_value = *((volatile uint32_t *)0x40000E00);

    if (buf_len == 0)
    {
        return;
    }
    uint32_t buffer_end_addr = ((uint32_t)p_buffer) + buf_len;
    uint32_t block_addr      = ((uint32_t)p_buffer) &amp;amp; ~0x1FFF;
    uint32_t block_flag      = (1UL &amp;lt;&amp;lt; ((block_addr &amp;gt;&amp;gt; 13) &amp;amp; 0xFFFF));
    uint32_t occupied_blocks = 0;

    if (block_addr &amp;gt;= 0x20010000)
    {
        occupied_blocks = (1UL &amp;lt;&amp;lt; 8);
    }
    else
    {
        do {
            occupied_blocks |= block_flag;
            block_flag &amp;lt;&amp;lt;= 1;
            block_addr  += 0x2000;
        } while ((block_addr &amp;lt; buffer_end_addr) &amp;amp;&amp;amp; (block_addr &amp;lt; 0x20012000));
    }

    app_mwu_disable(); //WORKAROUND ADDED 2-1-2019
    *((volatile uint32_t *)0x40000E00) = occupied_blocks;
    app_mwu_enable(); //WORKAROUND ADDED 2-1-2019
}

static void anomaly_198_disable(void)
{
    app_mwu_disable(); //WORKAROUND ADDED 2-1-2019
    *((volatile uint32_t *)0x40000E00) = m_anomaly_198_preserved_value;
    app_mwu_enable(); //WORKAROUND ADDED 2-1-2019
}
#endif // NRFX_CHECK(NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My main file looks like this now:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;ble_infrastructure.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;

#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nordic_common.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;nrfx_spim.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

#include &amp;quot;ble_infrastructure.h&amp;quot;
#include &amp;quot;power.h&amp;quot;

static void log_init(void) {
	ret_code_t err_code = NRF_LOG_INIT(NULL);
	APP_ERROR_CHECK(err_code);

	NRF_LOG_DEFAULT_BACKENDS_INIT();
}

static const nrfx_spim_t spim = NRFX_SPIM_INSTANCE(3);
static uint8_t       m_tx_buf[2];           /**&amp;lt; TX buffer. */
static uint8_t       m_rx_buf[3];    /**&amp;lt; RX buffer. */
static volatile bool spi_xfer_done;  /**&amp;lt; Flag used to indicate that SPI instance completed the transfer. */

void spim_event_handler(nrfx_spim_evt_t const * p_event, void * p_context)
{
    spi_xfer_done = true;
    NRF_LOG_INFO(&amp;quot;Transfer completed.&amp;quot;);
    if (m_rx_buf[0] != 0)
    {
        NRF_LOG_INFO(&amp;quot; Received:&amp;quot;);
        NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));
    }
}

void spi_init() {

    ret_code_t err_code;
    nrfx_spim_config_t config = NRFX_SPIM_DEFAULT_CONFIG;
    config.frequency = NRF_SPIM_FREQ_16M;
    config.ss_pin   = SPI_SS_PIN;
    config.miso_pin = SPI_MISO_PIN;
    config.mosi_pin = SPI_MOSI_PIN;
    config.sck_pin  = SPI_SCK_PIN;
    config.use_hw_ss= true;
    config.rx_delay = 0;
    config.ss_duration = 0;
    config.orc = 0;

    err_code = nrfx_spim_init(&amp;amp;spim, &amp;amp;config, spim_event_handler, NULL);
    APP_ERROR_CHECK(err_code);
}


#define LED_GREEN_PIN 13
#define LED_RED_PIN 14

void leds_init(void) {
    nrf_gpio_cfg_output(LED_GREEN_PIN);
    nrf_gpio_cfg_output(LED_RED_PIN);
}

void spi_write() {
    ret_code_t error_code2;
	m_tx_buf[0] = 0x42;
	m_tx_buf[1] = 0x42;
	nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
	error_code2 = nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0);
    APP_ERROR_CHECK(error_code2);
}

int main(void) {

    power_management_init();
    log_init();
    leds_init();
    NRF_LOG_INFO(&amp;quot;Hello&amp;quot;);
    nrf_gpio_pin_set(LED_RED_PIN);
	ble_stack_init();
    spi_init();
    spi_write();
    nrf_gpio_pin_clear(LED_RED_PIN);
    nrf_gpio_pin_set(LED_GREEN_PIN);
    while(1) {
	    NRF_LOG_INFO(&amp;quot;I am fine&amp;quot;);
        idle_state_handle();
    }
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;RTT-Viewer output:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5f19d34e09f348ccbb0584f1c09519c0/pastedimage1549008024860v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I hope this works for you as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168867?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 12:33:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f86ee114-86c4-49c5-9e46-5bf979fddf3e</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I just wanted to keep you updated on this issue.I have recompiled the project with code your previous reply and I also experience the invalid memory access. I am still waiting on more information from the SDK team on this issue. If you find anything please let me know, I will do the same of course.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168732?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 14:22:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cbdaa41-733a-494f-9f62-e08ef41633a5</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Also, if this makes a difference, the most complicated form of nrfx_spim_xfer I use is like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(spi_txbuf, 1, curr_buffer, 4);
    nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER | NRFX_SPIM_FLAG_RX_POSTINC | NRFX_SPIM_FLAG_HOLD_XFER | NRFX_SPIM_FLAG_REPEATED_XFER));&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168730?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 14:19:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f69b7b8f-cef1-4168-aaf4-0652d347147d</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Hi Andreas&lt;/p&gt;
&lt;p&gt;Thank you for your post, I have tested the suggestion and we are getting somewhere, but the issue is not fully resolved yet. Simple SPIM initialization and xfer works fine with the MWU workaround you have specified, but more sophisticated initialization still segfaults.&lt;/p&gt;
&lt;p&gt;I have tracked it down to spim handler specification -- if handler is provided for nrfx_spim_init function it still segfaults.&lt;/p&gt;
&lt;p&gt;Maybe another memory region has to be unprotected also?&lt;/p&gt;
&lt;p&gt;This is the code that illustrates the fault:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;ble_infrastructure.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;

#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nordic_common.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;nrfx_spim.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

#include &amp;quot;ble_infrastructure.h&amp;quot;
#include &amp;quot;power.h&amp;quot;

static void log_init(void) {
	ret_code_t err_code = NRF_LOG_INIT(NULL);
	APP_ERROR_CHECK(err_code);

	NRF_LOG_DEFAULT_BACKENDS_INIT();
}

static const nrfx_spim_t spim = NRFX_SPIM_INSTANCE(3);
static uint8_t       m_tx_buf[2];           /**&amp;lt; TX buffer. */
static uint8_t       m_rx_buf[3];    /**&amp;lt; RX buffer. */

void spim_event_handler(nrfx_spim_evt_t const * p_event, void *p_context) {
}

void spi_init() {
    nrfx_spim_config_t config  =NRFX_SPIM_DEFAULT_CONFIG;
    config.frequency = NRF_SPIM_FREQ_16M;
    config.ss_pin   = SPI_SS_PIN;
    config.miso_pin = SPI_MISO_PIN;
    config.mosi_pin = SPI_MOSI_PIN;
    config.sck_pin  = SPI_SCK_PIN;
    config.use_hw_ss= true;
    config.rx_delay = 0;
    config.ss_duration = 0;
    config.orc = 0;

    APP_ERROR_CHECK(nrfx_spim_init(&amp;amp;spim, &amp;amp;config, spim_event_handler, NULL));
}

#define LED_GREEN_PIN 24
#define LED_RED_PIN 25

void leds_init(void) {
    nrf_gpio_cfg_output(LED_GREEN_PIN);
    nrf_gpio_cfg_output(LED_RED_PIN);
}

void spi_write() {
	m_tx_buf[0] = 0x42;
	m_tx_buf[1] = 0x42;
	nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
	APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
}

void app_mwu_enable(void)
{
  NRF_MWU-&amp;gt;REGIONENSET
    = ((MWU_REGIONENSET_RGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_RGN0WA_Pos) | (MWU_REGIONENSET_PRGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_PRGN0WA_Pos));
}

void app_mwu_disable(void)
{
  NRF_MWU-&amp;gt;REGIONENCLR
    = ((MWU_REGIONENCLR_RGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_RGN0WA_Pos) | (MWU_REGIONENCLR_PRGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_PRGN0WA_Pos));
}
int main(void) {

    power_management_init();
    log_init();
    leds_init();
    NRF_LOG_INFO(&amp;quot;Hello&amp;quot;);
    nrf_gpio_pin_set(LED_RED_PIN);
	ble_init();
    app_mwu_disable();
    spi_init();
    spi_write();
    app_mwu_enable();
    nrf_gpio_pin_clear(LED_RED_PIN);
    nrf_gpio_pin_set(LED_GREEN_PIN);
    while(1) {
	    NRF_LOG_INFO(&amp;quot;I am fine&amp;quot;);
        idle_state_handle();
    }
}

&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168699?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 13:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfd3c71d-290d-42e0-b65d-0e63c35634ae</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I have found the same results as you and reported it to the SDK team.&lt;/p&gt;
&lt;p&gt;In the mean time, I think I have a workaround hack that solves the problem somehow:&lt;/p&gt;
&lt;p&gt;In your main.c file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void spi_write() {
    ret_code_t error_code2;
	m_tx_buf[0] = 0x42;
	m_tx_buf[1] = 0x42;
	nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
	error_code2 = nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0);
    APP_ERROR_CHECK(error_code2);
}

void app_mwu_enable(void)
{
  NRF_MWU-&amp;gt;REGIONENSET
    = ((MWU_REGIONENSET_RGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_RGN0WA_Pos) | (MWU_REGIONENSET_PRGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_PRGN0WA_Pos));
}

void app_mwu_disable(void)
{
  NRF_MWU-&amp;gt;REGIONENCLR
    = ((MWU_REGIONENCLR_RGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_RGN0WA_Pos) | (MWU_REGIONENCLR_PRGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_PRGN0WA_Pos));
}



int main(void) {

    power_management_init();
    log_init();
    NRF_LOG_INFO(&amp;quot;Hello&amp;quot;);
	ble_stack_init();
    app_mwu_disable();
    spi_init();
    spi_write();
    app_mwu_enable();
    while(1) {
	    NRF_LOG_INFO(&amp;quot;I am fine&amp;quot;);
        idle_state_handle();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The problem with Invalid Access Memory was that an area protected by the memory watch unit is attempting to be written to when &lt;strong&gt;nrfx_spim_xfer()&lt;/strong&gt; is called. I&amp;#39;ve avoided the error by disabling the memory watch unit before calling any SPIM related API calls, and enabling it afterwards.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5f19d34e09f348ccbb0584f1c09519c0/pastedimage1548853560659v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Could this help you perhaps?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168680?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 11:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f88a57f-b6ff-4557-8bdc-458f880cf022</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;I have looked into my code history - indeed, last time SPI and BLE was working together I have used SPI driver, not SPIM and I have used SPI instance 0.&lt;/p&gt;
&lt;p&gt;I have tried running the same segfault example I have posted before changing SPIM instance from 3 to 1 and it worked flawlessly.&lt;/p&gt;
&lt;p&gt;So yes, I can confirm, SoftDevice has problems working together with SPIM3.&lt;/p&gt;
&lt;p&gt;SPIM3 is pretty critical for our application as I have mentioned in previous post. Please let me know how I could be of assistance in solving this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168433?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 12:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be05c2e9-9c45-440c-9b38-67573ac71747</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;I am not sure - my design pretty much depends on use of SPIM3 because all the additional functionality it has - now I can fill my 40kb buffer completely with no CPU using hardware CS control, also I am using 16MHz - very cool functionality and doing it manually on lower frequency will severely impact my battery life and general design (which is nearing production at fast pace)&lt;/p&gt;
&lt;p&gt;Did I stumble on some kind of undiscovered errata?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168425?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 11:16:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4702f89-b811-48a6-9598-68ea99f3148c</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve found something, but I have to look a bit more into it, in the mean time, is it possible for you to not use SPIM3? Use SPIM0/1/2 instead?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168374?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 06:55:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:609353c3-3a98-4a15-8044-a21cfb8a68ff</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Thanks a lot, Andreas. I am on the move today, but I will have more focus for this tomorrow. At one point in history I had BLE and SPIM working together. I will try and check.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168372?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 06:44:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53bcc53a-2eee-4a42-afe0-7da30920dd17</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I did not have logging enabled, but when I added logging to your project I got &amp;quot;I am fine&amp;quot; in the log.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5f19d34e09f348ccbb0584f1c09519c0/pastedimage1548743542275v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I tried to run debugging a few times, and then I got an Invalid state error:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5f19d34e09f348ccbb0584f1c09519c0/pastedimage1548743694306v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Followed by Invalid Memory Access errors:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5f19d34e09f348ccbb0584f1c09519c0/pastedimage1548744192059v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I will look a bit more into this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168219?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 12:51:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72206dfe-62a2-4162-869a-bac227d8117b</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Hm. This is strange. And you are getting &amp;quot;I am fine&amp;quot; in the log?&lt;/p&gt;
&lt;p&gt;I will try running the same code on a devboard. I get segfault without any debugging and adding any breakpoints.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168209?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 12:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd6b6d5f-1925-446a-a964-6a98bd93fb45</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Correct, I did not receive any errors. Are you adding breakpoints while debugging? This could trigger a SoftDevice assertion.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168202?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 12:15:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d2064bf-cd16-46c6-9558-74529baa57b4</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;So you mean you didn&amp;#39;t get segfault when running it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/168170?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 09:26:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:018ce696-81e6-47f5-a6e3-7779a05b7a8f</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried to debug your code in Ozone, but I always end up in the &lt;strong&gt;idle_state_handler()&lt;/strong&gt;, so I cant recreate the error you have when trying to enable the SoftDevice.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/167968?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 14:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdf7dd7d-cc53-4439-9461-8b5e1e8856cb</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;I am using the latest SDK - &lt;span id="heading"&gt;v15.2.0&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;I have collected a simple example where I use minimal set of peripherals - just power management, spim and BLE -- see a zip in my other post.&lt;/p&gt;
&lt;p&gt;I have copied spim config from examples. I did not change the example spim IRQ priority which is set at 6.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/167958?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 14:03:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67858ec1-3049-4987-9e23-5fc4a5584133</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Which SDK are you using?&lt;/p&gt;
&lt;p&gt;Are you using an example, or have you configured SPIM yourself?&lt;/p&gt;
&lt;p&gt;Are you using any other peripherals?&lt;/p&gt;
&lt;p&gt;Which interrupt priority level have you given them? If they are default then that is 0 which is not allowed by the SoftDevice.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/167904?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 12:34:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1a5ef94-3a31-451f-a1c2-937d912c47cd</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;I am attaching some code that demonstrates the problem. Note, I am running it on my own board, so logging is on different pins than devboards&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/segfault.zip"&gt;devzone.nordicsemi.com/.../segfault.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/167886?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 11:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e95ac46f-c18e-476e-b8a3-b6c12b41ceb5</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;I am using s140. I have tried single stepping thru code, the problem definitely is due to spim_xfer, but I could not pinpoint the exact line that throws the Segfault. If I step thru SPIM functions I can step thru all of them without error, and the segfault happens while doing nrfx_spim_uninit(&amp;amp;spim), but if I run it without debugging spim_xfer never returns.&lt;/p&gt;
&lt;p&gt;Below is my debugging session:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Breakpoint 1, main () at .//main.c:179
179        ads1293_init();
(gdb) s
ads1293_init () at .//ads1293.c:284
284        power_init();
(gdb) n
285        power_on();
(gdb) n
283    void ads1293_init() {
(gdb) n
284        power_init();
(gdb) n
286        delay(1);
(gdb) n
285        power_on();
(gdb) n
289        spi_init();
(gdb) n
286        delay(1);
(gdb) n
287        clock_pin_init(ADS1293_CLK_IN_PIN);
(gdb) n
289        spi_init();
(gdb) n
290        ads1293_write_register(CONFIG, 2);
(gdb) s
ads1293_write_register (value=2 &amp;#39;\002&amp;#39;, reg=CONFIG) at .//ads1293.c:299
299        nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
(gdb) n
297        m_tx_buf[0] = COMMAND_WRITE &amp;amp; reg;
(gdb) n
299        nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
(gdb) n
297        m_tx_buf[0] = COMMAND_WRITE &amp;amp; reg;
(gdb) n
300        APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
(gdb) s
298        m_tx_buf[1] = value;
(gdb) n
300        APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
(gdb) n
298        m_tx_buf[1] = value;
(gdb) n
297        m_tx_buf[0] = COMMAND_WRITE &amp;amp; reg;
(gdb) n
300        APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
(gdb) s
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:561
561        spim_control_block_t * p_cb = &amp;amp;m_cb[p_instance-&amp;gt;drv_inst_idx];
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
560    {
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
560    {
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
560    {
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
581            if (p_cb-&amp;gt;handler &amp;amp;&amp;amp; !(flags &amp;amp; (NRFX_SPIM_FLAG_REPEATED_XFER |
(gdb) n
588        p_cb-&amp;gt;evt.xfer_desc = *p_xfer_desc;
(gdb) n
590        if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
588        p_cb-&amp;gt;evt.xfer_desc = *p_xfer_desc;
(gdb) n
590        if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
588        p_cb-&amp;gt;evt.xfer_desc = *p_xfer_desc;
(gdb) n
590        if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
593            if (!p_cb-&amp;gt;use_hw_ss)
(gdb) n
596                if (p_cb-&amp;gt;ss_active_high)
(gdb) n
602                    nrf_gpio_pin_clear(p_cb-&amp;gt;ss_pin);
(gdb) n
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) s
spim_xfer (flags=0, p_xfer_desc=0x2003ffac, p_cb=0x20003b24 &amp;lt;m_cb+44&amp;gt;, p_spim=0x4002f000) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:475
475        if ((p_xfer_desc-&amp;gt;p_tx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_tx_buffer)) ||
(gdb) n
476            (p_xfer_desc-&amp;gt;p_rx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_rx_buffer)))
(gdb) n
475        if ((p_xfer_desc-&amp;gt;p_tx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_tx_buffer)) ||
(gdb) n
476            (p_xfer_desc-&amp;gt;p_rx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_rx_buffer)))
(gdb) n
487        p_cb-&amp;gt;tx_length = 0;
(gdb) n
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:607
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) s
spim_xfer (flags=0, p_xfer_desc=0x2003ffac, p_cb=0x20003b24 &amp;lt;m_cb+44&amp;gt;, p_spim=&amp;lt;optimized out&amp;gt;) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:488
488        p_cb-&amp;gt;rx_length = 0;
(gdb) n
491        nrf_spim_tx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_tx_buffer, p_xfer_desc-&amp;gt;tx_length);
(gdb) n
492        nrf_spim_rx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_rx_buffer, p_xfer_desc-&amp;gt;rx_length);
(gdb) n
495        if (p_spim == NRF_SPIM3)
(gdb) n
492        nrf_spim_rx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_rx_buffer, p_xfer_desc-&amp;gt;rx_length);
(gdb) n
495        if (p_spim == NRF_SPIM3)
(gdb) n
492        nrf_spim_rx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_rx_buffer, p_xfer_desc-&amp;gt;rx_length);
(gdb) n
495        if (p_spim == NRF_SPIM3)
(gdb) n
497            anomaly_198_enable(p_xfer_desc-&amp;gt;p_tx_buffer, p_xfer_desc-&amp;gt;tx_length);
(gdb) n
501        nrf_spim_event_clear(p_spim, NRF_SPIM_EVENT_END);
(gdb) n
503        spim_list_enable_handle(p_spim, flags);
(gdb) n
505        if (!(flags &amp;amp; NRFX_SPIM_FLAG_HOLD_XFER))
(gdb) n
507            nrf_spim_task_trigger(p_spim, NRF_SPIM_TASK_START);
(gdb) n
521        if (!p_cb-&amp;gt;handler)
(gdb) n
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:607
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) s
spim_xfer (flags=0, p_xfer_desc=0x2003ffac, p_cb=0x20003b24 &amp;lt;m_cb+44&amp;gt;, p_spim=&amp;lt;optimized out&amp;gt;) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:607
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) s
nrf_spim_event_check (spim_event=NRF_SPIM_EVENT_END, p_reg=&amp;lt;optimized out&amp;gt;) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/hal/nrf_spim.h:525
525        return (bool)*(volatile uint32_t *)((uint8_t *)p_reg + (uint32_t)spim_event);
(gdb) s
spim_xfer (flags=0, p_xfer_desc=0x2003ffac, p_cb=0x20003b24 &amp;lt;m_cb+44&amp;gt;, p_spim=&amp;lt;optimized out&amp;gt;) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:523
523            while (!nrf_spim_event_check(p_spim, NRF_SPIM_EVENT_END)){}
(gdb) n
526            if (p_spim == NRF_SPIM3)
(gdb) n
528                anomaly_198_disable();
(gdb) n
531            if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
534                if (!p_cb-&amp;gt;use_hw_ss)
(gdb) n
537                    if (p_cb-&amp;gt;ss_active_high)
(gdb) n
543                        nrf_gpio_pin_set(p_cb-&amp;gt;ss_pin);
(gdb) n
554        return err_code;
(gdb) n
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:608
608    }
(gdb) s
ads1293_init () at .//ads1293.c:293
293        spi_uninit();
(gdb) s
spi_uninit () at .//ads1293.c:78
78        nrfx_spim_uninit(&amp;amp;spim);
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x000257ae in ?? ()
(gdb) r
Starting program: /home/miceuz/Xaltura/zive/Firmware/zive1/_build/nrf52840_xxaa.out

Breakpoint 1, main () at .//main.c:179
179        ads1293_init();
(gdb) s
ads1293_init () at .//ads1293.c:284
284        power_init();
(gdb) n
285        power_on();
(gdb) n
283    void ads1293_init() {
(gdb) n
284        power_init();
(gdb) n
286        delay(1);
(gdb) n
285        power_on();
(gdb) n
289        spi_init();
(gdb) n
286        delay(1);
(gdb) n
287        clock_pin_init(ADS1293_CLK_IN_PIN);
(gdb) n
289        spi_init();
(gdb) n
290        ads1293_write_register(CONFIG, 2);
(gdb) s
ads1293_write_register (value=2 &amp;#39;\002&amp;#39;, reg=CONFIG) at .//ads1293.c:299
299        nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
(gdb) n
297        m_tx_buf[0] = COMMAND_WRITE &amp;amp; reg;
(gdb) n
299        nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(m_tx_buf, 2, m_rx_buf, 2);
(gdb) n
297        m_tx_buf[0] = COMMAND_WRITE &amp;amp; reg;
(gdb) n
300        APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
(gdb) n
298        m_tx_buf[1] = value;
(gdb) n
300        APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
(gdb) n
298        m_tx_buf[1] = value;
(gdb) n
297        m_tx_buf[0] = COMMAND_WRITE &amp;amp; reg;
(gdb) n
300        APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spim, &amp;amp;xfer, 0));
(gdb) s
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:561
561        spim_control_block_t * p_cb = &amp;amp;m_cb[p_instance-&amp;gt;drv_inst_idx];
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
560    {
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
560    {
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
560    {
(gdb) n
571        if (p_cb-&amp;gt;transfer_in_progress)
(gdb) n
581            if (p_cb-&amp;gt;handler &amp;amp;&amp;amp; !(flags &amp;amp; (NRFX_SPIM_FLAG_REPEATED_XFER |
(gdb) n
588        p_cb-&amp;gt;evt.xfer_desc = *p_xfer_desc;
(gdb) n
590        if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
588        p_cb-&amp;gt;evt.xfer_desc = *p_xfer_desc;
(gdb) n
590        if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
588        p_cb-&amp;gt;evt.xfer_desc = *p_xfer_desc;
(gdb) n
590        if (p_cb-&amp;gt;ss_pin != NRFX_SPIM_PIN_NOT_USED)
(gdb) n
593            if (!p_cb-&amp;gt;use_hw_ss)
(gdb) n
596                if (p_cb-&amp;gt;ss_active_high)
(gdb) n
602                    nrf_gpio_pin_clear(p_cb-&amp;gt;ss_pin);
(gdb) n
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) s
spim_xfer (flags=0, p_xfer_desc=0x2003ffac, p_cb=0x20003b24 &amp;lt;m_cb+44&amp;gt;, p_spim=0x4002f000) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:475
475        if ((p_xfer_desc-&amp;gt;p_tx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_tx_buffer)) ||
(gdb) n
476            (p_xfer_desc-&amp;gt;p_rx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_rx_buffer)))
(gdb) n
475        if ((p_xfer_desc-&amp;gt;p_tx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_tx_buffer)) ||
(gdb) n
476            (p_xfer_desc-&amp;gt;p_rx_buffer != NULL &amp;amp;&amp;amp; !nrfx_is_in_ram(p_xfer_desc-&amp;gt;p_rx_buffer)))
(gdb) n
487        p_cb-&amp;gt;tx_length = 0;
(gdb) n
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:607
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) s
spim_xfer (flags=0, p_xfer_desc=0x2003ffac, p_cb=0x20003b24 &amp;lt;m_cb+44&amp;gt;, p_spim=&amp;lt;optimized out&amp;gt;) at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:488
488        p_cb-&amp;gt;rx_length = 0;
(gdb) n
491        nrf_spim_tx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_tx_buffer, p_xfer_desc-&amp;gt;tx_length);
(gdb) n
492        nrf_spim_rx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_rx_buffer, p_xfer_desc-&amp;gt;rx_length);
(gdb) n
495        if (p_spim == NRF_SPIM3)
(gdb) n
492        nrf_spim_rx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_rx_buffer, p_xfer_desc-&amp;gt;rx_length);
(gdb) n
495        if (p_spim == NRF_SPIM3)
(gdb) n
492        nrf_spim_rx_buffer_set(p_spim, p_xfer_desc-&amp;gt;p_rx_buffer, p_xfer_desc-&amp;gt;rx_length);
(gdb) n
495        if (p_spim == NRF_SPIM3)
(gdb) n
497            anomaly_198_enable(p_xfer_desc-&amp;gt;p_tx_buffer, p_xfer_desc-&amp;gt;tx_length);
(gdb) n
501        nrf_spim_event_clear(p_spim, NRF_SPIM_EVENT_END);
(gdb) n
503        spim_list_enable_handle(p_spim, flags);
(gdb) n
505        if (!(flags &amp;amp; NRFX_SPIM_FLAG_HOLD_XFER))
(gdb) n
507            nrf_spim_task_trigger(p_spim, NRF_SPIM_TASK_START);
(gdb) n
521        if (!p_cb-&amp;gt;handler)
(gdb) n
nrfx_spim_xfer (p_instance=p_instance@entry=0x33148 &amp;lt;spim&amp;gt;, p_xfer_desc=p_xfer_desc@entry=0x2003ffac, flags=flags@entry=0)
    at /home/miceuz/nrf/nRF5_SDK/modules/nrfx/drivers/src/nrfx_spim.c:607
607        return spim_xfer(p_instance-&amp;gt;p_reg, p_cb,  p_xfer_desc, flags);
(gdb) n
608    }
(gdb) n
ads1293_init () at .//ads1293.c:293
293        spi_uninit();
(gdb) s
spi_uninit () at .//ads1293.c:78
78        nrfx_spim_uninit(&amp;amp;spim);
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x000257ae in ?? ()&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segmentation fault after enabling BLE stack</title><link>https://devzone.nordicsemi.com/thread/167858?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 10:14:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56c40d9c-ce04-490a-8dc1-f197b8d19d7f</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Which SDK and SoftDevice do you use?&lt;/p&gt;
&lt;p&gt;Have you tried to &lt;a href="https://www.youtube.com/watch?v=uP8RYgYGRvI"&gt;debug &lt;/a&gt;the project and looked at what happend when you enabled the SoftDevice?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>