<?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>DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13366/dfu-with-nrf52-and-segger-embedded-studio</link><description>So having first used Kiel, then Eclipse, it was great to finally ditch my clunky windows laptop with its terribly laid out keyboard by making the transition to Segger Embedded Studio. Super easy to set up, looks great on my very large Mac screen and I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Aug 2016 09:43:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13366/dfu-with-nrf52-and-segger-embedded-studio" /><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50972?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2016 09:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87adef7d-e31a-4d78-b08e-6d07738632a6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@nateperry : You can set the valid application flag in the bootloader settings by editing the following line in bootloader_settings.c form&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__ ((section(&amp;quot;.bootloaderSettings&amp;quot;))); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__ ((section(&amp;quot;.bootloaderSettings&amp;quot;))) = {BANK_VALID_APP}; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and setting the   .bootloaderSettings sectoni to load=&amp;quot;Yes&amp;quot; in the flash placement xml.file. I have attached the Memory Map and Flash placment files below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Attachments:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF52832_5F00_xxAA_5F00_MemoryMap.xml"&gt;nRF52832_xxAA_MemoryMap.xml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/flash_5F00_placement.xml"&gt;flash_placement.xml&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50971?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2016 15:48:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:576868ba-af71-45f2-8139-f115ef41e3d6</guid><dc:creator>Nate</dc:creator><description>&lt;p&gt;Is there somewhere the  bootloader_setting_nrf52.hex file is available at?
The github link above is gone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50970?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2016 11:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9afd7b62-213d-4400-9865-c58b2fb695d2</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;The &lt;em&gt;dfu_gcc_nrf52.ld&lt;/em&gt; linker scripts is located in &lt;em&gt;\examples\dfu\bootloader&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50964?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 13:05:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f30b6d4c-c4cd-42a2-89d9-b3316f6fbb43</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Hi Mike - there doesn&amp;#39;t seem to be any .ld files in the dfu project folders I can see.  I know SES creates some additional files in a project, could this be causing the boot loader &amp;quot;application&amp;quot; to swell beyond what the hex is when you open it as a solution?  Just a guess.  Let me know how you get on.  RJH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50969?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 12:14:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e6e126d-5125-4406-b335-859b430d687d</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;OK, I&amp;#39;m trying to do this now. I thought you were just doing an application that has DFU. Usually I just use the pre-compiled bootloader in hex and don&amp;#39;t touch it so I&amp;#39;ve never done this in Embedded Studio. I&amp;#39;m seeing the same problems you are. Have you looked at dfu_gcc_nrf52.ld in the dfu project folder in the SDK? It will tell you the RAM addresses you were looking for. Will keep you posted if i fix this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50968?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 11:36:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9014c149-a939-4f83-8817-15ff485f2805</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Right, in properties there is &amp;quot;Code Generation Options&amp;quot; under which there is &amp;quot;Optimisation Level&amp;quot;.  It has a drop down of 5 choices, 3 of these are level 1 through level 3.  Unfortunately when changing the setting to each of these still yields the following:
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: Output/Debug/Exe/nrf52832_xxaa.elf section &lt;code&gt;.bootloaderSettings&amp;#39; will not fit in region&lt;/code&gt;UNPLACED_SECTIONS&amp;#39;
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: region `UNPLACED_SECTIONS&amp;#39; overflowed by 4097 bytes
Good news is that a lot of the other warnings about things not fitting have gone away, but we are left with the above.
Thanks once more - RJH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50967?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 11:23:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba8a559b-0fac-4970-832a-83374d48c839</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;OK, I might know what&amp;#39;s going on. On nRF52 the bootloader is reserved the flash at 0x7A000-0x80000. This is 24,576 bytes. In Keil, the bootloader project has optimizations configured to minimize code size and the compiled bootloader is small enough to fit in this section.&lt;/p&gt;
&lt;p&gt;In Embedded Studio optimizations are turned off by default. You need to configure the optimization level in Project Properties. Simply setting it at -0s (smallest) or -03 (highest performance, still small) should solve this problem for you.&lt;/p&gt;
&lt;p&gt;As for your application: You will be able to flash the SoftDevice, application and bootloader all at once. Just make sure you also flash the hex file I attached that writes the flag in the bootloader settings along with them. This can be done very efficiently in Embedded Studio by setting each of those files to be loaded with the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50966?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 11:14:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d092b598-1e92-4e2f-b2ce-e5c343a3c845</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Just to confirm that when I close the solution down fully, open it alter the section macro addresses as above, point to the SD hex for loading I still get the message above.  So it is not me having somehow expanded the bootloader through tampering - RJH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50965?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 10:52:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:183dbe42-80ad-4725-8c2c-792eff570e7a</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks, very useful, and good to hear that this can largely be done through SES.&lt;/p&gt;
&lt;p&gt;My application is somewhat ambitious using sensors that can be a little tricky, so for development and debugging purposes it is crucial I can flash straight through the IDE.  Anyway, the logical workflow is to largely finish the development of the app and then introduce the boot loader at the end, I get that.&lt;/p&gt;
&lt;p&gt;I was just trying to flash the boot loader itself for the moment (single_bank_serial_s132_) together with the SD.  I have FLASH_START at 0x07A000 (end of memory region as you confirm) but I am unsure where to get the RAM_START from.  Normally I scrape it from the .ld file in the armgcc folder but I notice for all of the boot loader examples the armgcc folder does not have an .ld.  What is another way in which I can find out the RAM_START for the boot loader?&lt;/p&gt;
&lt;p&gt;Currently when I try to flash I get this message (using RAM_START of 0x20002080):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;1&amp;gt; Linking nrf52832_xxaa.elf
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: Output/Debug/Exe/nrf52832_xxaa.elf section &lt;code&gt;.bootloaderSettings&amp;#39; will not fit in region&lt;/code&gt;UNPLACED_SECTIONS&amp;#39;
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: error: .text is too large to fit in FLASH memory segment
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: error: .rodata is too large to fit in FLASH memory segment
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: error: .data is too large to fit in FLASH memory segment
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: region `UNPLACED_SECTIONS&amp;#39; overflowed by 4097 bytes
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: error: .text is too large to fit in FLASH memory segment
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: error: .rodata is too large to fit in FLASH memory segment
1&amp;gt; /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: error: .data is too large to fit in FLASH memory segment&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is possible I have contaminated the size of the files with the project open in SES during my investigative probings, so I haven&amp;#39;t completely scrapped it and started again.  Before I did that I just wanted to see if there was a way to progress from here since this is good learning for going forward.&lt;/p&gt;
&lt;p&gt;Thanks once again - RJH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU with NRF52 and Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/50963?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2016 08:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f511bb47-1e40-43c3-9f49-ee402dd8c8b5</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve used SEGGER Embedded Studio with DFU apps so we&amp;#39;ll figure this out.&lt;/p&gt;
&lt;p&gt;First problem with the compile error in bootloader_util.c. I ran into this at well. I believe it is a GCC problem. Setting the -fomit-frame-pointer flag in the compiler settings fixes it as you have discovered.&lt;/p&gt;
&lt;p&gt;1.) Yes this is possible. I was doing some DFU stuff and Embedded Studio was great because of how easy it was to flash the SoftDevice, Bootloader and application at once. (Remember when you flash the application along with the SD and BL instead of updating it via DFU you need to write a flag to tell the BL there is a valid application in flash already that it should run).&lt;/p&gt;
&lt;p&gt;2.) Section placement macros should not be complicated. Should be the same as you would see in Keil project settings or the GCC linkers you&amp;#39;ve been looking at.&lt;/p&gt;
&lt;p&gt;Now there are two scenarios:&lt;/p&gt;
&lt;p&gt;Is your project an application with DFU capabilities or are you working on the actual bootloader?&lt;/p&gt;
&lt;p&gt;If working on an application with DFU you shouldn&amp;#39;t have to do anything special. Just make sure the section placement macros have FLASH_START and SRAM_START defined the same as they would for any application with a SoftDevice present. (This is [0x1C000, 0x20002080] I believe for the s132 2.0 SD but double check). These shouldn&amp;#39;t change at all for DFU because the bootloader is located at the end of FLASH (and RAM doesn&amp;#39;t change at all).&lt;/p&gt;
&lt;p&gt;The tricky part: You can&amp;#39;t just flash the SoftDevice, application and bootloader at once. The straight forward way I suggest you try first is flash the Softdevice and bootloader using nrfjprog or a similar tool. Then upload the application you compile in Embedded Studio to your board via the DFU process (using master control panel on PC or mobile app probably). This should work.&lt;/p&gt;
&lt;p&gt;But this is a pain for developing! More info on the dev zone about this: &lt;a href="https://devzone.nordicsemi.com/question/12800/flashing-bootloader-and-application-via-j-link/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;. But its not as complicated as they make it in that thread so don&amp;#39;t read to much..&lt;/p&gt;
&lt;p&gt;1.) Flash the softdevice, application and bootloader all at once (don&amp;#39;t run the cpu yet though).
2.) Write the flag in memory telling the bootloader a valid application is already present in flash and that it should run that. This is one word in flash. And this can be done either with nrfjprog or you can flash a hex file that programs the one word: &lt;a href="https://github.com/espruino/Espruino/blob/nordic_dfu_ota/targetlibs/nrf5x/nrf5_singlebank_bl_hex/bootloader_settings_nrf52.hex"&gt;github.com/.../bootloader_settings_nrf52.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So if you use the hex file I attached then you can automate your process nicely in Embedded Studio:
flash the sd.hex, app.hex, bl.hex, bootloader_setting_nrf52.hex and then reset and run the program. It should work now! And remember in Debugger-&amp;gt;Loader Options you can have 4 files loaded every time you program the board so this is perfect!&lt;/p&gt;
&lt;p&gt;If you are working on an actual bootloader its straightforward: Just set the FLASH_START to 0x7A000 or something like that. And I forget about RAM start but jsut double check Keil and GCC projects.&lt;/p&gt;
&lt;p&gt;-Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>