<?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 gcc linker setting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72563/dfu-gcc-linker-setting</link><description>Hi, 
 I have a question regarding linker file in case of gcc make. I need to create a DFU package and program the it on a bootloader. 
 Here is my linker file: 
 
 I know that I should define the location where bootloader start address is stored in this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Mar 2021 14:20:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72563/dfu-gcc-linker-setting" /><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/300712?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 14:20:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ba3e17b-e616-4033-840f-e4b444c6a618</guid><dc:creator>Sigurd</dc:creator><description>[quote user="tai2020"]But when I tryed to program the package via DFU, the connection stoped and the package did not upload.[/quote]
&lt;p&gt;&amp;nbsp;Maybe you could use the debug variant of the bootloader, it&amp;#39;s the bootloader project with the _debug prefix, and take a look at the nrf_log output from the bootloader to see if you get any errors in the bootloader when DFU is performed?&lt;/p&gt;
[quote user="tai2020"]My problem is that everything seems ok with keil. But I can not use gcc complier[/quote]
&lt;p&gt;Check if RAM and FLASH start address is the same in Keil and in the GCC linker script. Maybe there is a difference there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/300695?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 13:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b18e555-971a-41d5-877c-928ac6f6b784</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;I do not get any errors. The code compiled and the package is created without any waring or errors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;make: Entering directory `.../nRF5_SDK_17.0.2_d674dde/examples/ble_peripheral/ble_hrs/pca10040/s132/armgcc&amp;#39;
Linking target: _build/nrf52832_xxaa.out
   text    data     bss     dec     hex filename
  93004     188    4880   98072   17f18 _build/nrf52832_xxaa.out
Preparing: _build/nrf52832_xxaa.hex
Preparing: _build/nrf52832_xxaa.bin
DONE nrf52832_xxaa
make: Leaving directory `.../nRF5_SDK_17.0.2_d674dde/examples/ble_peripheral/ble_hrs/pca10040/s132/armgcc&amp;#39;

C:\...&amp;gt;nrfutil pkg generate --hw-version 52 --application-version 0 --application ...\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_hrs\pca10040\s132\armgcc\_build\nrf52832_xxaa.hex --sd-req 0x0101 --key-file keys/private.key app_001001-B.zip
Zip created at app.zip&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I had already added&amp;nbsp;NRF_DFU_TRANSPORT_BLE=1 and NRF_DFU_SVCI_ENABLED to keil and makefile. But I have not this flag even in keil:&amp;nbsp;BL_SETTINGS_ACCESS_ONLY&lt;/p&gt;
&lt;p&gt;My problem is that everything seems ok with keil. But I can not use gcc complier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/300134?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 13:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bdfa2ad-b528-430b-8e6b-2facf5889d9c</guid><dc:creator>Sigurd</dc:creator><description>[quote user="tai2020"]But I can not use the package created by gcc.[/quote]
&lt;p&gt;&amp;nbsp;Do you get any errors, warnings? Do you have any log output?&lt;/p&gt;
&lt;p&gt;You might need to add e.g. these C and Assembler flags to the makefile:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_DFU_TRANSPORT_BLE=1
NRF_DFU_SVCI_ENABLED
BL_SETTINGS_ACCESS_ONLY&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299354?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 21:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:180fd14d-96c6-4888-9434-64462e797276</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;It is&amp;nbsp;17.0.2 version.&lt;/p&gt;
&lt;p&gt;I am using hrs example and I added&amp;nbsp;&amp;nbsp;&lt;span&gt;ble_dfu_buttonless_async_svci_init() and other dfu codes to the example. When I use .hex&amp;nbsp;created by keil it seems to be ok.&amp;nbsp;But I can not use the package created by gcc.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;it is DFU package creator that I use:&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;nrfutil pkg generate --hw-version 52 --application-version 0 --application ~\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_habil_up\pca10040\s132\armgcc\_build\nrf52832_xxaa.hex --sd-req 0x0101 --key-file keys/private.key app_%1.zip&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299345?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 20:13:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baf74938-6b3e-40d3-9099-2662e0c9a186</guid><dc:creator>Sigurd</dc:creator><description>[quote user="tai2020"]But when I tryed to program the package via DFU, the connection stoped and the package did not upload[/quote]
&lt;p&gt;&amp;nbsp;What SDK version are you using?&lt;/p&gt;
&lt;p&gt;Are you using the bootloader in&amp;nbsp;examples\dfu\secure_bootloader\pca10040_s132_ble ?&lt;/p&gt;
&lt;p&gt;Can you post the command you used to create the DFU package?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299058?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 14:48:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fefe46d-4520-4d23-93ca-0e41bf198000</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;I tryed to change the flash and ram size to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x52000
  RAM (rwx) :  ORIGIN = 0x20002bf0, LENGTH = 0xd410
  uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
}

SECTIONS
{
  . = ALIGN(4);
  .uicr_bootloader_start_address :
  {
    PROVIDE(__start_uicr_bootloader_start_address = .);
    KEEP(*(SORT(.uicr_bootloader_start_address*)))
    PROVIDE(__stop_uicr_bootloader_start_address = .);
  } &amp;gt; uicr_bootloader_start_address
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I could compile and link and creat the package. But when I tryed to program the package via DFU, the connection stoped and the package did not upload.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299051?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 14:40:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65bb4f4f-65cf-49e3-9e99-bad49a7e0b66</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;I am going to try it.&lt;/p&gt;
&lt;p&gt;But know I have another question. I used hrs example and then I added&amp;nbsp;&lt;span&gt;ble_dfu_buttonless_async_svci_init()&amp;nbsp;to it in Keil. DFU seems to work correctly. I wonder if there&amp;nbsp;I correctly configured everything. For example Flash length is different in gcc linker file.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299038?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 14:15:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5132a2ad-7811-4686-9a1e-f969569c725c</guid><dc:creator>Sigurd</dc:creator><description>[quote user="tai2020"]so if I replace the linker file by &lt;span&gt;ble_app_buttonless_dfu_gcc_nrf52.ld and modify&amp;nbsp; FLASH (rx) and&amp;nbsp;RAM (rwx) it should work?&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes, I think that should be enough. If you are using the bottonless DFU service, then you might need to call&amp;nbsp;ble_dfu_buttonless_async_svci_init() in your main function as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299027?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 13:57:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dce1d05-977b-40d3-b667-6ce890b96d11</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;thanks for your reply.&lt;/p&gt;
&lt;p&gt;so if I replace the linker file by &lt;span&gt;ble_app_buttonless_dfu_gcc_nrf52.ld and modify&amp;nbsp; FLASH (rx) and&amp;nbsp;RAM (rwx) it should work?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU gcc linker setting</title><link>https://devzone.nordicsemi.com/thread/299018?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 13:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8df3ae8a-c50e-45b8-a272-a1f58bef7f33</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I know that I should define&amp;nbsp;&amp;nbsp;the location where bootloader start address is stored in this file. But I have not found any example.[/quote]
&lt;p&gt;Take a look at the gcc linker setting in SDK_folder\examples\ble_peripheral\ble_app_buttonless_dfu\pca10040\s132\armgcc\ble_app_buttonless_dfu_gcc_nrf52.ld&amp;nbsp;&lt;/p&gt;
[quote user=""]My second question is that how I can find this address in my bootloader file?[/quote]
&lt;p&gt;The bootloader&amp;nbsp;linker script will write the bootloader start address to the UICR register. This value will be written in the bootloader HEX file and thus written to UICR when the bootloader is flashed into the chip. See the file&amp;nbsp;nrf_bootloader_info.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>