DFU Issue on NCS 2.6.1: First OTA Succeeds, Subsequent Attempts Fail with 'No Free Slot to Place the Image' Error

I am using Bluetooth for DFU in NCS version 2.6.1, but I encountered an issue in Device Manager that says, "There is no free slot to place the image." In the JLINK RTT, I received the following information:




&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x00000000 0x0000C000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0x0000C000 0x00075000>;
		};
		slot1_partition: partition@81000 {
			label = "image-1";
			reg = <0x00081000 0x00075000>;
		};
		scratch_partition: partition@E8000 {
			label = "image-scratch";
			reg = <0x000E8000 0x00010000>;
		};

		/*
		 * The flash starting at 0x000f8000 and ending at
		 * 0x000fffff is reserved for use by the application.
		 */

		/*
		 * Storage partition will be used by FCB/LittleFS/NVS
		 * if enabled.
		 */
		storage_partition: partition@f8000 {
			label = "storage";
			reg = <0x000f8000 0x00008000>;
		};
	};
};

[8/16] Linking C executable zephyr/zephyr.elf Memory region Used Size Region Size %age
Used FLASH: 325820 B 495104 B 65.81%
RAM: 120100 B 256 KB 45.81%
IDT_LIST: 0 GB 32 KB 0.00%
  • Hello,

    Could it be that the old image is still present in the other slot? I see that your screenshot says "Swap type: revert". Does that mean that if you program your first application using the programmer/debugger, then perform the DFU one time, and then power cycle your device. Is it the first application and the second application that boots up then? 

    Best regards,

    Edvin

  • Hi Edvin,

    I'm not very familiar with DFU. Could you please explain what "revert" means in this context? Also, what steps should I take to test this properly?

    Thank you!

  • There is a mechanism so that you can test DFU images without fully moving over to these new applications. The way this is done is that you can upload it, reboot, and the new image will be tested. Then the next time it reboots, it will swap back to the previous application image again. Then, if the test was successful, there are a couple of ways to make the DFU permanent. Either you can add a few lines in the application that tells the bootloader that the test was a success, or you can set a flag when performing the DFU, basically saying that: "I know this firmware works, so just delete the old one when you get this one".

    Although I know about the theory here, I am a bit rusty on the DFU part, and how all the apps work and so on. But can you please do that test for me:

    1: Program the original application.

    2: Build a new application with a modification, e.g. light up an LED, write something new to the log, or something like that.

    3: Perform the DFU to this new application, and confirm that the new firmware is running (by observing the LED or the log)

    4: Power cycle the device, and then observe the device (LED/log). Which application is running? The new, or the old?

    BR,

    Edvin

  • I performed the DFU using the "Test only" option, and here’s the sequence of operations I followed:

    1. I used JLINK to completely erase the FLASH and burn the latest firmware. This version prints ("Helloworld 0001\n") when running (Flash was successful).
    2. I then modified the print statement to ("Helloworld 0002\n"), rebuilt the firmware, and updated it using build_1/zephyr/dfu_application.zip (DFU was successful).
    3. After modifying the code again to ("Helloworld 0003\n"), I encountered the initial error: "There is no free slot to place the image," along with the JLINK output.
  • Try to power cycle it after step 2, and monitor the log. Does it say "Helloworld 0002" or "Helloworld 0001"?

Related