<?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>Upload hex-File with J-Flash and J-Link with/without Bootloader, application not starting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76659/upload-hex-file-with-j-flash-and-j-link-with-without-bootloader-application-not-starting</link><description>Hello, I am having trouble understanding the flashing process of an nrf52840. I have programmed a simple flashing example with the nRF5 SDK. I compiled the project using make and GNU gcc. If I transfer the generated hex-file with the nrf Connect Programmer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Jun 2021 12:10:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76659/upload-hex-file-with-j-flash-and-j-link-with-without-bootloader-application-not-starting" /><item><title>RE: Upload hex-File with J-Flash and J-Link with/without Bootloader, application not starting</title><link>https://devzone.nordicsemi.com/thread/316722?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 12:10:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f07a94b2-abf8-46d7-850f-2f657e5a020e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. You could do a full chip erase to debug the dongle as normal (you also would not meet the issues with voltage I described in &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;this tutorial&lt;/a&gt; as you are using a debugger that supports a vide voltage range). If not, you need to keep using the nRF Connect Programmer and program via USB DFU or update the bootloader settings page with the correct CRC of your app whenever you program a new one. If not, the bootloader will see that the CRC does not match the current application and will enter DFU mode instead of starting the app.&lt;/p&gt;
&lt;p&gt;(Generally I would recommend a DK for development as that has everything you need and to not give you these additional hurdles, but as you have a proper debugger that should be fine as well.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload hex-File with J-Flash and J-Link with/without Bootloader, application not starting</title><link>https://devzone.nordicsemi.com/thread/316713?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 11:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:878d79cf-e25f-4420-9780-57ea8b5c32c5</guid><dc:creator>MarkusK</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;since I am doing home office from Bali, I was only able to get two nRF52840 USB Dongle from Makerdiary first. As an external Programmer/Debugger I got the Segger J-Link V8. I am teaching students on the topic wireless sensor network and they have to do projects in this area. So I am looking for a solution which fulfills the requirements for education, this means reliable, easy to use and not too expensive. For ZigBee I designed before already our own developer boards. Now I am looking if we can extend our experience using Thread-networks and the Nordic solution looks promisings. &lt;br /&gt;&lt;br /&gt;And for education purposes, I also like not using the bootloader first, but then we need an easy way to program the nRF52840. By the way, the J-Link V8 programmer is not shown in the nRF Connect Programmer App. Only the device itself, when it enters the bootloader mode.&lt;br /&gt;&lt;br /&gt;Thx for your help. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload hex-File with J-Flash and J-Link with/without Bootloader, application not starting</title><link>https://devzone.nordicsemi.com/thread/316686?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 11:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6c2d30f-4204-4f13-8c13-ad55dfe40b80</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="MarkusK"]I think I solved half of the problem. Since the nRF Connect Programmer using the bootloader to program the device it is not written the hex-File only. When I read out the flash there are definitely a few bytes at the end of the memory different. And the bootloader set also a flag that there is a valid app flashed in the memory. When I do it with J-Flash and J-Link this flag will not be set and the bootloader will never start the application.[/quote]
&lt;p&gt;Yes, if you use the USB bootloader to program this will be the case (typically for the nRF52840 dongle which ships with a SUB bootloader). But note that if you use nRF Connect programmer to flash via a debugger (like the onboard debugger on a DK), it will not write anything other than the hex file you provide. So if you program the app using a debugger and you have a bootloader, you also need to generate a valid bootloader settings page and program that as well (see &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_settings_generate_display.html"&gt;Generating and displaying bootloader settings&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Which device are you working on? I would generally recommend to start without a bootloader as its presence causes some hassle when developing.&lt;/p&gt;
[quote user="MarkusK"]When I erase the whole memory and flash only the mbr (without bootloader) and the blink.hex the program is working fine, the mbr jumps directly to the address 0x1000 where the application lies. But I have really to erase the whole chip before since UICR.NRFFW[0] needs to be not set and the address 0xFFC needs to be 0xFFFFFFFF.[/quote]
&lt;p&gt;Yes. If you have a recent MBR it first checks 0x00000FFC. If that is all ff&amp;#39;s it checks UICR.NRFFW[0]. If&amp;nbsp;neither is&amp;nbsp;set &amp;nbsp;then the MBR will continue executing from 0x1000 (where either the application or SoftDevice resides). If one of them is set, that is assumed to be the bootloader start address and the MBR will jump to it.&lt;/p&gt;
[quote user="MarkusK"]To set the flag for a valid app manually I couldn&amp;#39;t figure it out since nrfjprog is still not working. See the attached log for the erase command: nrfjprog --family nRF52 --eraseall --log[/quote]
&lt;p&gt;I see there is an error but do not make much sense of it. Which HW are you using to test? Are you using the onboard debugger on the DK, or an external debugger? If so, which debugger are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload hex-File with J-Flash and J-Link with/without Bootloader, application not starting</title><link>https://devzone.nordicsemi.com/thread/316653?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 09:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a183020-f414-4ba3-9efe-59d2783f7875</guid><dc:creator>MarkusK</dc:creator><description>&lt;p&gt;Hello Einar,&lt;br /&gt;&lt;br /&gt;I think I solved half of the problem. Since the nRF Connect Programmer using the bootloader to program the device it is not written the hex-File only. When I read out the flash there are definitely a few bytes at the end of the memory different. And the bootloader set also a flag that there is a valid app flashed in the memory. When I do it with J-Flash and J-Link this flag will not be set and the bootloader will never start the application.&lt;br /&gt;&lt;br /&gt;When I erase the whole memory and flash only the mbr (without bootloader) and the blink.hex the program is working fine, the mbr jumps directly to the address 0x1000 where the application lies. But I have really to erase the whole chip before since UICR.NRFFW[0] needs to be not set and the address 0xFFC needs to be 0xFFFFFFFF.&lt;br /&gt;&lt;br /&gt;To set the flag for a valid app manually I couldn&amp;#39;t figure it out since nrfjprog is still not working. See the attached log for the erase command: nrfjprog --family nRF52 --eraseall --log&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;FYI: I am still new to the nordic hard and software. I use before mostly Atmel avr-Mikrocontroller and the ZigBee-Stack Bitcloud. So I still try to understand the hard and software structure from the nRF52840 and I am trying to get ZigBee and Thread running. But the example I used here was just the peripheral example blink from the SDK which I adjust a little. No Softdevice, no Bluetooth, or anything else yet.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7651.log.log"&gt;devzone.nordicsemi.com/.../7651.log.log&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload hex-File with J-Flash and J-Link with/without Bootloader, application not starting</title><link>https://devzone.nordicsemi.com/thread/316641?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 08:50:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77886473-923b-4cb7-b87c-628475e11cd8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;Using nRF Connect programmer to program via a debugger it will not write anything other than what is in the hex file. And you should not have any problem programming the hex file with other tools either. It should work out of the box. Can you specify exactly which projects you build and which MBR/SoftDevice etc you use with those, and any other hex files you also program, as well as the method you use to program step by step? Perhaps that will reveal somethings I cannot think of at the moment. Can you also upload the hex files here so that I can inspect them and test on my side?&lt;/p&gt;
[quote user=""]I also tried to flash the hex files via the command line with nrfjprog, but I got the error message &amp;quot;ERROR: JLinkARM DLL reported an error&amp;quot;.[/quote]
&lt;p&gt;Can you generate a log by using the --log option and upload it here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>