Build uboot for rockpi4a

Hi everyone, I am trying to compile uboot for rockpi 4a and I have the following error:

./build/mk-uboot.sh rockpi4a

   CC      arch/arm/mach-rockchip/rk3399/clk_rk3399.o
   CC      arch/arm/mach-rockchip/rk3399/rk3399.o
   CC      arch/arm/mach-rockchip/rk3399/syscon_rk3399.o
   LD      arch/arm/mach-rockchip/rk3399/built-in.o
   CC      arch/arm/mach-rockchip/rk_atags.o
   LD      arch/arm/mach-rockchip/built-in.o
   CC      board/rockchip/evb_rk3399/evb-rk3399.o
 board/rockchip/evb_rk3399/evb-rk3399.c:168:13: error: 'rk3399_force_pcie_power_on' defined but not used [-Werror=unused-function]
  static void rk3399_force_pcie_power_on(void)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
 cc1: all warnings being treated as errors
 scripts/Makefile.build:280: recipe for target 'board/rockchip/evb_rk3399/evb-rk3399.o' failed
 make[2]: *** [board/rockchip/evb_rk3399/evb-rk3399.o] Error 1
 Makefile:1287: recipe for target 'board/rockchip/evb_rk3399' failed
 make[1]: *** [board/rockchip/evb_rk3399] Error 2
 make: *** [__build_one_by_one] Error 2
 Makefile:461: recipe for target '__build_one_by_one' failed

I have another rock pi 4b and I got it normally… :confused: :thinking:

I believe this is not the right u-boot branch or commit, which branch are you using?

I get the same error, using the stable-4.4-rockpi4 branch as per the documentation

Any ideas?

And the per the documentation linked above, the branch rk3399-pie-gms-express-baseline gives the following error:
CC common/s_record.o
CC common/xyzModem.o
CC common/write_keybox.o
CC common/keymaster.o
CC common/attestation_key.o
LD common/built-in.o
CC disk/part.o
CC disk/part_dos.o
CC disk/part_efi.o
disk/part_efi.c: In function ‘gpt_verify_partitions’:
disk/part_efi.c:858:49: error: taking address of packed member of ‘struct _gpt_entry’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
858 | gpt_convert_efi_name_to_char(efi_str, gpt_e[i].partition_name,
| ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:281: disk/part_efi.o] Error 1
make[1]: *** [Makefile:1289: disk] Error 2
make: *** [Makefile:461: __build_one_by_one] Error 2
MAKE UBOOT IMAGE FAILED.

I got the same error When I try to reproduce the problem and I will get the resolution for you sooner.

modify line 363 in the file uboot/Makefile, delete the keyword “-Werror”, then try this command “./build/mk-uboot.sh rk3399-rock-pi-4a”