<?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>nRF52832 + nrfjprog: need to program twice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57351/nrf52832-nrfjprog-need-to-program-twice</link><description>Our custom board has an nRF52832. In our custom build system the application HEX and SoftDevice HEX are merged together into a single HEX file, this is achieved by Nordic&amp;#39;s mergehex tool. nrfjprog is used to program the device&amp;#39;s flash. Here&amp;#39;s the command</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Feb 2020 14:05:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57351/nrf52832-nrfjprog-need-to-program-twice" /><item><title>RE: nRF52832 + nrfjprog: need to program twice</title><link>https://devzone.nordicsemi.com/thread/232597?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 14:05:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e81ccc30-d620-41c2-af96-82ef2ca45599</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;The newest nrfjprog is v10.6.0, and the jlinkarm is at v6.60. You could try to update and see if this helps the scenario.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 + nrfjprog: need to program twice</title><link>https://devzone.nordicsemi.com/thread/232581?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 13:33:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13b82ea2-6f1c-4a27-87a7-92331f00cc04</guid><dc:creator>Tamas Selmeci</dc:creator><description>&lt;p&gt;These are my versions:&lt;/p&gt;
&lt;p&gt;nrfjprog version: 9.8.1&lt;br /&gt;JLinkARM.dll version: 6.40&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 + nrfjprog: need to program twice</title><link>https://devzone.nordicsemi.com/thread/232551?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 12:41:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d839a604-78c8-493c-936c-fab1a5d1dbf3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;You can try to reduce the clock speed, and see if this has any impact on the verification process.&lt;/p&gt;
&lt;p&gt;In addition, I would recommend checking your nrfjprog version to see if its old.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 + nrfjprog: need to program twice</title><link>https://devzone.nordicsemi.com/thread/232534?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 12:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c516a33-94a1-4df7-b3a4-f2315fd16f78</guid><dc:creator>Tamas Selmeci</dc:creator><description>&lt;p&gt;Thanks for the help.&lt;/p&gt;
&lt;p&gt;--verify itself didn&amp;#39;t solve the issue, but showed me that every second write of the flash is bad, verify fails. (It appears that --sectorerase may contain bugs).&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve refactored my build script and it now works alright:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;	$(TOOL_DIR)/opt/nrfjprog/nrfjprog \
		--jdll $(TOOL_DIR)/opt/JLink_Linux/libjlinkarm.so \
		-f NRF52 \
		--clockspeed 4000 \
		--erasepage 0x00000000-0x0007E000
	
	$(TOOL_DIR)/opt/nrfjprog/nrfjprog \
		--jdll $(TOOL_DIR)/opt/JLink_Linux/libjlinkarm.so \
		-f NRF52 \
		--clockspeed 4000 \
		--program complete.hex \
		--verify \
		--reset&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;NOTE: the last two pages of the flash are intentionally not erased, because some config is stored there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 + nrfjprog: need to program twice</title><link>https://devzone.nordicsemi.com/thread/232520?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 11:22:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f2d0d34-2376-4031-b92e-a53d71742e67</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;Executes without a problem. The weird thing is that if I change the source code, recompile the program and issue the command above, the MCU fails to start, but after the second call of this command the MCU starts with the new binary.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s quite annoying to always burn the same new flash content two times. Have you got any idea what can this be?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t seen this behavior myself, but; I do see that you do not use --verify, so that might be an issue.&lt;/p&gt;
&lt;p&gt;What version of nrfjprog / jlink are you using? This can be printed via nrfjprog --version.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>