<?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>How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39872/how-can-i-debug-in-segger-embedded-studio-when-bootloader-exists</link><description>I am using NRF52840DK with SDK15.2 to test the DFU. 
 I use Segger Embedded Studio to compile both the secure_bootloader project and ble_app_buttonless_dfu project. 
 Then I use nrfjprog to program the hex files including the setting , SD, and application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Nov 2018 04:28:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39872/how-can-i-debug-in-segger-embedded-studio-when-bootloader-exists" /><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/155457?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 04:28:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23dad951-023c-4703-9b6a-1062fc3c179c</guid><dc:creator>chapman</dc:creator><description>&lt;p&gt;Hi Edvin, It is fixed . I wrongly use&amp;nbsp;&amp;nbsp;pca10056_usb_debug instead of&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;pca10056_ble_debug&lt;/span&gt;&lt;strong&gt;&amp;nbsp; &lt;/strong&gt;for the bootloader.&amp;nbsp;&amp;nbsp;Thank you.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/155290?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 10:29:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4443b060-6c5f-4c07-8307-b913ff09a1c5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;No. You need to keep the line ble_dfu_buttonless_async_svci_init().&lt;/p&gt;
&lt;p&gt;Is it possible to send your application file? Maybe I can take a look?&lt;/p&gt;
&lt;p&gt;Did you try the unmodified ble_app_buttonless_dfu application from the SDK? That one should work.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/155242?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 02:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99130fd3-58a8-4660-92b8-d472082dd747</guid><dc:creator>chapman</dc:creator><description>&lt;p&gt;Optimization Level is None and it still cannot past this point.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Yes,&amp;nbsp; It cannot be return. It is more correctly to say that it doesn&amp;#39;t return at&amp;nbsp;&amp;nbsp;nrf_dfu_set_peer_data_init();&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Then I remove the the call to ble_dfu_buttonless_async_svci_init() in the main(), the program can be run and debug step by step. However,&amp;nbsp; DFU&amp;nbsp;was always failed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does it mean that it is necessary to comment this line &amp;quot;&amp;nbsp;&lt;span&gt;ble_dfu_buttonless_async_svci_init() &amp;quot; when I need to debug ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/155161?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 14:23:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dfaba9a-25ba-46c5-95b9-feb4df1ed78e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What do you mean by stop? Does it return, or not? If not, can you try to compile your application (not bootloader) without optimization? That may be what you are seeing. It may be that it somehow jumps to another place, which returns an err_code != 0, and is caught by an APP_ERROR_CHECK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try to remove the optimization, and see if you are able to get past this point.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/155158?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 14:17:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62b1d955-f4a3-47d9-8163-989501dfe83b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If you use&amp;nbsp;BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE, then the maximum allowed advertising duration is 180 seconds. This is mentioned in ble_hap.h ( #define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX (18000) )&lt;/p&gt;
&lt;p&gt;If you use&amp;nbsp;BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE, you can use a longer timeout. However, when I tested this, it seems like the softdevice only accepts 16 bits timeout value.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;65535 works fine, while 65536 goes immediately to sleep.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you can do, if you need 14 minutes of advertising, you can use BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE, and set the APP_ADV_DURATION to 0 (it will not stop advertising), and use a different timer to count to 14 minutes, and then stop the advertisement manually from there.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/154975?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 03:05:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15bbcc3d-3455-481b-bbfb-8e41a80be167</guid><dc:creator>chapman</dc:creator><description>&lt;p&gt;Hi Edvin, I follow your instruction with the following steps&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&lt;span&gt;compile the secure_bootloader\pca10056_ble_&lt;/span&gt;&lt;strong&gt;debug&lt;/strong&gt;&lt;span&gt;&amp;nbsp;for the bootloader&amp;nbsp; with SES&lt;br /&gt;2. merge the bootloader&amp;#39;s hex file with the application and&amp;nbsp; setting and then download to the nrf52840-dk.&lt;br /&gt;3. In SES , with the project ble_app_buttonless_dfu, run the debug&amp;nbsp;&lt;br /&gt;4. The debug cursor&amp;nbsp; then start at main . It seems debugging is worked now, but it will stop responding till it reach &amp;quot;err_code = ble_dfu_buttonless_async_svci_init();&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there anything I need to add or change ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I debug in Segger Embedded Studio when bootloader exists?</title><link>https://devzone.nordicsemi.com/thread/154820?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 09:48:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b7ba668-d954-48c1-9771-986f92812b82</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I just tested what you described, and I get the same behavior as you do. Sometimes I actually manage to debug, but when I reset, it goes back into bootloader mode. The reason for this is that the .hex file which you program with SES is a bit different than the .elf file that is used, so the CRC doesn&amp;#39;t mach.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The solution is to use the secure_bootloader\pca10056_ble_&lt;strong&gt;debug&lt;/strong&gt; bootloader when you want to debug, which skips the CRC check. Use this for development, and switch to the non-debug bootloader for your final checks. The bootloader behaves the same, except that the CRC check is enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You still need to add keys (just use the same ones as you did in the debug bootloader), and create either the bootloader settings page or perform the DFU first, in order to update the bootloader settings to go into the application. The debug bootloader still checks the other requirements for the application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope that works. Let me know if it doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>