compulab-yokneam / meta-bsp-imx8mp

13 stars 14 forks source link

Iot-gate-imx8plus: D1D8 compiling problems #25

Open pdonadeo opened 8 months ago

pdonadeo commented 8 months ago

I'm trying to compile iot-gate-imx8plus with: meta-bsp-imx8mp and meta-compulab-hab Tried with branch iot-gate-imx8plus-r2.0 and kirkstone-2.2.0 and with both, i can't build boot-loader that works.

I'm trying to build an image for: iot-gate-imx8plus D8

I found some troubles inside meta-bsp-imx8mp when activating meta-compulab-hab Here is main problems that i found:

Activate configuration D1D8 8Gb ram

meta-compulab-hab force u-boot 2022.04 Seems that if not selected d2d4 config, d1d8 is selected. But in checking config u-boot d2d4 is always set because noting select CONFIG_DRAM_D1D8=y It works for u-boot 2021.04, but didn't work in u-boot 2022.04

Then i tried with:

recipes-bsp/u-boot/compulab/2022.04/imx8mp/d1d8.cfg
-# CONFIG_DRAM_D2D4 is not set
+CONFIG_DRAM_D1D8=y

Check inside u-boot-2022.04 .config files and D1D8 config is enabled.

8Gb Micron memory

U-boot compile with D1D8 config and boot-loader don't works. I'm working with uuu and after 3 loads, it prints all attempt fails Found inside menuconfig MICRON_8G disabled. Then I tried to compile u-boot out of tree and it compile. With MICRON_8G after 4 load with uuu it start work.

Then my patch is:

recipes-bsp/u-boot/compulab/2022.04/imx8mp/d1d8.cfg
-# CONFIG_DRAM_D2D4 is not set
+CONFIG_DRAM_D1D8=y
+CONFIG_MICRON_8G=y

U-boot .sram overflow

When compile with CONFIG_MICRON_8G u-boot inside open embedded, it raises an error on link time. Seems that .sram area not enough large. After some check found that OpenEmmbedded compile u-boot with -O2 optimization instead of -Os as set by u-boot .config That is problem cause overflow in OE that can't see inside of u-boot out-of-tree. I'm stopped here. I'm searching a way to remove -O2 from for u-boot and let it with -Os.

Can you please check if you can reproduce the problem? Is good idea disable some other RAM inside timing tables to reduce section or is better support both?

pclass-isolated commented 3 months ago

Hi @pdonadeo - I am hitting the exact same problem with this repository and Yocto. Did you ever find a solution to this? If so, could you please share what you did to fix it? Thank you.

| aarch64-poky-linux-ld.bfd: u-boot-spl section `.u_boot_list' will not fit in region `.sram'
| aarch64-poky-linux-ld.bfd: region `.sram' overflowed by 2744 bytes
vraevsky commented 3 months ago

Hi All,

Add these lines to recipes-bsp/u-boot/u-boot-compulab.main FULL_OPTIMIZATION:remove = "-O2" FULL_OPTIMIZATION:append = "-Os"

pclass-isolated commented 3 months ago

Hi @vraevsky, thanks for the input.

I did add those lines to my bbappend file, however it still fails to compile. Here is an example compiler output - you can see that "-Os" is part of the compiler flags:

| aarch64-poky-linux-gcc --sysroot=/home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/recipe-sysroot -Wp,-MD,spl/lib/.elf.o.d -nostdinc -isystem /home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../lib/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/include -Ispl/include -Iinclude -I/home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/git/include -I/home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/git/arch/arm/include -include /home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/git/include/linux/kconfig.h -I/home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/git/lib -Ispl/lib -D__KERNEL__ -D__UBOOT__ -DCONFIG_SPL_BUILD -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized -fmacro-prefix-map=/home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/git/= -g -fstack-usage -Wno-format-nonliteral -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=date-time -Wno-packed-not-aligned -ffunction-sections -fdata-sections -fno-stack-protector -D__ARM__ -mstrict-align -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -mgeneral-regs-only -fno-common -ffixed-x18 -pipe -march=armv8-a+crc -D__LINUX_ARM_ARCH__=8 -mgeneral-regs-only -DKBUILD_BASENAME='"elf"' -DKBUILD_MODNAME='"elf"' -c -o spl/lib/elf.o /home/developer/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work/iot_gate_imx8plus-poky-linux/u-boot-compulab/2022.04-r0/git/lib/elf.c