<?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>Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110997/sample-smp_svr-on-nrf52840-dongle-text-does-not-fit-in-flash</link><description>Hi, 
 
 I am trying to evaluate the provided smp_svr sample with the BLE DFU on the NRF52840 dongle after I have already tested it on the DK. 
 I get the following error message during the build: zephyr/zephyr_pre0.elf section `text&amp;#39; will not fit in region</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Jan 2025 14:17:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110997/sample-smp_svr-on-nrf52840-dongle-text-does-not-fit-in-flash" /><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/519991?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2025 14:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5dfb7a4-e121-46a8-9fad-6cc1036d12f4</guid><dc:creator>Edvin</dc:creator><description>[quote user="Spector"]* For cmake add&amp;nbsp; DMCUBOOT_OVERLAY_CONFIG=&amp;quot;mcuboot.conf&amp;quot;[/quote]
&lt;p&gt;I don&amp;#39;t know where you got this from. What file are you trying to point to?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To build the sample for nRF52840dongle, use the sampe found in zephyr\samples\subsys\mgmt\mcumgr\smp_svr (the one you are already using), and I usually just copy that folder to any location, and then I add it as an existing application in VS Code (from the new location). After that, add a build configuration where you take the overlay-bt.conf file as an&amp;nbsp;&lt;strong&gt;extra KConfig fragment&lt;/strong&gt;, and build.&lt;/p&gt;
&lt;p&gt;I see that if I build this for the nRF52840 dongle, it fails because it overflows the Flash. The dongle, unlike the nRF52840 DK doesn&amp;#39;t have external flash.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t overflow by much, though. You could try to strip out the nRF5 bootloader from the dongle (using an overlay file). So that will give you one more page (4kb) from the beginning, and about 32+128kb more flash at the top of the ram:&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/pastedimage1737727944001v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Perhaps it is easier to start with the nRF52840DK board and strip out the external flash. But if you remove the original bootloader from the dongle, then please note that you need to add something to your own bootloader setting the correct regulator settings. Please read about this in this blog post:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;nRF52840 Dongle Programming Tutorial&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Particularly the section: &amp;quot;Adapting firmware to set REGOUT0 properly&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/519282?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 12:21:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c8989d0-dc05-4d30-a6d5-f64b557225f1</guid><dc:creator>Spector</dc:creator><description>&lt;p&gt;Is it impossible to build with v2.9.0?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;This is a capture of steps taken to try and implement the smp_svr demo.&lt;/p&gt;
&lt;p&gt;1. Open terminal, make project work directory&lt;br /&gt;❯ cd ~/work&lt;br /&gt;❯ mkdir nrf_connect&lt;br /&gt;❯ cd nrf_connect&lt;br /&gt;❯ code .&lt;/p&gt;
&lt;p&gt;2. Within vscode nrf_connect extension tab.&lt;br /&gt;* Create a new application.&lt;br /&gt;* Copy a sample&lt;br /&gt;* Select nRF Connect SDK v2.9.0&lt;br /&gt;* Select zephyr/samples/subsys/mgmt/mcumgr/smp_svr&lt;br /&gt;* Name it ~/work/nrf_connect/discord_demo/&lt;/p&gt;
&lt;p&gt;3. Setup vscode workspace so that it&amp;#39;s in ~/work/nrf_connect/discord_demo/&lt;/p&gt;
&lt;p&gt;4. Within the nrf_connect applications add a build configuration.&lt;br /&gt;* Set toolchain and sdk (2.9.0)&lt;br /&gt;* Set board target nrf52840dongle/nrf52840&lt;br /&gt;* For Extra Kconfig fragments add overlay-cdc.conf (imported with when project was created with sample)&lt;br /&gt;* For Base Devicetree overlay add usb.overlay (imported with when project was created with sample)&lt;br /&gt;* For cmake add&amp;nbsp; DMCUBOOT_OVERLAY_CONFIG=&amp;quot;mcuboot.conf&amp;quot;&lt;br /&gt;&lt;br /&gt;Fail because of flash...when i inspect the west build command i see&lt;br /&gt;&lt;br /&gt;west build --build-dir /home/wtr/work/nrf_connect/discord_demo/build /home/wtr/work/nrf_connect/discord_demo --pristine --board nrf52840dongle/nrf52840 -- -DNCS_TOOLCHAIN_VERSION=NONE -DEXTRA_CONF_FILE=overlay-cdc.conf -DDTC_OVERLAY_FILE=usb.overlay -DBOARD_ROOT=/home/wtr/work/nrf_connect/discord_demo&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For some reason this doens&amp;#39;t have the mcuboot overlay. which as the config_pm .... size_mcuboot=0x10000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/519115?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 14:35:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24de5191-d717-4039-a537-8114ff47409b</guid><dc:creator>Edvin</dc:creator><description>[quote user="Spector"]The question is which I can&amp;#39;t find a dfu tutorial in the intermediate course for 2.9.0, only 2.6.1.&lt;br /&gt;[/quote]
&lt;p&gt;Yes, I am aware. We are still waiting on some building blocks that aren&amp;#39;t done before we can update the devacademy course, unfortunately. Unless you specifically need any new features, I suggest you stick on the NCS version 2.6.X for now. Mostly nRF54 and nRF7002 features are added to the SDK versions after that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/519005?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 09:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21196fb6-a5a0-4b49-bd70-9349d6e0927e</guid><dc:creator>Spector</dc:creator><description>&lt;p&gt;I can start working from only one toolchain.&lt;br /&gt;&lt;br /&gt;The question is which I can&amp;#39;t find a dfu tutorial in the intermediate course for 2.9.0, only 2.6.1.&lt;br /&gt;&lt;br /&gt;However running smp_svr sample on v2.6.1 I get&lt;br /&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/pastedimage1737364202060v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;Running v2.9.0 I get&lt;br /&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/pastedimage1737364387511v3.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/518996?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 08:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb7e68f5-2dc2-4e5e-9394-421b5cb6ad8f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, I see that you already have your own ticket on the issue, then.&lt;/p&gt;
&lt;p&gt;I believe it would be easier (at least fewer pitfalls) to use the VS Code extension directly to download the toolchain and nRF Connect SDK. Alternatively the nRF Connect for Desktop -&amp;gt; Toolchain Manager. That way you will make sure that the SDK and Toolchains are matching. Then, when building the smp_svr sample, it should automatically build the mcuboot bootloader, and link it with your application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Spector"]eventually find the&amp;nbsp;-DNCS_TOOLCHAIN_VERSION flag allows it work when set to NONE or 2.6.1..[/quote]
&lt;p&gt;This reminds me of a bug we had at some point. For debugging purposes, is it possible to delete all NCS versions after the one that you are using? I don&amp;#39;t recall exactly what version it was, but it may have been around there, where it took the latest toolchain version, even though specifying another one.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/518938?ContentTypeID=1</link><pubDate>Sat, 18 Jan 2025 07:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9449a71a-783e-4250-8bfc-0099fe84a052</guid><dc:creator>Spector</dc:creator><description>&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Step 1&lt;/span&gt; pray to Odin that environment sdk and toolchain is somehow setup correctly. A nightmare after moving to 2.9.0 and rolling back.&lt;br /&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/pastedimage1737184485128v1.png" alt=" " /&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;Step 2&lt;/span&gt; ensure environment is correctly setup so we can run command outlay in&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/zephyr/boards/arm/nrf52840dongle_nrf52840/doc/index.html"&gt;nrf52840dongle_nrf52840&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;I created a symbolic link for the mcuboot and the zephyr repo, that feed into the build output.&lt;br /&gt;mcuboot -&amp;gt; /home/wtr/ncs/v2.6.1/bootloader/mcuboot/&lt;br /&gt;zephyr -&amp;gt; /home/wtr/ncs/v2.6.1/zephyr/&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;Step 3&lt;/span&gt; run first command from option 2&lt;br /&gt;&lt;span&gt;west&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span&gt;build&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span&gt;-b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span&gt;nrf52840dongle_nrf52840&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span&gt;-d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span&gt;build/mcuboot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span&gt;mcuboot/boot/zephyr&lt;/span&gt;&lt;br /&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/pastedimage1737185217686v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Suffer because the toolchains aren&amp;#39;t actually working as one would be misled to think with step 1. Notice&amp;nbsp;2be090971e and&amp;nbsp;b77d8c1312.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;Step 4&lt;/span&gt; Spend the better part of your life searching for a fix ...eventually find the&amp;nbsp;-DNCS_TOOLCHAIN_VERSION flag allows it work when set to NONE or 2.6.1...it seems my environment in terminal was not the only thing needed.&lt;br /&gt;Get mcuboot to build .. added .zip with log and build dir&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mcuboot_5F00_build_5F00_evidence.zip"&gt;devzone.nordicsemi.com/.../mcuboot_5F00_build_5F00_evidence.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:150%;text-decoration:underline;"&gt;Step 5 &lt;/span&gt;- FINALLY BACK TO WHERE this message started!&lt;br /&gt;&lt;br /&gt;smp_svr builds and I&amp;#39;m unable to replicate the error stated &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/118040/nrf52840dongle_nrf52840-exceed-flash-with-smp_svr-sample"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&amp;#39;s frustrating i don&amp;#39;t know why it works or fails sometimes. I&amp;#39;m too busy fighting toolchain and build process that I&amp;#39;m not even looking at the config_xx yy and zz kernam services/sw modules.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/518797?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 09:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13f7d072-ebac-473d-b8a5-8656b3681740</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;save the build log to a txt file, and put everything in a .zip folder, and upload it here (drag and drop).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/518786?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 08:31:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bf0e2e4-cba9-45d3-8aa6-18f90e291235</guid><dc:creator>Spector</dc:creator><description>&lt;p&gt;Whats the best way for submitting output logs? Or even the entire build directory for build/mcuboot and build/smp_svr.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/518726?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 20:10:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ad73a8e-3fcf-4d52-a4b9-39ee8cd38714</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Unfortunately, not all samples work with all boards. Perhaps you can share your build log, and we can look into it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is not recommended to change the board files directly. You can use a an overlay file, called nrf52840dongle_nrf52840.overlay, and place it in a folder called boards in your application&amp;#39;s root folder (look at how it is done in most of the samples in NCS). There you can add things that change the default board files.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/518274?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2025 15:03:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63811192-afc1-45b0-927e-319573e065df</guid><dc:creator>Spector</dc:creator><description>&lt;p&gt;I too have the problem with &amp;gt;west build -b nrf52840dongle_nrf52840 -d build/smp_svr zephyr/samples/subsys/mgmt/mcumgr/smp_svr&lt;br /&gt;&lt;br /&gt;What i don&amp;#39;t understand is that this &lt;a id="" href="https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/zephyr/boards/arm/nrf52840dongle_nrf52840/doc/index.html"&gt;https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/zephyr/boards/arm/nrf52840dongle_nrf52840/doc/index.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Is on the website as an example. It relys on files stored in the ncs2.6.1 git repo.&lt;br /&gt;&lt;br /&gt;Yet the command fails. Why aren&amp;#39;t the .conf files up to date? Am i suppose to manually go in and change the board config files?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH</title><link>https://devzone.nordicsemi.com/thread/482539?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 13:29:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73e98ece-2645-4d54-9d21-596dc49cde7c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Elias,&lt;/p&gt;
&lt;p&gt;Since the dongle has a bootloader and MBR from the nRF5 SDK, it means that the flash addresses from 0x00000000 -&amp;gt; 0x00001000, and a chunk at the end (don&amp;#39;t remember the address by heart, but this is the old bootloader, and it is located at the &amp;quot;top&amp;quot; of the flash) is already occupied, and you can&amp;#39;t remove them.&lt;/p&gt;
&lt;p&gt;Since the mcuboot bootloader from NCS is usually placed on 0x00000000, this will collide with the nRF5 MBR. Therefore, the board files say that you need to stay away from 0x00000000 -&amp;gt; 0x10000000, and it will. The problem however, is that it then tries to fit the bootloader into 0x00001000 -&amp;gt; 0x0000c000, which is a bit too small. Add this to your smp_svr\child_image\mcuboot.conf:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This will increase the size of the MCUBOOT parition, so that it can still fit the bootloader even though it doesn&amp;#39;t touch the MBR from the nRF5 SDK.&lt;/span&gt;&lt;/p&gt;
&lt;p&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;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>