Skip to content

Commit 1323074

Browse files
joerchannashif
authored andcommitted
modules: trusted-firmware-m: Fix mcuboot imgtool not found on path
Fix issue with TFM signing of images not using the correct imgtool. The wrapper command expects the mcuboot scripts folder to be the current working directory when called in order to find its own version of imgtool. Since the command is using a different current working directory this is not found and the system imgtool is used instead. This causes the commands to be run with 2 different version of imgtool if the system imgtool is found and does not have any issues. The system imgtool could not be installed or have compatibility issues as 1.7.2 version of imgtool is currently required by the wrapper script Fixes: #40254 Signed-off-by: Joakim Andersson <[email protected]>
1 parent 73a957e commit 1323074

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ if (CONFIG_BUILD_WITH_TFM)
358358
set(pad_args --pad --pad-header)
359359
endif()
360360
set (${OUT_ARG}
361+
# Add the MCUBoot script to the path so that if there is a version of imgtool in there then
362+
# it gets used over the system imgtool. Used so that imgtool from upstream
363+
# mcuboot is preferred over system imgtool
364+
${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts
361365
${PYTHON_EXECUTABLE} ${TFM_MCUBOOT_DIR}/scripts/wrapper/wrapper.py
362366
--layout ${PREPROCESSED_FILE_${SUFFIX}}
363367
-k ${CONFIG_TFM_KEY_FILE_${SUFFIX}}

0 commit comments

Comments
 (0)