Application restart after adding MCUboot

Hi,

I am working on a project which is having TF-M partition in it.

I want to now add bootloader to the application so that we can perform OTA update.

I try adding MCUboot into the tfm_secure_peripheral example and confirm it is working as expected. Below is the logs after adding MCUboot.

*** Booting Zephyr OS build v3.2.99-ncs1 ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0x8d...d1
Firmware signature verified.
Firmware version 1
*** Booting Zephyr OS build v3.2.99-ncs1 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
*** Booting Zephyr OS build v3.2.99-ncs1 ***
SPP: sending message: Success
SPP: processing signals: Success
SPP: processing signals: Success
SPP: sending message: Success
SPP: processing signals: Success
SPP: processing signals: Success
SPP: sending message: Success
SPP: processing signals: Success
SPP: processing signals: Success
SPP: sending message: Success

I try the same configuration into my application and I see the application keeps restarting continuously. Below is the logs for the same.

I: Bootloader chainload address offset: 0x28000
*** Booting Zephyr OS build v3.2.99-ncs1 ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0x8d...d1
Firmware signature verified.
Firmware version 1
*** Booting Zephyr OS build v3.2.99-ncs1 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
�*** Booting Zephyr OS build v3.2.99-ncs1 ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0x8d...d1
Firmware signature verified.
Firmware version 1
*** Booting Zephyr OS build v3.2.99-ncs1 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
*** Booting Zephyr OS build v3.2.99-ncs1 ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0x8d...d1
Firmware signature verified.
Firmware version 1
*** Booting Zephyr OS build v3.2.99-ncs1 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
*** Booting Zephyr OS build v3.2.99-ncs1 ***

Below is my prj.conf file

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_SECURE_BOOT=y
CONFIG_SB_SIGNING_KEY_FILE="priv_key.pem"
The same prj.conf file is working for tfm_spp example
Please let me know if I am missing anything in my configuration.
Thank you in advance for the support.
Below my setup details
nRF toolchain version: v2.2.0
Target board: nRF5340-DK
Parents Reply Children
  • Hi Sigurd,

    I have an update-

    I modified my TF-M partition size and I was able to boot my application.

    Let me share my memory report

    In the above image you can see there are these 3 EMPTY partitions with 15kb, 15kb and 8kb respectively.

    Below are my queries:

    I want to know what is this partition is used for?

    Can we resize these partition? if so how to resize these partition?

    Can I resize MCUboot partition(48kb)? if so how to?

    How to resize non-secure partition, I may try reduce non-secure partition and increase TF-M partition as I need more space for TF-M.

    I appreciate your support.

    Please help to get through this.

  • Jithin A said:
    I modified my TF-M partition size and I was able to boot my application.

    Great!

    Jithin A said:

    I want to know what is this partition is used for?

    Can we resize these partition? if so how to resize these partition?

    Can I resize MCUboot partition(48kb)? if so how to?

    How to resize non-secure partition, I may try reduce non-secure partition and increase TF-M partition as I need more space for TF-M.

    Take a look at the discussion here:  RE: west build generates large EMPTY partitions 

Related