Adding a custom signature key file with ${APPLICATION_CONFIG_DIR} does not work

I try to add a custom signature key to the nrf5340_audio application from NCS2.7.0. I cannot use an absolute path because the project must be build-able by different people on different  machines where the project root is not the same.

According to Adding a custom signature key file there should be the possibility to use ${APPLICATION_CONFIG_DIR}. I added therefore the following option to the west build command:

-DSB_CONFIG_BOOT_SIGNATURE_KEY_FILE=\"${APPLICATION_CONFIG_DIR}/keys/signing_secret.pem\"

With that mcuboot builds and the generated mcuboot .config file contains CONFIG_BOOT_SIGNATURE_KEY_FILE with the correct absolute path to the key file. But later on the signing process fails with the error:

FileNotFoundError: [Errno 2] No such file or directory: '/keys/signing_secret.pem'

The reason is that when the build process invokes the imgtool.py script, its -k parameter only gets the value of SB_CONFIG_BOOT_SIGNATURE_KEY_FILE with ${APPLICATION_CONFIG_DIR} expanded to the empty string resulting in /keys/signing_secret.pem which of curse does not exist.

How can I get this to work?

 
Related