<?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>Nordic didn&amp;#39;t update custom characteristic after porting from Keil to SES</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61695/nordic-didn-t-update-custom-characteristic-after-porting-from-keil-to-ses</link><description>Hi, 
 I am trying to migrate my project file from Keil 5 to Segger Embedded Studio (SES). 
 After porting all my source code and configuration files, SES is able to compile and download code to my custom NRF52840 board without error. But I cannot update</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 May 2020 11:20:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61695/nordic-didn-t-update-custom-characteristic-after-porting-from-keil-to-ses" /><item><title>RE: Nordic didn't update custom characteristic after porting from Keil to SES</title><link>https://devzone.nordicsemi.com/thread/251687?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 11:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d3f8d56-0bcf-4dea-966b-58e7753ed163</guid><dc:creator>grabro</dc:creator><description>&lt;p&gt;Looks like I solved the problem by changing the Optimization Level from Level 2 to Level 0.&lt;/p&gt;
&lt;p&gt;But still curious on why this would change the performance behavior of the device. Any information on this will be much appreciated! =)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic didn't update custom characteristic after porting from Keil to SES</title><link>https://devzone.nordicsemi.com/thread/251682?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 10:53:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd04b86d-b8c5-4a56-88c1-45d85ee4af91</guid><dc:creator>grabro</dc:creator><description>&lt;p&gt;Hi Joakim,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Strange things happen when I am&amp;nbsp;using the SES IDE:&lt;/p&gt;
&lt;p&gt;Case 1:&lt;/p&gt;
&lt;p&gt;Sometimes the system is able to trigger the flag (used to indicate BLE transmission activity) but sometime doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Function for handling BLE events.
static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    uint32_t err_code;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_INFO(&amp;quot;Connected&amp;quot;);
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);
            ble_flag = true;
            break;

        case BLE_GAP_EVT_DISCONNECTED:
            NRF_LOG_INFO(&amp;quot;Disconnected&amp;quot;);
            // LED indication will be changed when advertising starts.
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            ble_flag = false;
            break;

        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;

        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
            // Pairing not supported
            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTC_EVT_TIMEOUT:
            // Disconnect on GATT Client timeout event.
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_TIMEOUT:
            // Disconnect on GATT Server timeout event.
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
            break;
        
        case BLE_GATTS_EVT_HVN_TX_COMPLETE:
            uart_busy_flag = false;
            packet_sent++;
            break;
        
        default:
            // No implementation needed.
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In which that ble_flag is declared as global variable:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;volatile static bool ble_flag = false;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Case 2:&lt;/p&gt;
&lt;p&gt;In the case when ble_flag is triggered in &amp;quot;Release&amp;quot; project configuration, the system will return err_code = 0x05.&lt;/p&gt;
&lt;p&gt;Also,&amp;nbsp;it won&amp;#39;t return any error in &amp;quot;Debug&amp;quot; project configuration, which means that the system can send data to my phone without any problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;All of these problem didn&amp;#39;t exist when I am using Keil.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Looks like there are several misconfigurations here. I will need to check again with my code and update soon.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic didn't update custom characteristic after porting from Keil to SES</title><link>https://devzone.nordicsemi.com/thread/251638?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 08:45:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09efc81f-066d-42fe-8da5-0e1e8206c0df</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;You are correct. If you are not using an older nRF SDK without native support for SES I wouldn&amp;#39;t recommend following the guide I linked to.&lt;/p&gt;
&lt;p&gt;I would recommend using a template SES project instead of actually migrating the example. &lt;br /&gt;Do you see any errors or abnormal behavior if you debug the application with SES?&lt;/p&gt;
&lt;p&gt;Br, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic didn't update custom characteristic after porting from Keil to SES</title><link>https://devzone.nordicsemi.com/thread/251635?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 08:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ef489b3-55dc-4ca6-a847-b3ded0102a65</guid><dc:creator>grabro</dc:creator><description>&lt;p&gt;Thanks Joakim,&lt;/p&gt;
&lt;p&gt;I am using nRF SDK 16.0.0.&lt;/p&gt;
&lt;p&gt;I had read the guide that you provided, and thought that it would be easier by copying and pasting my custom source code directly to&amp;nbsp;the provided SES template file. (I used ble_app_uart example as template). Have also added required paths and updated memory size and location in the project settings.&lt;/p&gt;
&lt;p&gt;Perhaps I can try to do the migration and see the result again. Will update soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nordic didn't update custom characteristic after porting from Keil to SES</title><link>https://devzone.nordicsemi.com/thread/251622?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 08:12:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ffcc92c-bcc5-45ea-9799-ec64c8c95eca</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Which version of the nRF5 SDK are you working with?&lt;/p&gt;
&lt;p&gt;We have a guide on migrating an existing project from Keil -&amp;gt; SES: &lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-a-cross-platform-ide"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-a-cross-platform-ide&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Br, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>