How to use CONFIG_SB_SIGNING_KEY_FILE as a relative path

In CMakeLists.txt for CONFIG_BOOT_SIGNATURE_KEY_FILE

cmake_minimum_required(VERSION 3.20.0)
set(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE \"${CMAKE_CURRENT_SOURCE_DIR}/eopatch_rsa_2048.pem\")

I was able to set it as a relative address like this.
Is there a similar way to use CONFIG_SB_SIGNING_KEY_FILE as a relative path?

Parents
  • Hi,

    For CONFIG_SB_SIGNING_KEY_FILE you can specify a relative path in prj.conf (or an other configuration file that is used in the build). You can see an example of that here, and you can experiment with moving the key file and adjusting the specified relative path and see that it still finds the file.

  • I checked the sample you provided.
    The sample builds successfully without any warnings.
    I followed the sample, placed my_key.pem in the project root, and configured CONFIG_SB_SIGNING_KEY_FILE in prj.conf.

    my_project
    - build
    - child_image
        - hci_rpmsg.conf
        - mcuboot.conf

    - include
    - src
    - CMakeLists.txt
    - my_key.pem
    - prj.conf

    <prj.conf>
    CONFIG_SB_SIGNING_KEY_FILE="my_key.pem"

    When I build my project I get a warning like below.

    It doesn't seem to recognize my_key.pem.
    Did I miss something?

Reply
  • I checked the sample you provided.
    The sample builds successfully without any warnings.
    I followed the sample, placed my_key.pem in the project root, and configured CONFIG_SB_SIGNING_KEY_FILE in prj.conf.

    my_project
    - build
    - child_image
        - hci_rpmsg.conf
        - mcuboot.conf

    - include
    - src
    - CMakeLists.txt
    - my_key.pem
    - prj.conf

    <prj.conf>
    CONFIG_SB_SIGNING_KEY_FILE="my_key.pem"

    When I build my project I get a warning like below.

    It doesn't seem to recognize my_key.pem.
    Did I miss something?

Children
Related