<?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>GPIO pin settings when moving from Bootloader to Application mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62454/gpio-pin-settings-when-moving-from-bootloader-to-application-mode</link><description>Hi, 
 
 I am using nRF52840 S140 with ble_app_blinky application. I have a basic query of GPIO configuration when moving from Bootloader to Application. 
 
 We are using Secure Serial Bootloader. Via DFU we will load our BLE blinky application package</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jun 2020 11:14:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62454/gpio-pin-settings-when-moving-from-bootloader-to-application-mode" /><item><title>RE: GPIO pin settings when moving from Bootloader to Application mode</title><link>https://devzone.nordicsemi.com/thread/254449?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 11:14:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc8442d9-afd6-4988-b84b-ebc1d0198129</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Thank you for your inputs and confirmation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pin settings when moving from Bootloader to Application mode</title><link>https://devzone.nordicsemi.com/thread/254447?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 11:02:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2ef16e7-a810-4081-a514-0998888cce32</guid><dc:creator>Edvin</dc:creator><description>[quote user="beemavishnu"] I am trying to understand your statement &amp;quot;I would imagine that they would be reset again, but perhaps they are manually reset&amp;nbsp;&amp;quot;.[/quote]
&lt;p&gt;&amp;nbsp;What I meant was that in an unmodified bootloader + application, the configuration of pins from the bootloader doesn&amp;#39;t follow into the application. E.g. if the application uses UART, the UART pins will either be reset in the transition from bootloader-&amp;gt;application or the pins will be reset due to some UART deinit function.&lt;/p&gt;
&lt;p&gt;However, I see that this is not the case for the button used in&amp;nbsp;&lt;span&gt;NRF_BL_DFU_ENTER_METHOD_BUTTON. By default, this is set to button 4 (pin P0.25). Remember that you can read out the GPIO configuration. The registers are listed on InfoCenter:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=4_0_0_5_8_1_9#register.PIN_CNF-0-31"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=4_0_0_5_8_1_9#register.PIN_CNF-0-31&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So for pin 25 that would be address 0x50000764. If you read this address using nrfjprog --memrd 0x50000764 after programming the bootloader, you will see that it has the value 0x0003000C. If you change the bootloader define in sdk_config.h:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 25&lt;br /&gt;to&lt;br /&gt;#define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 26&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You will see that address 0x50000768 (pin 26) reads 0x0003000C.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you also perform a DFU, so that your chip contains a bootloader and an application, and you start the application, you can see that pin 26 is still set to 0x0003000C, meaning it has a pullup, and is a connected input with sense for low level, even if your application didn&amp;#39;t initialize anything on pin P0.26.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The reason I tested with button pin 26 is that most examples initialize the buttons with the same settings, and pin P0.25 is Button4 on the DK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This means that if you want different behavior on the pins in your bootloader and application, you must set this in the application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pin settings when moving from Bootloader to Application mode</title><link>https://devzone.nordicsemi.com/thread/254446?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 13:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:448a13fd-f1b4-46da-835c-d77b18da1406</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p style="margin-top:0in;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;Hi,&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;Yes&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON is enabled. I am trying to understand your statement &amp;quot;I would imagine that they would be reset again, but perhaps they are manually reset&amp;nbsp;&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;Irrespective of P0.25, assume I configure few pins in bootloader as PULLUP. Now if I reset chip, control will go to bootloader configure gpio pins as PULLUP and since P0.25 is not Low control will be given to Application mode. In Application mode if I don&amp;#39;t configure gpio pins will these pins retain PULLUP state as the same configured in bootloader or will reset to default state NOPULL.&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;Can you please crosscheck with your R&amp;amp;D team. Unfortunately I am not in office. Otherwise I would have tested using CRO by configuring few pins.&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;Thanks &amp;amp; Regards&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;, sans-serif;font-size:9.0pt;"&gt;Vishnu Beema&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO pin settings when moving from Bootloader to Application mode</title><link>https://devzone.nordicsemi.com/thread/254444?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 12:17:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d9e58fd-e678-4ff5-9964-59af5908c35a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Vishnu,&lt;/p&gt;
&lt;p&gt;1) When the device is reset, all the pins are set as disconnected inputs (the state that doesn&amp;#39;t draw any power/current). I am not sure exactly what happens when you go from the bootloader to the app. I would imagine that they would be reset again, but perhaps they are manually reset (the UART and button pin are disabled).&lt;/p&gt;
&lt;p&gt;2) Either way, you can change this in the application, yes.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Based on how you ask this question, I suspect that you want to change the configuration after entering the application, is that correct? Have you noticed the NRF_BL_DFU_ENTER_METHOD_BUTTON in the bootloader project? Look how this is used in&amp;nbsp;nrf_bootloader_init() in nrf_bootloader.c. If you want to decide whether or not to enter DFU mode based on a pin input, I guess you can use that. After you start your application, you can do whatever you like to the GPIOs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>