<?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>Hex file flashing using cli on to the NRF52840 target board.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67188/hex-file-flashing-using-cli-on-to-the-nrf52840-target-board</link><description>Hello 
 I&amp;#39;m using the nrf52840 DK with sdk version of 15.0.0. 
 
 My requirement is to flash my project through cli commands, so I have followed the following steps in below. 
 1) For my project I have used the ble_app_freertos example project. 
 2) Then</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Oct 2020 12:48:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67188/hex-file-flashing-using-cli-on-to-the-nrf52840-target-board" /><item><title>RE: Hex file flashing using cli on to the NRF52840 target board.</title><link>https://devzone.nordicsemi.com/thread/274896?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 12:48:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97a82efe-9265-4c4c-bf6e-1d6b4ee5fea2</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;1. I just tested this myself by opening the command line in &lt;strong&gt;\&amp;lt;SDK_FOLDER&amp;gt;\examples\ble_peripheral\ble_app_hrs_freertos\hex&lt;/strong&gt;, flashed the application onto the device and reset it with the same commands you did and I can see that it successfully built and starts advertise once reset.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;C:\nordicsemi\SDK\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_hrs_freertos\hex
λ nrfjprog -f NRF52 --program ble_app_hrs_freertos_pca10056_s140.hex --chiperase
Parsing hex file.
Erasing user available code and UICR flash areas.
Applying system reset.
Checking that the area to write is not protected.
Programming device.

C:\nordicsemi\SDK\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_hrs_freertos\hex
λ nrfjprog -f NRF52 --reset
Applying system reset.
Run.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. Seeing as you made your own .hex file, you have to merge your application .hex file with a SoftDevice. merge these by writing something like &lt;strong&gt;mergehex --merge &amp;lt;hex.file&amp;gt; &amp;lt;hex.file&amp;gt; [&amp;lt;hex.file&amp;gt;]&lt;/strong&gt; (Hex files to be merged) &lt;strong&gt;--output &amp;lt;hex.file&amp;gt;&lt;/strong&gt;&amp;nbsp;(Hex file result of the merge). This is part of the nRF Command Line Tools, so you shouldn&amp;#39;t have to&amp;nbsp;download anything extra.&lt;/p&gt;
&lt;p&gt;The SoftDevice.hex files can be found in &lt;strong&gt;\&amp;lt;SDK_FOLDER&amp;gt;\components\softdevice.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&amp;nbsp;&lt;/strong&gt;I see &lt;a href="https://devzone.nordicsemi.com/members/ivoc"&gt;Ivo&lt;/a&gt; beat me to it &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hex file flashing using cli on to the NRF52840 target board.</title><link>https://devzone.nordicsemi.com/thread/274888?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 12:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69b897fe-b1fc-455f-bf1c-c30f51203125</guid><dc:creator>manoj97</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/ivo"&gt;ivo&lt;/a&gt; Thanks for your reply&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hex file flashing using cli on to the NRF52840 target board.</title><link>https://devzone.nordicsemi.com/thread/274886?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 12:30:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ded6f24a-4123-45f6-a620-2a5856ef99bc</guid><dc:creator>manoj97</dc:creator><description>&lt;p&gt;I fixed the bug previously I have used following command&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nrfjprog -f NRF52 --program nrf52840_xxaa.hex --chiperase&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;but instead of &amp;quot;&lt;strong&gt;--chiperase&lt;/strong&gt;&amp;quot;&amp;nbsp; use &lt;strong&gt;&amp;quot;--sectorerase&amp;quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nrfjprog -f NRF52 --program nrf52840_xxaa.hex --sectorerase&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;it worked!!!!!!!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a title="check the difference between chiperase and sectorerase here" href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_nrfjprogexe_reference.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_nrfjprogexe_reference.html&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hex file flashing using cli on to the NRF52840 target board.</title><link>https://devzone.nordicsemi.com/thread/274879?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 12:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3412a5c1-f659-4090-bd19-0124e174fb4f</guid><dc:creator>Ivo</dc:creator><description>&lt;p&gt;@manoj97&amp;nbsp;looks like you may also need to program a SoftDevice HEX file, as in:&lt;br /&gt;&lt;br /&gt;nrfjprog -f nrf52 --program&amp;nbsp;&lt;span class="s1"&gt;s132_nrf52_7.0.1_softdevice.hex&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>