<?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>FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59160/fds-writing-issue-with-freertos-and-softdevice</link><description>Hello, 
 
 I am currently trying to get a project working that uses FDS, but I am having trouble getting the writing and updating working. 
 The peripherals in my project are FDS, FreeRTOS, the Soft Device, BLE, SPI, and TWI. 
 
 The issue I am facing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Mar 2020 17:28:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59160/fds-writing-issue-with-freertos-and-softdevice" /><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/241659?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 17:28:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d5790c4-aac9-4c2b-b836-f1d7e1155bc5</guid><dc:creator>sarem-shal</dc:creator><description>&lt;p&gt;Fantastic! Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/241654?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 16:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d585a16f-363e-4c62-848a-65b55e50c847</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I think you need to create a task for your flash activity and make the task block until softdevice_task is started and could notify your blocking task.&lt;/p&gt;
&lt;p&gt;There seems to be some timing related issue when you pull the events in polling mode instead of interrupt mode. In any case, do not trigger any flash activity before you know that the softdevice is properly initialized and ready.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/241653?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 16:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a631b735-1634-457c-b677-e0fe1b9efd67</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks for a nice demo to show the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think the issue lies in where you initiate a flash write command. Flash write operation events are received using softdevice SOC events and I think doing flash operations way before softdevice_task is running is the main problem here.&lt;/p&gt;
&lt;p&gt;removing the write from main and moving it into the softdevice_task as follows&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* This function gets events from the SoftDevice and processes them. */
static void softdevice_task(void * pvParameter)
{
    NRF_LOG_DEBUG(&amp;quot;Enter softdevice_task.&amp;quot;);

    if (m_task_hook != NULL)
    {
        m_task_hook(pvParameter);
    }

    //** FDS MAIN START **
    uint8_t write_data[1] = {0x57};
    uint8_t read_data[1] = {0x00};

    init_fds();
    save_stack_data(write_data,1);
    read_stack_data(read_data,1);
    //** FDS MAIN END **

    while (true)
    {
        nrf_sdh_evts_poll();                    /* let the handlers run first, incase the EVENT occured before creating this task */

        (void) ulTaskNotifyTake(pdTRUE,         /* Clear the notification value before exiting (equivalent to the binary semaphore). */
                                portMAX_DELAY); /* Block indefinitely (INCLUDE_vTaskSuspend has to be enabled).*/
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;gives the below results&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: HRS FreeRTOS example started.
&amp;lt;info&amp;gt; app: Fast advertising.
&amp;lt;info&amp;gt; app: Initializing fds...
&amp;lt;info&amp;gt; app: Event: FDS_EVT_INIT received (NRF_SUCCESS)
&amp;lt;info&amp;gt; app: FDS CHECK-1: FDS_SUCCESS
&amp;lt;info&amp;gt; app: FDS OPEN: FDS_ERR_CRC_CHECK_FAILED
&amp;lt;info&amp;gt; app: FDS CLOSE: FDS_ERR_NO_OPEN_RECORDS
&amp;lt;info&amp;gt; app: Event: FDS_EVT_UPDATE received (NRF_SUCCESS)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/241470?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2020 20:59:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8b0c7c4-5838-4ee9-ba09-74d322f5129b</guid><dc:creator>sarem-shal</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t post the my application/project due to privacy reasons, but I can send you a project that emulates my same issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;modified the ble_app_hrs_freertos example in the NRF5SDK and added fds initializing, writing, and reading. I also&amp;nbsp;enabled the CRC_CHECK for fds reading and writing in the SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You should also see the following output upon running this program&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Initializing fds...
&amp;lt;info&amp;gt; app: Event: FDS_EVT_INIT received (NRF_SUCCESS)
&amp;lt;info&amp;gt; app: FDS CHECK-1: FDS_SUCCESS
&amp;lt;info&amp;gt; app: FDS OPEN: FDS_ERR_CRC_CHECK_FAILED
&amp;lt;info&amp;gt; app: FDS CLOSE: FDS_ERR_NO_OPEN_RECORDS
&amp;lt;info&amp;gt; app: HRS FreeRTOS example started.
&amp;lt;info&amp;gt; app: Fast advertising.
&amp;lt;info&amp;gt; app: Event: FDS_EVT_UPDATE received (FDS_ERR_CRC_CHECK_FAILED)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_5F00_freertos_5F00_edit.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_hrs_5F00_freertos_5F00_edit.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/241346?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2020 11:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5a2c62d-c07d-49b7-9690-10dc80bd9a2e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;please attach your project here and I can try to solve the compilation issues and reattach the project after that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/240955?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 19:12:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d522a607-0cab-4f4e-bd21-64ea05003cde</guid><dc:creator>sarem-shal</dc:creator><description>&lt;p&gt;Hello, I tried removing nrf_sdh.c, but I received a lot of compiling errors for undefined references since that file was removed. Is there another way to fix the issue?&lt;/p&gt;
&lt;p&gt;Also there may be a chance that getting the program to compile will not fix my main issue of FDS not writing. I had tried a different method to get the program to compile by removing the &amp;#39;SD_EVT_IRQHandler&lt;span&gt;&amp;#39; call from nrf_sdh.c and the program successfully compiled, but it did not help FDS to successfully write.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here are the undefined errors for reference&amp;nbsp;as well:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/puzzle.dir/lora_ble_twi/main.c.obj: in function `ble_stack_init&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/apps/lora_ble_twi/main.c:259: undefined reference to `nrf_sdh_enable_request&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c.obj: in function `nrf_pwr_mgmt_run&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c:349: undefined reference to `nrf_sdh_is_enabled&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/external/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c.obj: in function `vPortSuppressTicksAndSleep&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/external/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c:239: undefined reference to `nrf_sdh_is_enabled&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/integration/nrfx/legacy/nrf_drv_clock.c.obj: in function `lfclk_stop&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/integration/nrfx/legacy/nrf_drv_clock.c:121: undefined reference to `nrf_sdh_is_enabled&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/integration/nrfx/legacy/nrf_drv_clock.c.obj: in function `nrf_drv_clock_init&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/integration/nrfx/legacy/nrf_drv_clock.c:176: undefined reference to `nrf_sdh_is_enabled&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/integration/nrfx/legacy/nrf_drv_rng.c.obj: in function `nrfx_rng_handler&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/integration/nrfx/legacy/nrf_drv_rng.c:95: undefined reference to `nrf_sdh_is_enabled&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/components/softdevice/common/nrf_sdh_freertos.c.obj: in function `softdevice_task&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/components/softdevice/common/nrf_sdh_freertos.c:84: undefined reference to `nrf_sdh_evts_poll&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/components/libraries/fstorage/nrf_fstorage_sd.c.obj: in function `nrf_fstorage_sys_evt_handler&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/components/libraries/fstorage/nrf_fstorage_sd.c:577: undefined reference to `nrf_sdh_request_continue&amp;#39;
[build] /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../sdk/CMakeFiles/sdk.dir/nRF5_SDK/components/libraries/fstorage/nrf_fstorage_sd.c.obj: in function `init&amp;#39;:
[build] /Users/Sshalf869/Desktop/puzzle/pzl/sdk/nRF5_SDK/components/libraries/fstorage/nrf_fstorage_sd.c:382: undefined reference to `nrf_sdh_is_enabled&amp;#39;
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Writing Issue with FreeRTOS and Softdevice</title><link>https://devzone.nordicsemi.com/thread/240855?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 12:25:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ffe6726-5859-4d20-8091-0eb2c086aab1</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]&lt;span&gt;The compiling error is:&amp;nbsp;&lt;/span&gt;multiple definition of &lt;span style="text-decoration:underline;"&gt;`SWI2_EGU2_IRQHandler&amp;#39;&lt;/span&gt; at&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;components/softdevice/common/nrf_sdh_freertos.c:62&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;components/softdevice/common/nrf_sdh.c:366&lt;/span&gt; .[/quote]
&lt;p&gt;&amp;nbsp;you need to remove nrf_sdh.c file from your project when using freertos.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>