<?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>bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44872/bootloader-does-not-work-if-compiled-using-armgcc</link><description>Hello! 
 SDK 15.3 
 If I build secure_bootloader example project using Segger Embedded Studio it works, I can see it nRF connect. 
 If I build it using armgcc it does not work and I can not attach Ozone debugger to it. 
 The only change I did to project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Apr 2019 14:00:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44872/bootloader-does-not-work-if-compiled-using-armgcc" /><item><title>RE: bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/thread/183862?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 14:00:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18d3bac7-a4bb-4f50-b404-ac2b51535877</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi Eliot,&lt;/p&gt;
&lt;p&gt;The main reason for this was&amp;nbsp;convenience. I agree that the name is now confusing, and I have requested the name to be updated in the next SDK release.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/thread/182211?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 23:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8b4978e-faa8-482c-bb08-096b950da5e1</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Why did you not rename&amp;nbsp;&lt;span&gt;uicr_bootloader_start_address at the same time? It is no longer in the UICR, so the name is very confusing.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/thread/176508?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2019 17:06:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:300848cf-6649-46fb-9b61-d96cbb06057f</guid><dc:creator>Elias L&amp;#246;we</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you it works!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/thread/176446?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2019 14:15:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14cf60ff-731f-498e-922c-adeadc2f1792</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The reason why --sectorerase is erasing the MBR(&lt;span&gt;0x0 to 0x1000&lt;/span&gt;), is that the bootloader in SDK 15.3 stores the&amp;nbsp;uicr_bootloader_start_address and&amp;nbsp;uicr_mbr_params_page in the MBR part of the flash (0x0FF8 and&amp;nbsp;&lt;span&gt;0x&lt;/span&gt;&lt;span&gt;0FFC&amp;nbsp;&lt;/span&gt;). &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44233/changed-mbr-parameter-handling-in-sdk15-3-0/"&gt;See this page&lt;/a&gt;.&amp;nbsp;&lt;span&gt;--sectorerase&amp;nbsp;then erases the whole page(0x0 to 0x1000) before writing the hex file. The make flash and make flash_softdevice commands have unfortunately not been&amp;nbsp;updated to reflect this&amp;nbsp;change in SDK 15.3&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A workaround is then to use mergehex, and merge the SoftDevice hex(it includes the MBR) and the application/bootloader hex. You can change the makefile to include something like this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Flash softdevice and app
flash_softdevice_and_app:
	@echo Flashing: s132_nrf52_6.1.1_softdevice.hex and app
	mergehex -m $(OUTPUT_DIRECTORY)/nrf52832_xxaa_s132.hex $(SDK_ROOT)/components/softdevice/s132/hex/s132_nrf52_6.1.1_softdevice.hex -o sd_app.hex
	nrfjprog -f nrf52 --program sd_app.hex --sectorerase
	nrfjprog -f nrf52 --reset&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and then use &lt;em&gt;make&amp;nbsp;flash_softdevice_and_app&lt;/em&gt;, to flash both the SoftDevice and the bootloader.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/thread/176439?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2019 13:59:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a4ecc0d-4100-4720-9eab-26113a63242e</guid><dc:creator>Elias L&amp;#246;we</dc:creator><description>&lt;p&gt;Yesterday I&amp;#39;ve found the solution or workaround:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve changed in&amp;nbsp;secure_bootloader_gcc_nrf52.ld&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x6000
  RAM (rwx) :  ORIGIN = 0x200057b8, LENGTH = 0xa848
  uicr_bootloader_start_address (r) : ORIGIN = 0x00000FF8, LENGTH = 0x4
  uicr_mbr_params_page (r) : ORIGIN = 0x00000FFC, LENGTH = 0x4
  mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
  bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x6000
  RAM (rwx) :  ORIGIN = 0x200057b8, LENGTH = 0xa848
  uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
  mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
  bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
  uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;taken from older SDK.&lt;/p&gt;
&lt;p&gt;Please confirm if it is safe solution or suggest correct one?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader does not work if compiled using armgcc</title><link>https://devzone.nordicsemi.com/thread/176224?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 14:04:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94cc7afb-2423-443f-b61b-4d2fcace2fb7</guid><dc:creator>Elias L&amp;#246;we</dc:creator><description>&lt;p&gt;I&amp;#39;ve just tried to flash HEX file produced by SES using nrfjprog ang got the same state.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog -f nrf52 --program ../ses/Output/Release/Exe/secure_bootloader_ble_s132_pca10040.hex --sectorerase
Parsing hex file.
Erasing page at address 0x0.
Erasing page at address 0x78000.
Erasing page at address 0x79000.
Erasing page at address 0x7A000.
Erasing page at address 0x7B000.
Erasing page at address 0x7C000.
Erasing page at address 0x7D000.
Applying system reset.
Checking that the area to write is not protected.
Programming device.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It seems problem is not in FW itself or toolchain.&lt;/p&gt;
&lt;p&gt;It seems nrfjprog erases 0x0 page where softdevice is (if I am not wrong)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>