Failed to build mcuboot_smp_custom_key sample code on ncs v2.4.2

Procedures to reproduce this issue is as follows.

1. git clone https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk

2. Copying all files under D:\samples_for_nrf_connect_sdk\bootloader_samples\keys_and_signatures\mcuboot_smp_custom_key folder to C:\ncs\v2.4.2\nrf\samples folder.

3. cd C:\ncs\v2.4.2\nrf\samples\mcuboot_smp_custom_key

4. west build -b nrf5340dk_nrf5340_cpuapp

c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(keys.c.obj):C:/ncs/v2.4.2/bootloader/mcuboot/boot/zephyr/keys.c:52: undefined reference to `rsa_pub_key'
c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(keys.c.obj):(.rodata.bootutil_keys+0x4): undefined reference to `rsa_pub_key_len'
collect2.exe: error: ld returned 1 exit status

Parents Reply Children
  • I have fixed this issue by modifying CMakeLists.txt as follows.

    cmake_minimum_required(VERSION 3.20.0)
    
    set(mcuboot_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256 y)
    set(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE \"${CMAKE_CURRENT_SOURCE_DIR}/custom_key_dir/custom_priv.pem\")
    
    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    project(mcuboot_smp_custom_key)
    
    target_sources(app PRIVATE src/main.c)

Related