<?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 and application memory placement (nrf52811)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107957/bootloader-and-application-memory-placement-nrf52811</link><description>Hi, 
 
 Having problems setting up a bootloader and application in the flash memory sectors. The program dies at sd_softdevice_vector_table_base_set ( bootloader_addr ) ; It looks like I have the bootloader in address 0x00019000; 
 
 
 which makes sense</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Feb 2024 18:01:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107957/bootloader-and-application-memory-placement-nrf52811" /><item><title>RE: Bootloader and application memory placement (nrf52811)</title><link>https://devzone.nordicsemi.com/thread/467427?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2024 18:01:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9472bf4e-27b5-4982-904c-37dd93d2f335</guid><dc:creator>kclamb2015@gmail.com</dc:creator><description>&lt;p&gt;when i build in ses (132.9KB);&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/pastedimage1706896065960v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;the resulting hex file is 93KB.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;192 kB for nrf58211-QFAA-R, correct?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Good call on removing logging, forgot about that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;120.7KB in ses without logging.&lt;/p&gt;
&lt;p&gt;the resulting hex file is 59KB.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;oh *#&amp;amp;$ it works. thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader and application memory placement (nrf52811)</title><link>https://devzone.nordicsemi.com/thread/467424?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2024 17:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f6ecbd9-9e5d-4126-bf28-d84de3fefaa4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The error indicates that the new application does not fit into the free space here:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1706895781807v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;What is the size of your application? Disabling logging in your application could help reduce&amp;nbsp;the flash footprint (i.e. set NRF_LOG_ENABLED to &amp;#39;0&amp;#39; in sdk_config.h)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader and application memory placement (nrf52811)</title><link>https://devzone.nordicsemi.com/thread/467423?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2024 17:01:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b4e3ef8-9b08-4f47-a2da-a5c1ec1fc004</guid><dc:creator>kclamb2015@gmail.com</dc:creator><description>&lt;p&gt;Okay so I started from scratch some. Was able to get a blinky to load via&amp;nbsp;the&amp;nbsp;&lt;span&gt;/examples/dfu/secure_bootloader/pca10056_s112_ble_debug example.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I generated a package of our application. This is what the secure bootloader wrote in the terminal after attempting to load the dfu package;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; app: Shutting down transports (found: 1)
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
&amp;lt;debug&amp;gt; app: timer_stop (0x200022E0)
&amp;lt;debug&amp;gt; app: timer_activate (0x200022E0)
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; nrf_dfu_ble: Set receipt notif
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_RECEIPT_NOTIF_SET
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; nrf_dfu_ble: Buffer 0x20002788 acquired, len 141 (244)
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
&amp;lt;debug&amp;gt; nrf_dfu_ble: Freeing buffer 0x20002788
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
&amp;lt;debug&amp;gt; nrf_dfu_validation: PB: Init packet data len: 64
&amp;lt;info&amp;gt; nrf_dfu_validation: Signature required. Checking signature.
&amp;lt;info&amp;gt; nrf_dfu_validation: Calculating hash (len: 64)
&amp;lt;info&amp;gt; nrf_dfu_validation: Verify signature
&amp;lt;info&amp;gt; nrf_dfu_validation: Image verified
&amp;lt;debug&amp;gt; app: Enter nrf_dfu_cache_prepare()
&amp;lt;debug&amp;gt; app: required_size: 0x83DC.
&amp;lt;debug&amp;gt; app: single_bank: false.
&amp;lt;debug&amp;gt; app: keep_app: false.
&amp;lt;debug&amp;gt; app: keep_softdevice: true.
&amp;lt;debug&amp;gt; app: SD_PRESENT: true.
&amp;lt;debug&amp;gt; app: Bank contents:
&amp;lt;debug&amp;gt; app: Bank 0 code: 0x00: Size: 0x0
&amp;lt;debug&amp;gt; app: Bank 1 code: 0x00: Size: 0x0
&amp;lt;debug&amp;gt; app: pass: 0.
&amp;lt;debug&amp;gt; app: cache_address: 0x19000.
&amp;lt;debug&amp;gt; app: cache_too_small: true.
&amp;lt;debug&amp;gt; app: keep_firmware: false.
&amp;lt;debug&amp;gt; app: delete_more: true.
&amp;lt;debug&amp;gt; app: pass: 1.
&amp;lt;debug&amp;gt; app: cache_address: 0x19000.
&amp;lt;debug&amp;gt; app: cache_too_small: true.
&amp;lt;debug&amp;gt; app: keep_firmware: true.
&amp;lt;debug&amp;gt; app: delete_more: true.
&amp;lt;warning&amp;gt; app: Aborting. Cannot fit new firmware on device
&amp;lt;error&amp;gt; nrf_dfu_validation: Can&amp;#39;t find room for update
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x4
&amp;lt;warning&amp;gt; nrf_dfu_ble: DFU request 4 failed with error: 0x4
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_ABORT
&amp;lt;debug&amp;gt; app: Shutting down transports (found: 1)
&amp;lt;debug&amp;gt; nrf_dfu_ble: Shutting down BLE transport.
&amp;lt;debug&amp;gt; nrf_dfu_ble: Disconnecting.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.
&amp;lt;debug&amp;gt; nrf_dfu_ble: BLE transport shut down.
&amp;lt;debug&amp;gt; app: Resetting bootloader.
&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x2E000.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;info&amp;gt; app: Inside main
&amp;lt;debug&amp;gt; app: In nrf_bootloader_init
&amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...
&amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x2E000.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate
&amp;lt;info&amp;gt; app: No firmware to activate.
&amp;lt;info&amp;gt; app: Boot validation failed. No valid app to boot.
&amp;lt;debug&amp;gt; app: DFU mode because app is not valid.
&amp;lt;info&amp;gt; nrf_bootloader_wdt: WDT is not enabled
&amp;lt;debug&amp;gt; app: in weak nrf_dfu_init_user
&amp;lt;debug&amp;gt; app: timer_stop (0x200022E0)
&amp;lt;debug&amp;gt; app: timer_activate (0x200022E0)
&amp;lt;info&amp;gt; app: Entering DFU mode.
&amp;lt;debug&amp;gt; app: Initializing transports (found: 1)
&amp;lt;debug&amp;gt; nrf_dfu_ble: Initializing BLE DFU transport
&amp;lt;debug&amp;gt; nrf_dfu_ble: Setting up vector table: 0x00022000
&amp;lt;debug&amp;gt; nrf_dfu_ble: Enabling SoftDevice.
&amp;lt;debug&amp;gt; nrf_dfu_ble: Configuring BLE stack.
&amp;lt;debug&amp;gt; nrf_dfu_ble: Enabling the BLE stack.
&amp;lt;debug&amp;gt; nrf_dfu_ble: No advertising name found
&amp;lt;debug&amp;gt; nrf_dfu_ble: Using default advertising name
&amp;lt;debug&amp;gt; nrf_dfu_ble: Advertising...
&amp;lt;debug&amp;gt; nrf_dfu_ble: BLE DFU transport initialized.
&amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
&amp;lt;debug&amp;gt; app: Enter main loop&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;warning&amp;gt; app: Aborting. Cannot fit new firmware on device&lt;br /&gt;&amp;lt;error&amp;gt; nrf_dfu_validation: Can&amp;#39;t find room for update&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x4&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_dfu_ble: DFU request 4 failed with error: 0x4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader and application memory placement (nrf52811)</title><link>https://devzone.nordicsemi.com/thread/467233?ContentTypeID=1</link><pubDate>Thu, 01 Feb 2024 16:58:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81c0fa36-d8ed-4fe0-8b2a-acc12c61de21</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="kclamb2015@gmail.com"]I assumed the app and bootloader could use the same ram.[/quote]
&lt;p&gt;They can use the same RAM area since they will never run concurrently. I recommend starting with the default bootloader linker settings used by the /examples/dfu/secure_bootloader/pca10056_s112_ble_debug example.&lt;/p&gt;
[quote user="kclamb2015@gmail.com"]&lt;p&gt;1) The soft device is placed first within the flash&lt;/p&gt;
&lt;p&gt;2) The app is placed after that&lt;/p&gt;
&lt;p&gt;3) The bootloader is placed towards the end&lt;/p&gt;[/quote]
&lt;p&gt;Yes, this is correct. It is also the same as is shown here:&amp;nbsp;&lt;a title="Memory layout" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html?cp=9_1_3_5_0_7#lib_bootloader_memory"&gt;Memory layout&lt;/a&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader and application memory placement (nrf52811)</title><link>https://devzone.nordicsemi.com/thread/467027?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 20:38:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cf6c3fc-824e-4368-b63d-a999cc8e3907</guid><dc:creator>kclamb2015@gmail.com</dc:creator><description>&lt;p&gt;Here&amp;#39;s what I think I understand now;&lt;/p&gt;
&lt;p&gt;1) The soft device is placed first within the flash&lt;/p&gt;
&lt;p&gt;2) The app is placed after that&lt;/p&gt;
&lt;p&gt;3) The bootloader is placed towards the end&lt;/p&gt;
&lt;p&gt;With this understanding I setup the memory placement with the app after the soft device;&lt;/p&gt;
&lt;p&gt;App;&lt;br /&gt;FLASH_PH_START=0x0&lt;br /&gt;FLASH_PH_SIZE=0x30000&lt;br /&gt;RAM_PH_START=0x20000000&lt;br /&gt;RAM_PH_SIZE=0x6000&lt;br /&gt;FLASH_START=0x19000&lt;br /&gt;FLASH_SIZE=0x8000&lt;br /&gt;RAM_START=0x20002EA0&lt;br /&gt;RAM_SIZE=0x3160&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and the bootloader after the app;&lt;/p&gt;
&lt;p&gt;Bootloader;&lt;br /&gt;FLASH_PH_START=0x0&lt;br /&gt;FLASH_PH_SIZE=0x30000&lt;br /&gt;RAM_PH_START=0x20000000&lt;br /&gt;RAM_PH_SIZE=0x6000&lt;br /&gt;FLASH_START=0x22000&lt;br /&gt;FLASH_SIZE=0xE000&lt;br /&gt;RAM_START=0x20002EA0&lt;br /&gt;RAM_SIZE=0x3160&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I assumed the app and bootloader could use the same ram.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Therefore I loaded the bootloader. Then I loaded the application. This resulted in the program downloading and just started running at some random location without me pressing &amp;quot;go&amp;quot; and is just stuck there;&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/pastedimage1706733115713v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>