Hi,
What do I need to be able to FOTA when nRF Connect SDK is updated?
For example, when the SDK version is 1.6.0, can I use the changes I made to the new SDK version using a code like "nrf\samples\nrf9160\http_update\application_update" example? Will providing the pm_static.yml file fix this problem? What should I do for .yml file if the partition names change in the new SDK?
Is there anything I should do other than that using a pm_static.yml file?
I surmise that maybe something is mismatched between the 1.5.0 SDK MCUBoot and the 1.6.0 one, but I'm not sure what it could be. Do I need an updateable bootloader and also immutable bootloader to? If the answer is yes;
If I am not mistaken, the key algorithms used in these two documents are different. Which one makes sense to use for MCUboot: ECDSA or RSA? Does it matter?
I used ECDSA_P256. I changed C:/X/Y/bootloader/mcuboot/boot/zephyr/Kconfig file as follows.
config BOOT_SIGNATURE_KEY_FILE
string "PEM key file"
# default "root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256
default "C:/X/Y/bootloader/mcuboot/mcuboot_priv_ec_p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256
Also, I added CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y and CONFIG_BOOT_UPGRADE_ONLY=y to C:/X/Y/bootloader/mcuboot/boot/zephyr/prj.conf file.
In my main project, I added to prj.conf.
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_BUILD_S1_VARIANT=y
CONFIG_SECURE_BOOT=y
CONFIG_SB_SIGNING_KEY_FILE="C:/my_prj/configuration/b0_private.pem"
These b0_private.pem and mcuboot_priv_ec_p256.pem files were generated using this command:
openssl ecparam -name prime256v1 -genkey -noout -out priv.pem
Also, I added these lines to main project CMakeList.txt file:
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/configuration/b0_prj_minimal.conf")
set(b0_OVERLAY_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/configuration/b0_prj_minimal.conf
)
endif()
This b0_prj_minimal.conf file is a copy of SDK\nrf\samples\bootloader\prj_minimal.conf file.
I guess that's all the changes I've made.
On Segger Debug screen
*** Booting Zephyr OS build v2.4.99-ncs1 ***
I: Starting bootloader
I: Swap type: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
I: Jumping to the first image slot
Meanwhile, using the Fota download library, I gave the paths of the .bin files required for s0 and s1. I triggered the FOTA update to the upgradable bootloader.
On JlinkRTT Viewer screen
00> [00:01:15.953,033] <inf> download_client: Configuring socket timeout (30 s)
00> [00:01:15.953,033] <inf> download_client: Connecting to awsfota.s3.eu-central-1.amazonaws.com
00> [00:01:22.158,538] <inf> download_client: Downloading: m_b/s1.bin [0]
00> [00:01:25.296,447] <inf> download_client: Downloaded 2048/45779 bytes (4%)
00> [00:01:27.535,583] <inf> download_client: Downloaded 4096/45779 bytes (8%)
00> [00:02:06.256,713] <inf> download_client: Downloaded 43008/45779 bytes (93%)
00> [00:02:10.481,903] <inf> download_client: Downloaded 45056/45779 bytes (98%)
00> [00:02:11.900,054] <inf> download_client: Download complete
00> [00:02:11.988,861] <inf> dfu_target_mcuboot: MCUBoot image upgrade scheduled. Reset device to apply
00> FINISHED fota_download
*** Booting Zephyr OS build v2.4.99-ncs1 ***
I: Starting bootloader
I: Swap type: perm
I: Image upgrade secondary slot -> primary slot
I: Erasing the primary slot
I: Copying the secondary slot to the primary slot: 0xb2d4 bytes
I: Bootloader chainload address offset: 0x28000
I: Jumping to the first image slot
What should I do after seeing them on the Segger Debug screen. After waiting for a while, I pressed the "Restart" and "Continue Execution"command on the Segger Debug screen and saw the following result.
On Segger Debug screen
*** Booting Zephyr OS build v2.4.99-ncs1 ***
I: Starting bootloader
I: Swap type: none
I: Swap type: none
I: Bootloader chainload address offset: 0x28000
I: Jumping to the first image slot
What should I do for the new mcuboot in slot s1 to work? How can I tell if it's working?
Thanks,
Have a nice day