<?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>Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83155/open-bootloader-stuck-in-dfu-mode-nano-33-ble-issue-dk-is-ok</link><description>Good evening, 
 I’m testing the SDK v17.1.0 “Open Bootloader with DFU” example. I’m using Segger Embedded Studio to program my Nano 33 BLE via the debug interface (P20) of my nRF52840-DK. I’m also programming the Open Bootloader to my DK via its “USB</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Jan 2022 17:33:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83155/open-bootloader-stuck-in-dfu-mode-nano-33-ble-issue-dk-is-ok" /><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345752?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 17:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7de49237-b454-417d-8040-e7650426199d</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Awesome! it works perfectly.&lt;/p&gt;
&lt;p&gt;Removing&amp;nbsp;&lt;span&gt;CONFIG_GPIO_AS_PINRESET&amp;nbsp;from the preprocessor definitions has fixed the issue, completely&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f44f.svg" title="Clap"&gt;&amp;#x1f44f;&lt;/span&gt;. From testing, it&amp;#39;s important to remember to remove it for the application as well like you said, otherwise once blinky has ran, it has then executed its own CONFIG_GPIO_AS_PINRESET which effectively is the same as if not having removed it for the bootloader.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, it isn&amp;#39;t necessary to comment those entries in the Make file like I&amp;#39;d read about, nor was it necessary to write to PSELRESET like I had in main()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Once again, thank you kindly&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f44d.svg" title="Thumbsup"&gt;&amp;#x1f44d;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit&lt;/span&gt;:&lt;/strong&gt; Oh, and when blinky is running, pressing PB1 &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;no longer&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;stops blinky running... which makes it even more amazing&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f600.svg" title="Grinning"&gt;&amp;#x1f600;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345726?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 15:30:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1867f663-62af-4a89-9b6c-aef111662e79</guid><dc:creator>GaryDT</dc:creator><description>[quote]&lt;span&gt;It&amp;#39;s already prepared in the code of most of the application, by enable or disable CONFIG_GPIO_AS_PINRESET in the preprocessor symbols. if you look at system_nrf52.c (line 290), you can find how it&amp;#39;s done.&lt;/span&gt;[/quote]
&lt;p&gt;&amp;quot;preprocessor symbols&amp;quot;? But you then refer to file system_nrf52.c to accomplish it. I&amp;#39;ll assume you mean Preprocessor Definitions in Segger as below, but please correct me if that&amp;#39;s not what you meant. I&amp;#39;ll also look at that file...&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641223821434v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345717?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 15:12:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6e4459-2420-45af-abd7-1193f2b762d7</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;When only having blinky programmed directly from Segger, then PB1 does still stop it running whilst the button is pressed, and then it starts again when released. So it can&amp;#39;t be the bootloader.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t feel like a short (or smell).&lt;/p&gt;
&lt;p&gt;Anyway, I&amp;#39;ll work this afternoon to try the other things you have suggested and get back to you here. Again sorry about the wrong table... I&amp;#39;ll carefully tweak anything that needs slight attention as I said.&lt;/p&gt;
&lt;p&gt;Thanks again.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345713?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 15:05:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35e34eb3-3814-4844-a2ba-8b6b77c45e79</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gary,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To modify UICR you would need to enable writing to flash (WEN)&lt;/p&gt;
&lt;p&gt;It&amp;#39;s already prepared in the code of most of the application, by enable or disable CONFIG_GPIO_AS_PINRESET in the preprocessor symbols. if you look at system_nrf52.c (line 290), you can find how it&amp;#39;s done.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So in your case, if you want to disable the pin as a reset pin, you need to remove&amp;nbsp;CONFIG_GPIO_AS_PINRESET in the preprocessor in both the bootloader and the application project. And make sure you erase the chip before you flash it again.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m not sure why press and hold the button P1.11 would cause the chip to reset. You may want to check if pressing it actually cause a short some where in the circuit. Please try&amp;nbsp;to test on another pin (without modifying the code) to see if it&amp;#39;s only that pin causing the reset.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another thing to test is to flash only the blinky example, without the bootloader, and check if pressing the button cause any effect. If it doesn&amp;#39;t then there must be something in the bootloader causing the trouble.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345711?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 15:02:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5839ee7a-a41a-4a97-9a3e-2b7052e03920</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Sorry my mistake... I was looking at the wrong chip. I had several tabs open and somehow the contents column on the left didn&amp;#39;t match the main content on the right. Here&amp;#39;s the correct PSELRESET from earlier.&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t worry, I&amp;#39;ll tidy up any consequential mistakes to keep things as coherent as possible&amp;nbsp;&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f628.svg" title="Fearful"&gt;&amp;#x1f628;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1641222093298v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345546?ContentTypeID=1</link><pubDate>Sun, 02 Jan 2022 09:49:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c83ce305-4649-4b14-9589-d0dd4e019780</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Please also see my previous reply.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried by using a separate button attached to the Nano... METHOD_BUTTON_PIN 43 (P1.11), and it works 100% as expected, i.e., enters DFU mode only when the button is pressed and then plugging in the USB, otherwise blinky always runs.&lt;/p&gt;
&lt;p&gt;Incidentally, pressing the button whilst blinky is running temporarily stops it running (i.e., all LEDs turn off) until the button is released. Any idea if that&amp;#39;s a soft reset? Or maybe a built-in&amp;nbsp;hardware feature? (Photo of my setup is below for reference)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/20220102_5F00_091411.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Further research&lt;/span&gt;:&lt;/strong&gt; this guy was having similar problems &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32117/unable-to-disable-p0-21-as-pin-reset-while-using-dfu-bootloader" rel="noopener noreferrer" target="_blank"&gt;with the PSELRESET register&lt;/a&gt;. Please note that I&amp;#39;ve already tried the following (for open bootloader only (on its own) that is) as per the quote below...&lt;/p&gt;
[quote]&lt;span&gt;I&amp;#39;ve already commented out the CONFIG_GPIO_AS_PINRESET flags in my Makefile and I&amp;#39;ve searched for that exact text in my entire project and it isn&amp;#39;t defined anywhere else&lt;/span&gt;[/quote]
&lt;p&gt;Here&amp;#39;s my Open Bootloader&amp;#39;s Makefile with commented:&amp;nbsp;#CFLAGS += -DCONFIG_GPIO_AS_PINRESET&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641119025581v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Also, within dfu_enter_check() ...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if (NRF_BL_DFU_ENTER_METHOD_BUTTON &amp;amp;&amp;amp;
(nrf_gpio_pin_read(NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN) == 0))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;nrf_gpio_pin_read(...) always returns 1 for my Nano&amp;#39;s &amp;quot;&amp;lt;18=&amp;gt; 18 (P0.18)&amp;quot; pin when PB1 is in its released logic-high state, which I guess is correct, the same as for the DK. But as I mentioned earlier, when PB1 is kept pressed, it&amp;#39;s as if the Nano is effectively powered down, which I suspect might be the problem because that would mean logic-low is never read, i.e., PB1 is released which effectively turns it on, and then PB1&amp;#39;s logic-high is read which of course doesn&amp;#39;t activate DFU mode.&lt;/p&gt;
&lt;p&gt;If the above is true, then do you know if this powering down like behaviour can be configured, such that PB1 (ResetN) can be made to operate like a separate button? (As you might have guessed, I&amp;#39;m not feeling very confident that&amp;nbsp;&lt;span&gt;PSELRESET is the issue, but I hope I&amp;#39;m wrong&lt;/span&gt;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To recap regarding my dfu_enter_check() function, here it is again with respect to the above...&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641119895648v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll wait for your reply, thank you kindly.&lt;/p&gt;
&lt;p&gt;P.S. I&amp;#39;m trying to avoid using &lt;a href="https://forum.arduino.cc/t/how-to-upload-nordic-compiled-hex-file-to-a-nano-33-ble/621589" rel="noopener noreferrer" target="_blank"&gt;Arduino&amp;#39;s Bossac&lt;/a&gt; as explained by Kevingre (Post #4).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345494?ContentTypeID=1</link><pubDate>Thu, 30 Dec 2021 15:23:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa4507a4-4638-47cc-80f8-7c26c9fa4c84</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I meant happening regarding why 14 and 15 are doing what 18 should be doing&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f600.svg" title="Grinning"&gt;&amp;#x1f600;&lt;/span&gt;&amp;nbsp;but please notice my&amp;nbsp;&lt;strong&gt;&lt;span&gt;Edit 3&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;which attempted to explain (although I didn&amp;#39;t know about soft reset and power reset, thanks, and for anyone curious...&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2_5#unique_448672166" rel="noopener noreferrer" target="_blank"&gt;Reset Behaviour&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Anyway to now continue on from here by disabling&amp;nbsp;&lt;span&gt;PSELRESET as you&amp;#39;ve suggested...&lt;/span&gt;&amp;nbsp;I&amp;#39;ve disabled both [0] and [1] because I don&amp;#39;t know which one is relevant. I searched the entire solution for&amp;nbsp;PSELRESET to avoid it being set after wherever I disable it, but it isn&amp;#39;t found, so I decided to add them in main() as below...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{    
	NRF_UICR-&amp;gt;PSELRESET[0] = UICR_PSELRESET_CONNECT_Disconnected &amp;lt;&amp;lt; UICR_PSELRESET_CONNECT_Pos;
	NRF_UICR-&amp;gt;PSELRESET[1] = UICR_PSELRESET_CONNECT_Disconnected &amp;lt;&amp;lt; UICR_PSELRESET_CONNECT_Pos;
	
	uint32_t ret_val;
	
	// Must happen before flash protection is applied, since it edits a protected page.
	nrf_bootloader_mbr_addrs_populate();
	
	// Protect MBR and bootloader code from being overwritten.
	ret_val = nrf_bootloader_flash_protect(0, MBR_SIZE);
	APP_ERROR_CHECK(ret_val);
	ret_val = nrf_bootloader_flash_protect(BOOTLOADER_START_ADDR, BOOTLOADER_SIZE);
	APP_ERROR_CHECK(ret_val);
	
	ret_val = NRF_LOG_INIT(app_timer_cnt_get);
	APP_ERROR_CHECK(ret_val);
	NRF_LOG_DEFAULT_BACKENDS_INIT();
	
	NRF_LOG_INFO(&amp;quot;Open USB bootloader started&amp;quot;);
	NRF_LOG_FLUSH();
	
	ret_val = nrf_bootloader_init(dfu_observer);
	APP_ERROR_CHECK(ret_val);
	
	NRF_LOG_FLUSH();
	
	NRF_LOG_ERROR(&amp;quot;After main, should never be reached.&amp;quot;);
	NRF_LOG_FLUSH();
	
	APP_ERROR_CHECK_BOOL(false);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The result is exactly as before when not using pins 14 or 15... as the workaround that I discovered.&lt;/p&gt;
&lt;p&gt;Therefore, might &lt;span&gt;PSELRESET&amp;nbsp;&lt;/span&gt;be set after main() via some other method?&lt;/p&gt;
&lt;p&gt;Please confirm if I&amp;#39;m disabling this register correctly?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit&lt;/span&gt;:&lt;/strong&gt; just to confirm (although probably not surprising considering all that has tested to work so far), I am indeed using the _mbr version as below...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;nrfutil pkg generate --application blinky_pca10056_mbr.hex --application-version 1 --hw-version 52 --sd-req 0x00 app_dfu_package.zip&lt;/li&gt;
&lt;li&gt;nrfutil dfu usb-serial -pkg app_dfu_package.zip -p COM13 -b 115200&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit 2&lt;/span&gt;:&lt;/strong&gt;&amp;nbsp;I&amp;#39;ve discovered how to see the registers in SES&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f914.svg" title="Thinking"&gt;&amp;#x1f914;&lt;/span&gt;&amp;nbsp;here&amp;#39;s a screenshot whilst in debug mode. You can see that both&amp;nbsp;&lt;span&gt;PSELRESET [0] and [1] state &amp;quot;Disconnected&amp;quot; (by default that is, i.e., my attempt to disable them in main() is commented). I&amp;#39;ll wait for your reply, thank you...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640951798246v1.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And for the PIN field I can only see one possible value... 18 (Please see screenshot below) so I&amp;#39;m guessing that doesn&amp;#39;t apply, or does it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit (03-01-2022)&lt;/span&gt;:&lt;/strong&gt;&amp;nbsp;the screenshot below is now for the correct chip (nRF52840), otherwise I would have asked about PORT as well&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f610.svg" title="Neutral face"&gt;&amp;#x1f610;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1641229231787v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345491?ContentTypeID=1</link><pubDate>Thu, 30 Dec 2021 14:20:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23f66f15-317e-4e86-b42d-417b94b4f50a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gary,&amp;nbsp;&lt;br /&gt;Sorry it was my mistake, my intention was to set&amp;nbsp;&lt;span&gt;NRF_BL_DFU_ENTER_METHOD_BUTTON&amp;nbsp;=1 not&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN = 1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After you set&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON&amp;nbsp;=1 you then choose a PIN to be used as the reset to DFU pin.&amp;nbsp;Let&amp;#39;s say pin P0.05. Then to switch to DFU mode you need to hold the button that connect to P0.05 and do a reset, either a softreset, pin reset or a power reset.&amp;nbsp;&lt;br /&gt;When the bootloader booting up it will read the value of P0.05 and decide to enter DFU mode or not. It&amp;#39;s not a GPIOTE event, but simply a pin read before entering DFU.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you don&amp;#39;t have an extra button to use and only have one single button PB1 that connect to P0.18 then you need to&amp;nbsp;disable P0.18 as a reset pin ( via PSELRESET register) and set&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN&amp;nbsp; to P0.18&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345483?ContentTypeID=1</link><pubDate>Thu, 30 Dec 2021 13:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afc384fb-e2d7-467b-987b-fa3301c18016</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Is the correct solution to setup a GPIOTE for the Nano&amp;#39;s PB1 button in my application via P0.18? Or is PB1 already configured as input? in which case this relates back to my &lt;span style="text-decoration:underline;"&gt;Edit 4&lt;/span&gt;.&amp;nbsp;Maybe similar to your reply in the thread as quoted below...&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/6870/bsp-driven-buttons-don-t-work-with-a-bootloader" rel="noopener noreferrer" target="_blank"&gt;...Buttons don&amp;#39;t work with a bootloader&lt;/a&gt;&lt;/p&gt;
[quote]&lt;span&gt;The bootloader I provided doesn&amp;#39;t use GPIOTE Port event. It configures one button as input. As suggested by RK, have you made sure you reconfigured the button correctly in your application ?&lt;/span&gt;[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345362?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 13:09:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c4d424b-7d6c-4a46-9501-e29eba6c69af</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Thanks Hung,&lt;/p&gt;
&lt;p&gt;Did you mean to say NRF_BL_DFU_ENTER_METHOD_BUTTON to 1 (0 is the default)? If not then...&lt;/p&gt;
&lt;p&gt;For NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN (25 is the default). Therefore why set it to 1?&lt;/p&gt;
[quote]&lt;span&gt;You can disable pin reset if you want (change&amp;nbsp;PSELRESET register).&lt;/span&gt;[/quote]
&lt;p&gt;Is that necessary considering that&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_PINRESET 0 disables activating DFU mode by ignoring the pin reset event? (Or do you mean that if I ever want to disable pin reset in general, then I can use its register?)&lt;/p&gt;
[quote]&lt;span&gt;In many applications, you don&amp;#39;t want to enter DFU mode every time you do a pin reset, but instead having an extra button to switch it to DFU mode.&lt;/span&gt;[/quote]
&lt;p&gt;Ah, so the Nano&amp;#39;s reset button is essentially for resetting all pins, which is done by it being connected to P0.18. So you&amp;#39;re simply saying to disable pin reset by setting&amp;nbsp;&lt;span&gt;_METHOD_PINRESET&lt;/span&gt; to 0 (or disable the pin reset event directly via its register, as mentioned above), and therefore the Nano&amp;#39;s PB1 button can be used to activate DFU mode via&amp;nbsp;&lt;span&gt;_METHOD_BUTTON instead, and therefore as a point of interest, I suppose the button press itself must be registered independent of the pin reset event...&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve checked, and the Nano&amp;#39;s button PB1 is indeed connected to P0.18, and so I&amp;#39;ve tried with _METHOD_BUTTON 1 and _METHOD_BUTTON_PIN 18 (&lt;span&gt;_METHOD_PINRESET 0&lt;/span&gt;). The result is...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Me remembering to uncomment previous changes to avoid being called a &amp;quot;Wally&amp;quot;&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f600.svg" title="Grinning"&gt;&amp;#x1f600;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Bootloader detects no valid application and therefore enters DFU mode = correct.&lt;/li&gt;
&lt;li&gt;Flash board with blinky via nRF Util and blinky runs = correct.&lt;/li&gt;
&lt;li&gt;Press PB1 which stops blinky running (i.e., all LEDs off) = correct, but it doesn&amp;#39;t enter DFU mode = wrong. Also, blinky resumes running after releasing the button.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;#39;ll keep trying, but please if possible kindly respond to my previous questions, and let me know your further thoughts.&lt;/p&gt;
&lt;p&gt;The schematic is below (1st zoomed, 2nd full view)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640785866432v1.png" /&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640786571101v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit&lt;/span&gt;:&amp;nbsp;&lt;/strong&gt;&lt;span&gt;_METHOD_BUTTON 1 &amp;amp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;_METHOD_BUTTON_PIN&amp;nbsp;&lt;/span&gt;&lt;span&gt;to either &lt;span style="color:#339966;text-decoration:underline;"&gt;&lt;strong&gt;14 or 15&lt;/strong&gt;&lt;/span&gt; seems to work perfectly as below (also METHOD_PINRESET 0 of course)&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Bootloader detects no valid application and therefore enters DFU mode = correct.&lt;/li&gt;
&lt;li&gt;Flash board with blinky via nRF Util and blinky runs = correct.&lt;/li&gt;
&lt;li&gt;Press PB1 (sometimes requiring to keep it pressed for about 0.5 to 1 second) stops blinky running and then enters DFU mode when PB1 is released =&amp;nbsp;seems to be correct.&lt;/li&gt;
&lt;li&gt;Press PB1 again and blinky resumes running = correct.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;However, how does it make any sense that it works for pins 14 and 15 and not others, including 18? (it was by pure chance that I changed the pin to 15, and so I then tested a few other values in my disbelief).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit 2&lt;/span&gt;:&lt;/strong&gt; &lt;span style="color:#a87c23;"&gt;this would be a celebration if I understood what was happening&lt;/span&gt;&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/2049.svg" title="Interrobang"&gt;&amp;#x2049;&lt;/span&gt;&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/263a.svg" title="Relaxed"&gt;&amp;#x263a;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit 3&lt;/span&gt;:&lt;/strong&gt; so P0.14 (SDA1) and P0.15 (SCL1) are the I2C bus as stated for U-Blox NINA-B3X in the above schematic, and interrupting either of those two pins (which must be caused by pressing PB1), more or less consistently toggles between DFU mode and running blinky. Maybe this is just a lucky fluke? ... Incidentally,&amp;nbsp;&lt;span&gt;_METHOD_BUTTON_PIN 25 (the default) is button 4 on my nRF52840-DK&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f44c.svg" title="Ok hand"&gt;&amp;#x1f44c;&lt;/span&gt;&amp;nbsp;(I should have spotted that before).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Edit 4&lt;/span&gt;:&lt;/strong&gt; how is the SDK registering/configuring the Nano&amp;#39;s button press, considering that it doesn&amp;#39;t work for&amp;nbsp;_METHOD_BUTTON_PIN 18 as explained above? (virtually the same question as &amp;quot;&lt;span style="text-decoration:underline;"&gt;Edit 2&lt;/span&gt;&amp;quot; in my last reply).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ll wait for your reply, and thank you kindly Hung for your support so far. Cheers!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345335?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 11:13:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70220117-b605-4ce4-a7a3-5aebba2b61a4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gary,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reset pin of nRF52840 is pin P0.18. Please double check on the schematic of the Nano board (and the ublox module) to see how P0.18 is connected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can disable pin reset if you want (change&amp;nbsp;PSELRESET register).&lt;/p&gt;
&lt;p&gt;In many applications, you don&amp;#39;t want to enter DFU mode every time you do a pin reset, but instead having an extra button to switch it to DFU mode. If it&amp;#39;s the case you need to modify the &lt;span&gt;NRF_BL_DFU_ENTER_METHOD_PINRESET&amp;nbsp; to 0 and&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN&amp;nbsp; to 1.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another test you can do is to flash a normal application (not the bootloader) and do a power reset on the Nano, and&amp;nbsp;check the value of&amp;nbsp;NRF_POWER-&amp;gt; RESETREAS register to double check if reset pin is always triggered on power reset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345294?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 17:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de6f4427-fef7-4c88-8090-d9a91a242055</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;I&amp;#39;ve deleted my previous reply that was in this position, because it turns out that it was completely wrong&lt;/span&gt;...&lt;/p&gt;
&lt;p&gt;Bizarrely, my two Micro-USB leads (probably PC related) that I&amp;#39;ve been using, each behave differently. They&amp;#39;ve both been working for programming purposes between themselves and the PC, but one of them doesn&amp;#39;t (at least not consistently) enumerate as a COM Port in Device Manager, i.e., I&amp;#39;ve now swapped the leads over and I&amp;#39;m getting consistent behaviour for my Nano.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Edit&lt;/span&gt;&lt;span&gt;: another thing was that Device Manager wasn&amp;#39;t always refreshing after unplugging the nano, i.e., I had to hold its button pressed whilst unplugging it, or else it stayed listed under Ports. Anyway I&amp;#39;ve got the hang of all that now.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;100% it&amp;#39;s NRF_BL_DFU_ENTER_METHOD_PINRESET that is triggering DFU mode. It&amp;#39;s set to 1 by default in sdk_config.h, and if I change that to 0, or instead comment the if-statement within&amp;nbsp;dfu_enter_check() (see screenshot), then it never enters DFU mode. This is absolutely consistent now.&lt;/p&gt;
&lt;p&gt;Therefore ...PINRESET is being activated by releasing the Nano&amp;#39;s button. However, after having loaded blinky via nRF Util, and holding down the Nano&amp;#39;s button whilst plugging it in, blinky still doesn&amp;#39;t run. I wonder why?&lt;/p&gt;
&lt;p&gt;I suppose the first thing to do is reverse the Low / High state of the button. Do you know if there&amp;#39;s a setting for this?&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Edit 2&lt;/span&gt;&lt;span&gt;: also, please if possible can you explain how/where the nano&amp;#39;s button press (or any other device&amp;#39;s button press) is detected? And how it becomes associated with ...PINRESET?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640712733182v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Edit 3&lt;/span&gt;&lt;span&gt;:&lt;/span&gt; according to the nano&amp;rsquo;s datasheet, reset is pin 6 (but I&amp;#39;m wondering if this is referring to (i.e., also connected to) its button PB1... maybe not?)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20211228_2D00_232706_5F00_Acrobat-for-Samsung.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345271?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 15:01:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b08a87d2-bf58-4c61-b6f2-91b17bb4ae55</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again Gary,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can simply test by removing the function and make it always return false to test. I guess there must be other reason why it enter DFU.&lt;/p&gt;
&lt;p&gt;If you can use the log or a GPIO pin you can find which cause dfu_enter to return true.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345262?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 14:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b1aacd0-7095-4364-b3fb-5bb513125094</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;I can see:&amp;nbsp;&lt;span&gt;dfu_enter_check() within: nrf_bootloader.c. Via &amp;quot;Step Into&amp;quot; I can see which file is being executed because they&amp;#39;re all open at the top of the main window and become highlighted one by one, and that function isn&amp;#39;t reached, i.e., it just gets stuck in the CRC check.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you know why it continues on successfully... running blinky after clicking the green arrow (continue execution)? I.e., how does continue execution get it past the crc32_compute(...) function?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Within sdk_config.h: NRF_BL_DFU_ENTER_METHOD_BUTTON&amp;nbsp;is set to 0 by default.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For:&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN I&amp;#39;ve changed the default 25 to 999 (&lt;span style="text-decoration:underline;"&gt;Edit&lt;/span&gt;: 0 also makes no difference) in an attempt to disable its effect, but it made no difference. So to experiment further I then changed NRF_BL_DFU_ENTER_METHOD_PINRESET from 1 to 0, but that also still didn&amp;#39;t make any difference, i.e., the Nano&amp;#39;s yellow light is still on by default (without pressing its button) and nRF52 SDFU USB is listed under Ports in Device Manage. Please see SES screenshot below... (&lt;span style="text-decoration:underline;"&gt;Edit&lt;/span&gt;: &lt;strong&gt;setting ...PINRESET to 0 does actually disable DFU mode... see my next post for clarification&lt;/strong&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640701655132v1.png" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345254?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 13:35:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c29d23ba-1196-48c1-8a92-a3fa77a6d33a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Gary,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is a function called dfu_enter_check(). It&amp;#39;s where the bootloader check if it should stay in DFU mode or jump to the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you check if any condition inside the function actually make the function returns true ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suspect that&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON was set to 1 and the&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN was not configured (or mounted) to correct level (active low I believe) causing the device entering bootloader mode. It&amp;#39;s equivalent to the normal way of entering (secure )DFU of holding Button 1 when resetting the device.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Bootloader Stuck in DFU Mode (Nano 33 BLE Issue. DK Is OK)</title><link>https://devzone.nordicsemi.com/thread/345220?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 11:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:119f56d7-7244-4e96-be8c-5e298cac1ba6</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;I&amp;#39;m not experienced with fault finding via debuggers, but I&amp;#39;ve made a very small start as per the screenshot below. Interestingly, both the DK and the Nano seem to get stuck in &amp;quot;crc32_compute(...)&amp;quot; (it gets stuck in the for-loop). But when I click the green arrow (continue execution) blinky then runs, when testing either device. Also, when it appears to be stuck, then after several &amp;quot;Step Over&amp;quot; and/or &amp;quot;Step Out&amp;quot; steps, followed by a continuation of&amp;nbsp;&amp;quot;Step Into&amp;quot; steps, blinky also runs...&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640689129325v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>