-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Hello,
I am using smpmgr to flash new applications onto devices running MCUboot built with zephyr project.
When the firmware is built with CONFIG_BOOT_HW_KEY, the TLV section contains athe full public key entry defined as:
#define IMAGE_TLV_PUBKEY 0x02 /* public key */
However, when trying to use smpmgr.exe for an upgrade, it fails to validate the image with the following error:
smpmgr.exe --port COM8 --baudrate 38400 upgrade zephyr.signed.bin
Inspection of FW image failed: 1 validation error for ImageTLV
0
Input should be 1, 16, 32, 33, 34, 35, 36, 48, 49, 50, 51, 64 or 80 [type=enum, input_value=2, input_type=int]
For further information visit https://errors.pydantic.dev/2.12/v/enum
It seems that smpmgr does not recognize TLV type 0x02 (IMAGE_TLV_PUBKEY) as a valid enum value, even though it is part of the MCUboot specification when hardware key validation is used.
Is it possible to ignore this?
Expected behavior:
smpmgr should accept and correctly parse TLV entries with type 0x02 when CONFIG_BOOT_HW_KEY is enabled.
Edit:
Ok, I see that in the file smpclient/mcuboot.py in class IMAGE_TLV(IntEnum):
the header
#define IMAGE_TLV_PUBKEY 0x02 /* public key */
is missing :(