<?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>Startup time and GPIO interrupts with bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42618/startup-time-and-gpio-interrupts-with-bootloader</link><description>Hello, I use a custom board with nRF51822QFAA, with two buttons (left, right) and uart for printf/debug. The idea of the project is to have the board always sleeping, it wakes up when a button is pressed, sends the corresponding command over BLE and back</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Jan 2019 14:24:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42618/startup-time-and-gpio-interrupts-with-bootloader" /><item><title>RE: Startup time and GPIO interrupts with bootloader</title><link>https://devzone.nordicsemi.com/thread/166281?ContentTypeID=1</link><pubDate>Thu, 17 Jan 2019 14:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02f8be08-3732-432d-a5d8-fece63414e12</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Why does a bootloader add time at startup ? And why this added time is longer when the app code is bigger in size ?[/quote]
&lt;p&gt;The bootloader will calculate the CRC of the application at every boot, and compare it with the expected CRC in the bootloader settings page. The large the application firmware, the longer it takes to calculate the CRC.&amp;nbsp;The application is started if the CRC match. If not, the bootloader enters DFU mode.&lt;/p&gt;
[quote user=""]How to reduce / eliminate the startup time added by the bootloader ?[/quote]
&lt;p&gt;&amp;nbsp;You can see how this is handled in the&amp;nbsp;nrf_dfu_app_is_valid() implementation in nrf_dfu_utils.c. In most cases removing the CRC check should be safe - you would anyway not be any worse off than in the case where there is no bootloader.&amp;nbsp;&lt;/p&gt;
[quote user=""]Is it normal that the example of bootloader from SDK12 (&lt;span&gt;\examples\dfu\bootloader_secure) does not propagate gpio interrupts to the app ?&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes.&lt;/p&gt;
[quote user=""]With a bootloader, and even with a long startup time and no interrupt, how can I know which button was pressed when the chip wakes up ?[/quote]
&lt;p&gt;If you use the sense mechanism for GPIO pins (for low power), then you cannot know without reading the state of the pins. Doing so from the application might be too late if CRC validation takes a long time. You could device a application specific way of reading the pin state and storing it at a specific location in RAM which is read by the application. However, I would argue that a better and simpler approach is to skip CRC validation and just read the pins in the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>