Signing file with a relative key path

Hello,

In my project I have b0, mcuboot and an app. My nRF SDK version is v2.7.0.

My project works fine if I use an absolute address in SB_CONFIG_BOOT_SIGNATURE_KEY_FILE but it doesn't work anymore when I put a relative address (SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="${APP_DIR}/keys/mcuboot_private.pem").


In fact, the compilation goes well but when signing the file it fails in the file b0_mcuboot_signing.cmake to find the file given by the content of "keyfile": FileNotFoundError: [Errno 2] No such file or directory: '/keys/mcuboot_private.pem'


By analyzing, I notice that in "keyfile" there is the string "${APP_DIR}/keys/mcuboot_private.pem": I imagine that it is because the instruction at the beginning of the function is "set(keyfile "${SB_CONFIG_BOOT_SIGNATURE_KEY_FILE}")" and that therefore it only copies the content of SB_CONFIG_BOOT_SIGNATURE_KEY_FILE (witch is "${APP_DIR}/keys/mcuboot_private.pem") without converting ${APP_DIR}?

How could I do so that the value in SB_CONFIG_BOOT_SIGNATURE_KEY_FILE has the full path and not that extra ${APP_DIR}?

Thanks

Parents Reply
  • Hello,

    No it doesn't work. 

    For m'y key to be taken into account during compilation, I need to define SB_CONFIG_BOOT_SIGNATURE_KEY_FILE in the sysbuild.conf file. Doing it instead in the applications CMakeLists.txt or in the sysbuild.cmake does not fix my problem.

    Could you try on your side qnd tell me what do you do exactly to do it?

    Thank you

Children
Related