Problem compile u-boot-toradex-fw-util in Yocto to Colibri iMX6

I’m trying to compile the tool u-boot-toradex-fw-utils to use fw-printenv and fw_setenv using meta-fsl-arm-and extra meta-fsl-arm and the following error is reported:

Note: I’m not using meta-toradex, I created the u-boot-toradex and u-boot-toradex-fw-utils for my layer, reference link:
http://git.toradex.com/cgit/meta-toradex.git/tree/recipes-bsp/u-boot?h=V2.6

U-boot compiled and runs smoothly!

Below error reported by bitbake.

ERROR: u-boot-toradex-fsl-fw-utils-r0+gitr10bc451b6948e842e24799fe7fb037d335714b36-r0 do_compile: oe_runmake failed
ERROR: u-boot-toradex-fsl-fw-utils-r0+gitr10bc451b6948e842e24799fe7fb037d335714b36-r0 do_compile: Function failed: do_compile (log file is located at /yocto/poky-krogoth/injetora-trdx-qt5/tmp/work/colibri_imx6-poky-linux-gnueabi/u-boot-toradex-fsl-fw-utils/r0+gitr10bc451b6948e842e24799fe7fb037d335714b36-r0/temp/log.do_compile.6720)
ERROR: Logfile of failure stored in: /yocto/poky-krogoth/injetora-trdx-qt5/tmp/work/colibri_imx6-poky-linux-gnueabi/u-boot-toradex-fsl-fw-utils/r0+gitr10bc451b6948e842e24799fe7fb037d335714b36-r0/temp/log.do_compile.6720
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 2 CC=arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/yocto/poky-krogoth/injetora-trdx-qt5/tmp/sysroots/colibri-imx6 STRIP=arm-poky-linux-gnueabi-strip colibri_imx6_defconfig
|   HOSTCC  scripts/basic/fixdep
|   HOSTCC  scripts/kconfig/conf.o
|   SHIPPED scripts/kconfig/zconf.tab.c
|   SHIPPED scripts/kconfig/zconf.lex.c
|   SHIPPED scripts/kconfig/zconf.hash.c
|   HOSTCC  scripts/kconfig/zconf.tab.o
|   HOSTLD  scripts/kconfig/conf
| #
| # configuration written to .config
| #
| NOTE: make -j 2 CC=arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/yocto/poky-krogoth/injetora-trdx-qt5/tmp/sysroots/colibri-imx6 STRIP=arm-poky-linux-gnueabi-strip env
| scripts/kconfig/conf --silentoldconfig Kconfig
|   CHK     include/config.h
|   UPD     include/config.h
|   GEN     include/autoconf.mk
|   GEN     include/autoconf.mk.dep
|   HOSTCC  tools/env/fw_env.o
|   HOSTCC  tools/env/fw_env_main.o
|   HOSTCC  tools/env/crc32.o
| tools/env/fw_env.c:52:2: error: unknown type name 'uint8_t'
|   uint8_t mtd_type;  /* type of the MTD device */
|   ^
| tools/env/fw_env.c:77:2: error: unknown type name 'uint32_t'
|   uint32_t crc; /* CRC32 over data bytes    */
|   ^
| tools/env/fw_env.c:82:2: error: unknown type name 'uint32_t'
|   uint32_t crc; /* CRC32 over data bytes    */
|   ^
| tools/env/fw_env.c:95:2: error: unknown type name 'uint32_t'
|   uint32_t  *crc;
|   ^
| tools/env/fw_env.c:107:8: error: unknown type name 'uint8_t'
|  static uint8_t aes_key[AES_KEY_LENGTH] = { 0 };
|         ^
| tools/env/fw_env.c: In function 'getenvsize':
| tools/env/fw_env.c:128:34: error: 'uint32_t' undeclared (first use in this function)
|   ulong rc = CUR_ENVSIZE - sizeof(uint32_t);
|                                   ^
| tools/env/fw_env.c:128:34: note: each undeclared identifier is reported only once for each function it appears in
| tools/env/fw_env.c: In function 'fw_env_close':
| tools/env/fw_env.c:338:31: error: 'uint8_t' undeclared (first use in this function)
|   *environment.crc = crc32(0, (uint8_t *) environment.data, ENV_SIZE);
|                                ^
| tools/env/fw_env.c:338:40: error: expected expression before ')' token
|   *environment.crc = crc32(0, (uint8_t *) environment.data, ENV_SIZE);
|                                         ^
| tools/env/fw_env.c:338:21: error: too few arguments to function 'crc32'
|   *environment.crc = crc32(0, (uint8_t *) environment.data, ENV_SIZE);
|                      ^
| In file included from tools/env/fw_env.c:32:0:
| tools/env/fw_env.h:64:23: note: declared here
|  extern unsigned long  crc32  (unsigned long, const unsigned char *, unsigned);
|                        ^
| tools/env/fw_env.c: At top level:
| tools/env/fw_env.c:676:37: error: unknown type name 'uint8_t'
|  static int flash_bad_block (int fd, uint8_t mtd_type, loff_t *blockstart)
|                                      ^
| tools/env/fw_env.c:704:21: error: unknown type name 'uint8_t'
|        off_t offset, uint8_t mtd_type)
|                      ^
| tools/env/fw_env.c:793:22: error: unknown type name 'uint8_t'
|         off_t offset, uint8_t mtd_type)
|                       ^
| tools/env/fw_env.c: In function 'env_aes_cbc_crypt':
| tools/env/fw_env.c:990:2: error: unknown type name 'uint8_t'
|   uint8_t *data = (uint8_t *)payload;
|   ^
| tools/env/fw_env.c:990:19: error: 'uint8_t' undeclared (first use in this function)
|   uint8_t *data = (uint8_t *)payload;
|                    ^
| tools/env/fw_env.c:990:28: error: expected expression before ')' token
|   uint8_t *data = (uint8_t *)payload;
|                             ^
| tools/env/fw_env.c:992:10: error: expected ';' before 'key_exp'
|   uint8_t key_exp[AES_EXPAND_KEY_LENGTH];
|           ^
| tools/env/fw_env.c:993:2: error: unknown type name 'uint32_t'
|   uint32_t aes_blocks;
|   ^
| tools/env/fw_env.c:996:26: error: 'key_exp' undeclared (first use in this function)
|   aes_expand_key(aes_key, key_exp);
|                           ^
| tools/env/fw_env.c:996:17: warning: passing argument 1 of 'aes_expand_key' from incompatible pointer type [-Wincompatible-pointer-types]
|   aes_expand_key(aes_key, key_exp);
|                  ^
| In file included from tools/env/fw_env.c:34:0:
| include/aes.h:43:6: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'int *'
|  void aes_expand_key(u8 *key, u8 *expkey);
|       ^
| tools/env/fw_env.c:1002:35: warning: passing argument 2 of 'aes_cbc_encrypt_blocks' from incompatible pointer type [-Wincompatible-pointer-types]
|    aes_cbc_encrypt_blocks(key_exp, data, data, aes_blocks);
|                                    ^
| In file included from tools/env/fw_env.c:34:0:
| include/aes.h:82:6: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'int *'
|  void aes_cbc_encrypt_blocks(u8 *key_exp, u8 *src, u8 *dst, u32 num_aes_blocks);
|       ^
| tools/env/fw_env.c:1002:41: warning: passing argument 3 of 'aes_cbc_encrypt_blocks' from incompatible pointer type [-Wincompatible-pointer-types]
|    aes_cbc_encrypt_blocks(key_exp, data, data, aes_blocks);
|                                          ^
| In file included from tools/env/fw_env.c:34:0:
| include/aes.h:82:6: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'int *'
|  void aes_cbc_encrypt_blocks(u8 *key_exp, u8 *src, u8 *dst, u32 num_aes_blocks);
|       ^
| tools/env/fw_env.c:1004:35: warning: passing argument 2 of 'aes_cbc_decrypt_blocks' from incompatible pointer type [-Wincompatible-pointer-types]
|    aes_cbc_decrypt_blocks(key_exp, data, data, aes_blocks);
|                                    ^
| In file included from tools/env/fw_env.c:34:0:
| include/aes.h:92:6: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'int *'
|  void aes_cbc_decrypt_blocks(u8 *key_exp, u8 *src, u8 *dst, u32 num_aes_blocks);
|       ^
| tools/env/fw_env.c:1004:41: warning: passing argument 3 of 'aes_cbc_decrypt_blocks' from incompatible pointer type [-Wincompatible-pointer-types]
|    aes_cbc_decrypt_blocks(key_exp, data, data, aes_blocks);
|                                          ^
| In file included from tools/env/fw_env.c:34:0:
| include/aes.h:92:6: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'int *'
|  void aes_cbc_decrypt_blocks(u8 *key_exp, u8 *src, u8 *dst, u32 num_aes_blocks);
|       ^
| tools/env/fw_env.c: In function 'flash_write':
| tools/env/fw_env.c:1033:7: warning: implicit declaration of function 'flash_write_buf' [-Wimplicit-function-declaration]
|   rc = flash_write_buf(dev_target, fd_target, environment.image,
|        ^
| tools/env/fw_env.c: In function 'flash_read':
| tools/env/fw_env.c:1089:7: warning: implicit declaration of function 'flash_read_buf' [-Wimplicit-function-declaration]
|   rc = flash_read_buf(dev_current, fd, environment.image, CUR_ENVSIZE,
|        ^
| tools/env/fw_env.c: In function 'fw_env_open':
| tools/env/fw_env.c:1222:20: error: 'uint8_t' undeclared (first use in this function)
|   crc0 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
|                     ^
| tools/env/fw_env.c:1222:29: error: expected expression before ')' token
|   crc0 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
|                              ^
| tools/env/fw_env.c:1222:9: error: too few arguments to function 'crc32'
|   crc0 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
|          ^
| In file included from tools/env/fw_env.c:32:0:
| tools/env/fw_env.h:64:23: note: declared here
|  extern unsigned long  crc32  (unsigned long, const unsigned char *, unsigned);
|                        ^
| tools/env/fw_env.c:1279:30: error: expected expression before ')' token
|    crc1 = crc32 (0, (uint8_t *) redundant->data, ENV_SIZE);
|                               ^
| tools/env/fw_env.c:1279:10: error: too few arguments to function 'crc32'
|    crc1 = crc32 (0, (uint8_t *) redundant->data, ENV_SIZE);
|           ^
| In file included from tools/env/fw_env.c:32:0:
| tools/env/fw_env.h:64:23: note: declared here
|  extern unsigned long  crc32  (unsigned long, const unsigned char *, unsigned);
|                        ^
| scripts/Makefile.host:108: recipe for target 'tools/env/fw_env.o' failed
| make[1]: *** [tools/env/fw_env.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| Makefile:1304: recipe for target 'env' failed
| make: *** [env] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile

Hi

What layer versions are you using?

Does it help to patch U-Boot like this?

Max

What layer versions are you using?
branch krogoth to:

yocto(meta)
meta-oe

meta-qt5

meta-fsl-arm

meta-fsl-arm-extra

The layer meta-toradex just used to catch the u-boot-toradex-fsl-fw-utils_git.bb but he’s not in my conf/bblayers.conf

Does it help to patch U-Boot like this?
I’ll try!


Cleiton Bueno

Blog | Linkedin | B2Open

Solved the problem!