This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MCUBOOT Hardware Key

Hi,

I trying to enable Hardware Key for mcuboot.

I do the following at mcuboot.conf

CONFIG_BOOT_HW_KEY=y
But I got the following error:
C:/nrfconnect/v1.5.0/bootloader/mcuboot/boot/zephyr/keys.c:70:21: error: conflicting types for 'bootutil_keys'        
   70 | struct bootutil_key bootutil_keys[1] = {
      |                     ^~~~~~~~~~~~~
In file included from C:/nrfconnect/v1.5.0/bootloader/mcuboot/boot/zephyr/keys.c:20:
C:/nrfconnect/v1.5.0/bootloader/mcuboot/boot/bootutil/include/bootutil/sign_key.h:38:34: note: previous declaration of 'bootutil_keys' was here
   38 | extern const struct bootutil_key bootutil_keys[];
      |                                  ^~~~~~~~~~~~~
Do I miss something? Thanks,
 
Parents
  • This looks to me to be a bug in keys.c, because sign_key.h is being #include'd before mcuboot_config.h rather than after it.

    As a result, MCUBOOT_HW_KEY is not defined when sign_key.h is processed at the start of compiling keys.c.

    If you swap those two #includes around, you should get further, and will then have to figure out the best way to incorporate an implementation of boot_retrieve_public_key_hash() into MCUBoot when it is built. I am not yet sure the best way to do that without having to maintain our own fork of the sdk-nrf repo (which we are trying hard to avoid).

Reply
  • This looks to me to be a bug in keys.c, because sign_key.h is being #include'd before mcuboot_config.h rather than after it.

    As a result, MCUBOOT_HW_KEY is not defined when sign_key.h is processed at the start of compiling keys.c.

    If you swap those two #includes around, you should get further, and will then have to figure out the best way to incorporate an implementation of boot_retrieve_public_key_hash() into MCUBoot when it is built. I am not yet sure the best way to do that without having to maintain our own fork of the sdk-nrf repo (which we are trying hard to avoid).

Children
Related