device reset after OTA update, no MCUBOO rtt logs

I come after this post.
After following these steps i was unable to view RTT logs of the MCUBOOT.
I am at Zephyr 2.6.99, nrd sdk 1.7.1 and working on OTA updates for a custum nrf52840 circuit board, that has RTT logging.
The debbugger is a J-link EDU debugger. I am getting my applications RTT logs normaly, but no logs from MCUBoot.
I was able to perform an OTA update with the nrf52840 dongle, and on my custom nrf52840 circuit board with the
smp sample provided inside ~/ncs/zephyr/samples/subsys/mgmt/mcumgr/smp_svr by sendins an update 
with the Device Manager APP.

I am having trouble performing an OTA update with my application. After i integrated the SMP service,
i see the advertisement, i follow the same steps, as with the SMP sample, and my device just resets after the 
upload is fineshed. Show i want to be able to see MCUBOOT logs for debugging perpuses.
For the record, i also read the flash memory before and after the OTA update with nrf's Connect programmer.
With the smp_srv sample, after the update i can see that slot0 and slot1 have swapped places.
With my smp integration, the flash remains unchanged before and after the OTA update. Meaning that slot1 is empty
and slot0 has the origian application binary.

SMP samples's binary is 178KB , as well as the ota update binary
My application's size with the smp service integrated is 300KB , and ota binary is 301KB
Here is my flash partitioning:

&flash0 {

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

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x000000000 0x0000C000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0x0000C000 0x00067000>;
		};
		slot1_partition: partition@73000 {
			label = "image-1";
			reg = <0x00073000 0x00067000>;
		};
		scratch_partition: partition@da000 {
			label = "image-scratch";
			reg = <0x000da000 0x0001e000>;
		};

		/*
		 * 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>;
		};
	};
};


  • Hi, 

    Check out this post

    If that cannot help, please provide the child_image\mcuboot.conf.

    Regards,
    Amanda H.

  • Hello Amanda,
    as i said, i  allready followed the changes of the post that you provided.
    The only change i had to was to comment:
    CONFIG_BOOT_ENCRYPT_IMAGE=n
    in prf.conf of bootloader
    since at build time i got this error:ncs/bootloader/mcuboot/boot/zephyr/prj.conf:7: warning: attempt to assign the value 'n' to the undefined symbol BOOT_ENCRYPT_IMAGE

    error: Aborting due to Kconfig warnings

    Here is my child_image\mcuboot.conf:

    CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000
    
    # Disable UART Console and enable the RTT console
    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    
    # Config logger
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    
    CONFIG_MULTITHREADING=y

    Thank you for your time!

  • I would suggest you use UART for debug logs to avoid potential issues.

  • It's true, on nrf52840 DK, i was able to see bootloader logs from uart.
    My custom circuit board has a only a 6pin jtag connector, no usb output.
    Is it possible to debug through UART ?

  • Hello Amanda, i followed your suggestion on using UART for debugging. I resorted on using the nrf52840dk.
    i got these logs from mcuboot:

    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    
    I: Starting bootloader
    
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    
    I: Secondary image: magic=good, swap_type=0x3, copy_done=0x3, image_ok=0x1
    
    I: Boot source: none
    
    I: Swap type: perm
    
    E: Image in the secondary slot is not valid!
    
    I: Bootloader chainload address offset: 0xc000
    
    I: Jumping to the first image slot
    
    

    after that my device resets to the original flashed binary as i decribed earlier. I also check the flash
    memory map with the nrf connect programmer app, and to me surprise, the secondary slot was empty.
    I other words, the flash map was the same before and after the OTA update.

    For referenece these are the UART logs i got when i managed to perform an OTA update with the smp_srv sample using overlay-bt.conf :

    How can i approach this "Image in the secondary slot is not valid!" error ?

Related