<?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>UNABLE to do BLE FOTA (SDK 2.4.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100398/unable-to-do-ble-fota-sdk-2-4-0</link><description>Board: Custom board 
 
 Chip: NRF28323 - 512K flash 64K RAM 
 
 SDK 2.4.0 - ZEPHYR 3.3.99 - CMake 3.20.5 - West 1.0.0 - VSCode pluggin v2023.4.179 
 
 We used to program with SEGGER and the SOFTDEVICE, but in this project we decided to start using ZEPHYR</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Jun 2023 07:33:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100398/unable-to-do-ble-fota-sdk-2-4-0" /><item><title>RE: UNABLE to do BLE FOTA (SDK 2.4.0)</title><link>https://devzone.nordicsemi.com/thread/429181?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2023 07:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:648ecf65-c798-4a12-8dad-ce51471a98e3</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Thank you for clarifying, providing the partition report and giving some more information about your time horizon&lt;/p&gt;
[quote user="AHaug"]What does your current pm_static.yml look like? Could you post it here?[/quote]
&lt;p&gt;I assume that you don&amp;#39;t use a static partition file as this question were left unanswered?&lt;/p&gt;
[quote user="hmcosentini"]&lt;p&gt;I&amp;#39;m super surprised we only enabled the BLE with 2 services, the FOTA and the ADC, nothing else.&lt;/p&gt;
&lt;p&gt;We are doing a demo in a week so we already have the demo PCB ready, what a nightmare we will need to change everything to &lt;strong&gt;SOFTDEVICE&lt;/strong&gt; then.&lt;/p&gt;[/quote]
&lt;p&gt;I agree that it sounds like it is a lot.&lt;/p&gt;
&lt;p&gt;When you perform a build it should generate how large the files are. Could you post the build logs in a code attachment so we can exclude if the application actually is that large or if the issue is elsewhere?&lt;/p&gt;
&lt;p&gt;In this blog &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/debunking-misconceptions-a-technical-analysis-of-nrf5-sdk-and-nrf-connect-sdk"&gt;Debunking misconceptions: A technical analysis of nRF5 SDK and nRF Connect SDK&lt;/a&gt;&amp;nbsp;there are steps to optimize the memory footprint. If you have the time, I would recommend you to have a look at the various tips there. In addition, this page:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/optimizing/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/optimizing/index.html&lt;/a&gt;&amp;nbsp;also has some recommandations&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re able, you could also zip and attach your project and I can have a look to see if I spot something that is not mentioned in these two links&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UNABLE to do BLE FOTA (SDK 2.4.0)</title><link>https://devzone.nordicsemi.com/thread/429053?ContentTypeID=1</link><pubDate>Fri, 02 Jun 2023 15:21:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21868aa1-db69-432d-815c-84074f20ec7e</guid><dc:creator>Humberto Matias Cosentini</dc:creator><description>[quote userid="107683" url="~/f/nordic-q-a/100398/unable-to-do-ble-fota-sdk-2-4-0/429010"]nRF Connect SDK v2.4.0 were released yesterday. &lt;strong&gt;Could you clarify if you&amp;#39;ve been using nCS v2.4.0-rc1 before that point in time, or have you been using NCS v2.3.0?&lt;/strong&gt;[/quote]
&lt;p&gt;We were using NCS v2.3.0 we updated today.&lt;/p&gt;
[quote userid="107683" url="~/f/nordic-q-a/100398/unable-to-do-ble-fota-sdk-2-4-0/429010"]Your application is most likely ~300kB since you have a flash overflow of 81964bytes. As I mentioned, this is too large to fit on a nRF52832/52833 if you wish to add DFU support.[/quote]
&lt;p&gt;Ok, that&amp;#39;s a bad news, we are &lt;strong&gt;only&lt;/strong&gt; running the &lt;strong&gt;Current time service&lt;/strong&gt; and the &lt;strong&gt;SMP service&lt;/strong&gt; to do the OTA, the &lt;strong&gt;ADC &lt;/strong&gt;and we are&amp;nbsp;using &lt;strong&gt;RTT backend &lt;/strong&gt;for logs.&lt;/p&gt;
&lt;p&gt;Is our first time&amp;nbsp;using &lt;strong&gt;Zephyr&lt;/strong&gt; and &lt;strong&gt;MCUboot&lt;/strong&gt;, I guess I didn&amp;#39;t expect that this RTOS will be so&amp;nbsp;&lt;strong&gt;memory-inefficient, &lt;/strong&gt;or maybe we configured something&amp;nbsp;wrong.&lt;/p&gt;
[quote userid="107683" url="~/f/nordic-q-a/100398/unable-to-do-ble-fota-sdk-2-4-0/429010"]Can you open the build folder in command line/bash and use&amp;nbsp;&lt;em&gt;ninja partition_manager_report&lt;/em&gt;? The output should be something similar to what I listed above.[/quote]
&lt;p&gt;Here you are:&lt;br /&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;+-------------------------------------------------+
| 0x0: mcuboot (0x8000 - 32kB)                    |
+---0x8000: mcuboot_primary (0x38000 - 224kB)-----+
| 0x8000: mcuboot_pad (0x200 - 512B)              |
+---0x8200: mcuboot_primary_app (0x37e00 - 223kB)-+
| 0x8200: app (0x37e00 - 223kB)                   |
+-------------------------------------------------+
| 0x40000: mcuboot_secondary (0x38000 - 224kB)    |
| 0x78000: littlefs_storage (0x6000 - 24kB)       |
| 0x7e000: settings_storage (0x2000 - 8kB)        |
+-------------------------------------------------+

  sram_primary (0x10000 - 64kB):
+-------------------------------------------+
| 0x20000000: sram_primary (0x10000 - 64kB) |
+-------------------------------------------+
&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
[quote userid="107683" url="~/f/nordic-q-a/100398/unable-to-do-ble-fota-sdk-2-4-0/429010"]The issue is that your application is to large to support DFU without external flash on a device that only has 512kB of internal flash. You will either have to reduce the application w.r.t flash, add an external flash or upgrade to the nRF52840/nRF5340 which has 1MB of flash.[/quote]
&lt;p&gt;I&amp;#39;m super surprised we only enabled the BLE with 2 services, the FOTA and the ADC, nothing else.&lt;/p&gt;
&lt;p&gt;We are doing a demo in a week so we already have the demo PCB ready, what a nightmare we will need to change everything to &lt;strong&gt;SOFTDEVICE&lt;/strong&gt; then.&lt;/p&gt;
&lt;p&gt;Let me know if we are missing something, and thanks for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UNABLE to do BLE FOTA (SDK 2.4.0)</title><link>https://devzone.nordicsemi.com/thread/429010?ContentTypeID=1</link><pubDate>Fri, 02 Jun 2023 12:39:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:341a4c12-96f3-41ee-8fad-f8d60c10174e</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]How can I fix this? We spent 3 days stuck on this,&amp;nbsp;[/quote]
&lt;p&gt;nRF Connect SDK v2.4.0 were released yesterday. &lt;strong&gt;Could you clarify if you&amp;#39;ve been using nCS v2.4.0-rc1 before that point in time, or have you been using NCS v2.3.0?&lt;/strong&gt;&lt;/p&gt;
[quote user=""]We added to our project the &lt;span style="text-decoration:underline;"&gt;SMP service&lt;/span&gt; and the config options mentioned in the FOTA documentation, but we get, the FLASH overflow error &amp;quot;&lt;strong&gt;zephyr\zephyr_pre0.elf section `text&amp;#39; will not fit in region `FLASH&amp;#39; -region `FLASH&amp;#39; overflowed by 81964 bytes&amp;quot;&lt;/strong&gt;[/quote]
&lt;p&gt;The issue is that your application is to large to support DFU without external flash on a device that only has 512kB of internal flash. You will either have to reduce the application w.r.t flash, add an external flash or upgrade to the nRF52840/nRF5340 which has 1MB of flash.&lt;/p&gt;
[quote user=""]So we read all the post in the forum about it, in all the post the recommendation is is to increase the &lt;strong&gt;MCUBOOT&lt;/strong&gt; partition size until the problem is fixed, but here is where we found this funny behavior.[/quote]
&lt;p&gt;It is not possible to solve the&amp;nbsp;&lt;em&gt;&lt;strong&gt;flash overflow&lt;/strong&gt;&lt;/em&gt; of your application by increasing the&amp;nbsp;&lt;em&gt;&lt;strong&gt;bootloader&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;partition. What those cases that you have read must suggest is to increase the size of the primary and secondary application partitions. This can be done in the pm_static.yml&amp;nbsp;&lt;strong&gt;&lt;em&gt;if the device you&amp;#39;re working with has surplus flash.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To illustrate how it will look like on the nRF52833 (same flash as the nRF52832 which I assume you&amp;#39;re using), I&amp;#39;ve used this minimal sample to generate a build with DFU support: &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp/mcuboot_smp_ble"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp/mcuboot_smp_ble&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  flash_primary (0x80000 - 512kB):
+-------------------------------------------------+
| 0x0: mcuboot (0xc000 - 48kB)                    |
+---0xc000: mcuboot_primary (0x3a000 - 232kB)-----+
| 0xc000: mcuboot_pad (0x200 - 512B)              |
+---0xc200: mcuboot_primary_app (0x39e00 - 231kB)-+
| 0xc200: app (0x39e00 - 231kB)                   |
+-------------------------------------------------+
| 0x46000: mcuboot_secondary (0x3a000 - 232kB)    |
+-------------------------------------------------+

  sram_primary (0x20000 - 128kB):
+--------------------------------------------+
| 0x20000000: sram_primary (0x20000 - 128kB) |
+--------------------------------------------+&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You see there are 3 partitions within &amp;quot;Flash_primary&amp;quot;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;mcuboot (48kB) which is where the bootloader lies&lt;/li&gt;
&lt;li&gt;mcuboot_primary (232kB): Maximum half of the remaining flash size of the internal flash. This is where your application will be run from&lt;/li&gt;
&lt;li&gt;mcuboot_secondary (232kb): Must be the same size as mcuboot primary. This is where the image used for updating will be temporarily stored when you perform DFU and the bootloader does its swap magic.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Can you open the build folder in command line/bash and use&amp;nbsp;&lt;em&gt;ninja partition_manager_report&lt;/em&gt;? The output should be something similar to what I listed above.&lt;/p&gt;
&lt;p&gt;Your application is most likely ~300kB since you have a flash overflow of 81964bytes. As I mentioned, this is too large to fit on a nRF52832/52833 if you wish to add DFU support.&lt;/p&gt;
[quote user=""]Can you suggest how to configure the pm_static.yml to fix this problem?[/quote]
&lt;p&gt;What does your current pm_static.yml look like? Could you post it here? Remember that the case is a public case so don&amp;#39;t post any sensitive information in this ticket.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>