<?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>52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92014/52840-sdk-v17-1-linker-errors-building-dfu-bootloader</link><description>I am working on a 52840 platform DFU bootloader. 
 I get linker errors I cant seem to fix: 
 undefined reference to `crc32_compute&amp;#39;, 
 Bootloader/nrf_bootloader_info.o:C:\dev\\sdk\components\libraries\bootloader/nrf_bootloader_info.c:57: undefined reference</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Sep 2022 22:07:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92014/52840-sdk-v17-1-linker-errors-building-dfu-bootloader" /><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/387179?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 22:07:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ae447dc-044d-4d77-b452-2acc6f2532ce</guid><dc:creator>davidb</dc:creator><description>&lt;p&gt;Issue is solved now with correct linker settings.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386987?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 06:34:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c303d5b2-dc2a-4fbd-813c-d097340c1abe</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="davidb"]&lt;p&gt;#define NRF_LOG_ENABLED 1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Changed to 1 from 0 to enable logging. Also would then not compile until I added nrf_log_default_backends.c to project.&lt;/p&gt;[/quote]
&lt;p&gt;Yes, that is expected. For most example bootloader projects, there is a corresponding &amp;quot;_debug&amp;quot; project. The main addition here is logging. And for that reason, it also has more memory reserved (and a lower start address). The normal projects (without the &amp;quot;_debug&amp;quot; suffix) does not include the logger dependencies, nor is&amp;nbsp;there&amp;nbsp;room for the logger.&lt;/p&gt;
[quote user="davidb"]&lt;p&gt;I built the project as you did and it builds with no errors. FLASH1 is 99.9% used. Not much room left for adding anything.&lt;/p&gt;
&lt;p&gt;RAM is only 14% used.&lt;/p&gt;
&lt;p&gt;Any suggestions on how to safely change FLASH1 layout to make space for my apps?&lt;/p&gt;[/quote]
&lt;p&gt;The way this is shown in SES gives the wrong impression. This means that the bootloader uses almost everything of the allocated flash, but that is not the same as all the flash. See the screenshot from my previous post where i highlighted the linker configuration for the flash memory. In that case, the bootloader start address is 0xF8000, and everything there can be used for other things (like SoftDevice, application and persistent storage). See &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html?cp=8_1_3_5_0_7#lib_bootloader_memory"&gt;memory layout in the bootloader documentation&lt;/a&gt; for a better overview.&lt;/p&gt;
&lt;p&gt;Regarding&amp;nbsp;RAM the bootloader and application does not run at the same time, so the RAM usage of the bootloader does not have any impact on what is available for the application (it can overlap).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386957?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 17:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53ea54d8-3dfa-420e-b9ef-28e024bb7608</guid><dc:creator>davidb</dc:creator><description>&lt;p&gt;I built the project as you did and it builds with no errors. FLASH1 is 99.9% used. Not much room left for adding anything.&lt;/p&gt;
&lt;p&gt;RAM is only 14% used.&lt;/p&gt;
&lt;p&gt;Any suggestions on how to safely change FLASH1 layout to make space for my apps?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386946?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 16:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcec0490-5353-4918-b09c-0d49f5b75ed9</guid><dc:creator>davidb</dc:creator><description>&lt;p&gt;I had to make two changes to sdk_config.h:&lt;/p&gt;
&lt;p&gt;// &amp;lt;i&amp;gt; Choose memory allocator used by nrf_crypto. Default is alloca if possible or nrf_malloc otherwise. If &amp;#39;User macros&amp;#39; are selected, the user has to create &amp;#39;nrf_crypto_allocator.h&amp;#39; file that contains NRF_CRYPTO_ALLOC, NRF_CRYPTO_FREE, and NRF_CRYPTO_ALLOC_ON_STACK.&lt;br /&gt;// &amp;lt;0=&amp;gt; Default &lt;br /&gt;// &amp;lt;1=&amp;gt; User macros &lt;br /&gt;// &amp;lt;2=&amp;gt; On stack (alloca) &lt;br /&gt;// &amp;lt;3=&amp;gt; C dynamic memory (malloc) &lt;br /&gt;// &amp;lt;4=&amp;gt; SDK Memory Manager (nrf_malloc)&lt;/p&gt;
&lt;p&gt;#ifndef NRF_CRYPTO_ALLOCATOR&lt;br /&gt;#define NRF_CRYPTO_ALLOCATOR 2&lt;/p&gt;
&lt;p&gt;I chose 2 (On stack). The example file has 1 (User macros) defined which cause a compile fail.&lt;/p&gt;
&lt;p&gt;#define NRF_LOG_ENABLED 1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Changed to 1 from 0 to enable logging. Also would then not compile until I added nrf_log_default_backends.c to project.&lt;/p&gt;
&lt;p&gt;These changes don&amp;#39;t appear to add significant flash space.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386765?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 06:57:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6fe7a26-692f-4bad-9541-4a506ac67c9d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;These linker warnings indicate that the bootloader is too large to fit in the assigned memory region. When I test, I get the same issue as you if I for instance reduce the size of the region (increase the start address and reduce the size) in the linker configuration or change the optimization. That is a bit odd though, as this example project builds fine when I test. Did you do any changes? If so, which?&lt;/p&gt;
&lt;p&gt;So in short, this should not happen out of the box, but is expected in case of size changes. The question then is if the size change is wanted, and if so, you need to adjust the start address and size which you do here:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1663570628172v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If this is not intentional though, I would first try to figure out why the size is larger than expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386719?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2022 22:42:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8878d864-6c44-427e-8365-becc8e1f5570</guid><dc:creator>davidb</dc:creator><description>&lt;p&gt;Some debug output:&lt;/p&gt;
&lt;p&gt;Generating linker script &amp;lsquo;secure_bootloader_ble_s140_pca10056.ld&amp;rsquo;&lt;br /&gt; Linking secure_bootloader_ble_s140_pca10056.elf&lt;br /&gt; .text is too large to fit in FLASH1 memory segment&lt;br /&gt; .text is larger than specified size&lt;br /&gt; .crypto_data is too large to fit in FLASH1 memory segment&lt;br /&gt; .dfu_trans is too large to fit in FLASH1 memory segment&lt;br /&gt; .svc_data is too large to fit in FLASH1 memory segment&lt;br /&gt; .log_const_data is too large to fit in FLASH1 memory segment&lt;br /&gt; .nrf_balloc is too large to fit in FLASH1 memory segment&lt;br /&gt; .sdh_ble_observers is too large to fit in FLASH1 memory segment&lt;br /&gt; .sdh_req_observers is too large to fit in FLASH1 memory segment&lt;br /&gt; .sdh_state_observers is too large to fit in FLASH1 memory segment&lt;br /&gt; .sdh_stack_observers is too large to fit in FLASH1 memory segment&lt;br /&gt; .sdh_soc_observers is too large to fit in FLASH1 memory segment&lt;br /&gt; .fs_data is too large to fit in FLASH1 memory segment&lt;br /&gt; .rodata is too large to fit in FLASH1 memory segment&lt;br /&gt; .rodata is larger than specified size&lt;br /&gt; .data is too large to fit in FLASH1 memory segment&lt;br /&gt; section .tdata overlaps absolute placed section .mbr_params_page&lt;br /&gt; section .mbr_params_page VMA [00000000000fe000,00000000000fefff] overlaps section .text VMA [00000000000f83b8,0000000000104127]&lt;br /&gt;Build failed&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;FLASH1 size seems way too small. I have not added any of my own code to this project. This is just the code that came with the example. Config file attached.&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/1452.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../1452.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386718?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2022 21:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d964fcf2-bc08-469f-addf-0c8ec8b0cca6</guid><dc:creator>davidb</dc:creator><description>&lt;p&gt;I have done as you suggested - started a new bootloader project based on&amp;nbsp;secure_bootloader_ble_s140_pca10056 Segger IDE solution. I built it but it fails due to linker errors:&lt;/p&gt;
&lt;p&gt;Rebuilding &amp;lsquo;secure_bootloader_ble_s140_pca10056&amp;rsquo; from solution &amp;lsquo;secure_bootloader_ble_s140_pca10056&amp;rsquo; in configuration &amp;lsquo;Release&amp;rsquo;&lt;br /&gt; Assembling &amp;lsquo;thumb_crt0.s&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_log_frontend.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_log_str_formatter.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;app_error_weak.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;app_scheduler.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;app_util_platform.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;crc32.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;mem_manager.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_assert.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_atfifo.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_atomic.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_balloc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_fprintf.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_fprintf_format.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_fstorage.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_fstorage_nvmc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_fstorage_sd.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_memobj.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_queue.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_ringbuf.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_section_iter.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_strerror.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;pb_common.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;pb_decode.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;cc310_bl_backend_ecc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;cc310_bl_backend_ecdsa.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;cc310_bl_backend_hash.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;cc310_bl_backend_init.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;cc310_bl_backend_shared.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;boards.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_sdh.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_sdh_ble.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_sdh_soc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_nvmc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrfx_atomic.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_crypto_ecc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_crypto_ecdsa.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_crypto_hash.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_crypto_init.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_crypto_shared.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_svci.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_svci_handler.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_svc_handler.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;ble_srv_common.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader_app_start.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader_app_start_final.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader_dfu_timers.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader_fw_activation.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader_info.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_bootloader_wdt.c&amp;rsquo;&lt;br /&gt; Assembling &amp;lsquo;ses_startup_nrf52840.s&amp;rsquo;&lt;br /&gt; Assembling &amp;lsquo;ses_startup_nrf_common.s&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;system_nrf52840.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;dfu-cc.pb.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_ble.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_flash.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_handling_error.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_mbr.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_req_handler.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_settings.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_settings_svci.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_transport.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_utils.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_validation.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;nrf_dfu_ver_validation.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;oberon_backend_chacha_poly_aead.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;oberon_backend_ecc.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;oberon_backend_ecdh.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;oberon_backend_ecdsa.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;oberon_backend_hash.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;oberon_backend_hmac.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;dfu_public_key.c&amp;rsquo;&lt;br /&gt; Compiling &amp;lsquo;main.c&amp;rsquo;&lt;br /&gt; Generating linker script &amp;lsquo;secure_bootloader_ble_s140_pca10056.ld&amp;rsquo;&lt;br /&gt; Linking secure_bootloader_ble_s140_pca10056.elf&lt;br /&gt; .text is larger than specified size&lt;br /&gt; .rodata is too large to fit in FLASH1 memory segment&lt;br /&gt; .rodata is larger than specified size&lt;br /&gt; .data is too large to fit in FLASH1 memory segment&lt;br /&gt; section .tdata overlaps absolute placed section .mbr_params_page&lt;br /&gt; section .mbr_params_page VMA [00000000000fe000,00000000000fefff] overlaps section .text VMA [00000000000f83b8,00000000000fea2f]&lt;br /&gt; section .crypto_data VMA [00000000000fea30,00000000000fea37] overlaps section .mbr_params_page VMA [00000000000fe000,00000000000fefff]&lt;br /&gt; section .bootloader_settings_page VMA [00000000000ff000,00000000000fffff] overlaps section .rodata VMA [00000000000feb28,00000000001005ab]&lt;br /&gt; Output/Release/Obj/secure_bootloader_ble_s140_pca10056/main.o: in function `main&amp;#39;:&lt;br /&gt; undefined reference to `nrf_log_default_backends_init&amp;#39;&lt;br /&gt;Build failed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386708?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2022 16:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35f8ec31-bfdc-49ef-99e9-3c09ce6b1d8d</guid><dc:creator>davidb</dc:creator><description>&lt;p&gt;I started from a previous projects segger solution file which was based on an older sdk version. We use sdk v17.1 now so getting this to compile is not easy.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How can I start a project with an example bootloader like&amp;nbsp;pca10056_s140_ble while usig segger? The platform is based on an82540.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 SDK v17.1 Linker Errors Building DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/386665?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2022 13:13:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2b29d5f-a868-451c-b959-669f949c2509</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems like you are missing some important files (nRFInitialize for instance is in the startup file, so that would be ses_startup_nrf52840.s if using the nRF52840 and Segger Embedded STudio ). I suggest you refer to a&amp;nbsp;bootloader example to see all the files that are needed (or even better, start your project by copying an example and modifying that,&amp;nbsp;instead&amp;nbsp;of starting from scratch if that is what you have done).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>