mcuboot
mcuboot copied to clipboard
Several Compilation Errors when compiling MCUBoot for 'nucleo_u575zi_q' board with 'CONFIG_MCUBOOT_SERIAL=y'
Attempting to build MCUBoot for the first time (newish to Zephyr and MCUBoot) but I seem to have genuine compile errors. This is my PRJ.conf. Im just using the MCUBoot that ships with the latest Zephyr 4.3. When I enabled 'CONFIG_MCUBOOT_SERIAL=y' the errors occur.
zephyr : v4.3.0-1013-g8c264d30ea1 mcuboot : v2.2.0-221-gf3cc9476 zephyr-sdk-0.17.4
================================================== prj.conf
CONFIG_PM=n
CONFIG_MAIN_STACK_SIZE=10240
CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
#NRP EDIT CONFIG_BOOT_ENCRYPT_IMAGE=y CONFIG_BOOT_VALIDATE_SLOT0=y CONFIG_BOOT_SIGNATURE_TYPE_RSA=y CONFIG_BOOT_ENCRYPTION_KEY_FILE="enc-rsa2048-priv.pem" CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem" CONFIG_NO_OPTIMIZATIONS=n #75kB bigger if yes! CONFIG_BOOT_UPGRADE_ONLY=n CONFIG_BOOT_BOOTSTRAP=y
Enable logging for MCUboot
CONFIG_LOG=y CONFIG_MCUBOOT_LOG_LEVEL_WRN=y CONFIG_UART_CONSOLE=n # Disable UART, since Serial Recovery uses it CONFIG_MCUBOOT_SERIAL=y # Enable Serial Recovery over UART CONFIG_SINGLE_APPLICATION_SLOT=n # Configure the bootloader to use two slots CONFIG_MCUBOOT_INDICATION_LED=y # Turn on a LED so we can see when Serial Recovery mode is active
CONFIG_FLASH=y #CONFIG_MCUMGR=y #CONFIG_NET_BUF=n #wait before jumping to app #CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y #CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=2000
Various Zephyr boards enable features that we don't want.
CONFIG_BT is not set
CONFIG_I2C is not set
CONFIG_LOG_MODE_MINIMAL=y
Ensure Zephyr logging changes don't use more resources
CONFIG_LOG_DEFAULT_LEVEL=0
Use info log level by default
CONFIG_MCUBOOT_LOG_LEVEL_DBG=y
Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y
CONFIG_CBPRINTF_NANO=y
Use picolibc to reduce flash usage
CONFIG_PICOLIBC=y
Disable malloc arena because we don't need it
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0
================================================== errors
C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:114:31: warning: 'struct enc_data' declared inside parameter list will not be visible outside of this definition or declaration 114 | decrypt_region_inplace(struct enc_data *enc_data, | ^~~~~~~~ C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c: In function 'decrypt_region_inplace': C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:169:30: warning: passing argument 1 of 'boot_enc_decrypt' from incompatible pointer type [-Wincompatible-pointer-types] 169 | boot_enc_decrypt(enc_data, | ^~~~~~~~ | | | struct enc_data * In file included from c:\code\zephyr\bootloader\mcuboot\boot\bootutil\src\bootutil_priv.h:44, from C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:10: C:/Code/zephyr/bootloader/mcuboot/boot/bootutil/include/bootutil/enc_key.h:73:44: note: expected 'struct enc_key_data *' but argument is of type 'struct enc_data *' 73 | void boot_enc_decrypt(struct enc_key_data *enc_state, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c: In function 'decrypt_image_inplace': C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:265:37: error: incompatible type for argument 1 of 'decrypt_region_inplace' 265 | rc = decrypt_region_inplace(enc_data, fa_p, hdr, size, sect_size); | ^~~~~~~~ | | | struct enc_key_data C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:114:41: note: expected 'struct enc_data *' but argument is of type 'struct enc_key_data' 114 | decrypt_region_inplace(struct enc_data *enc_data, | ~~~~~~~~~~~~~~~~~^~~~~~~~ C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:274:5: warning: implicit declaration of function 'boot_enc_zeorize'; did you mean 'boot_enc_zeroiz'? [-Wimplicit-function-declaration] 274 | boot_enc_zeorize(&enc_data); | ^~~~~~~~~~~~~~~~ | boot_enc_zeroize C:/Code/zephyr/bootloader/mcuboot/boot/boot_serial/src/boot_serial_encryption.c:275:22: warning: passing argument 1 of 'boot_state_clear' from incompatible pointer type [-Wincompatible-pointer-types] 275 | boot_state_clear(&state); | ^~~~~~ | | | struct boot_loader_state ** In file included from c:\code\zephyr\bootloader\mcuboot\boot\bootutil\src\bootutil_priv.h:37: C:/Code/zephyr/bootloader/mcuboot/boot/bootutil/include/bootutil/bootutil.h:89:49: note: expected 'struct boot_loader_state *' but argument is of type 'struct boot_loader_state *' 89 | void boot_state_clear(struct boot_loader_state *state); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ [127/308] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_nano.c.obj ninja: build stopped: subcommand failed. FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build 'c:\Code\zephyr\bootloader\mcuboot\boot\zephyr\build'