linux4microchip / buildroot-external-microchip

Buildroot External for Microchip SoC
Other
15 stars 13 forks source link

Custom Linux build for ICICLE Kit can't boot #8

Closed kolabit closed 1 year ago

kolabit commented 1 year ago

I have built the Custom Linux image using followed the steps :

git clone https://github.com/linux4microchip/buildroot-external-microchip.git -b 2022.02-mchp
git clone https://git.busybox.net/buildroot -b 2022.02
cd buildroot
BR2_EXTERNAL=../buildroot-external-microchip/ make cicle_defconfig
make menuconfig
make

At make menuconfig, I have set BR2_PACKAGE_HOST_DOSFSTOOLS=y, included gstreamer, x265, x264, and some other packages (I can provide .config file), and run the build. Build failed like in issue #7 "Error building icicle_nand_defconfig", I set export LD_LIBRARY_PATH=/home/kola/rv_build_root/buildroot/output/host/lib, and build finished successfully. I wrote the sdcard.img on the SD card, tried to boot the ICICLE system. Boot stops on "Uncompressing Kernel Image" step. If I build default configuration, write the result image on SD, system boots successfully from this SD.

....
U-Boot 2022.01-linux4microchip+fpga-2023.06 (Aug 09 2023 - 17:54:46 -0400)

CPU:   rv64imafdc
Model: Microchip PolarFire-SoC Icicle Kit
DRAM:  1.8 GiB
MMC:   mmc@20008000: 0
Loading Environment from nowhere... OK
In:    serial@20100000
Out:   serial@20100000
Err:   serial@20100000
Net:   eth0: ethernet@20112000
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:2...
Found U-Boot script /boot.scr
597 bytes read in 26 ms (21.5 KiB/s)
Executing script at 8e000000
48981128 bytes read in 2114 ms (22.1 MiB/s)
Loading kernel from FIT Image at 8e000000 ...
   Using 'kernel_dtb' configuration
   Trying 'kernel' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x8e0000cc
     Data Size:    48955936 Bytes = 46.7 MiB
     Architecture: RISC-V
     OS:           Linux
     Load Address: 0x80200000
     Entry Point:  0x80200000
     Hash algo:    sha256
     Hash value:   02a528968286bee773bcd826771c924740cd5945420ec19b2a8c9f3e5dda3a8f
   Verifying Hash Integrity ... sha256+ OK
Loading fdt from FIT Image at 8e000000 ...
   Using 'kernel_dtb' configuration
   Trying 'base_fdt' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x90eb03f4
     Data Size:    20466 Bytes = 20 KiB
     Architecture: RISC-V
     Load Address: 0x8a000000
     Hash algo:    sha256
     Hash value:   28363deef55e16e50b58a9a94a3a656a9fd543a8a652eafc0adfce7b221e9a23
   Verifying Hash Integrity ... sha256+ OK
   Loading fdt from 0x90eb03f4 to 0x8a000000
   Booting using the fdt blob at 0x8a000000
   Uncompressing Kernel Image
jamiegibbons commented 1 year ago

Hi kolabit,

Could you provide your full defconfig so that we can attempt to reproduce this error on our side and debug. You can get this by running the command make savedefconfig BR2_DEFCONFIG=<path-to-defconfig> in your Buildroot directory. This should allow us to advise further. Also, what OS are you building from, and what version of this OS?

kolabit commented 1 year ago

BR2_riscv=y BR2_riscv_custom=y BR2_RISCV_ISA_CUSTOM_RVM=y BR2_RISCV_ISA_CUSTOM_RVF=y BR2_RISCV_ISA_CUSTOM_RVD=y BR2_RISCV_ISA_CUSTOM_RVC=y BR2_CCACHE=y BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_KERNEL_HEADERS_VERSION=y BR2_DEFAULT_KERNEL_VERSION="5.15.30" BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y BR2_PACKAGE_GLIBC_UTILS=y BR2_BINUTILS_VERSION_2_37_X=y BR2_GCC_VERSION_11_X=y BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_PACKAGE_HOST_GDB=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/rootfs-overlay/" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/genimage.cfg" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,linux4microchip,linux,linux-6.1-mchp+fpga)/linux4microchip+fpga-2023.06.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="mpfs" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/linux.fragment" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="microchip/mpfs-icicle-kit" BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y BR2_PACKAGE_LINUX_TOOLS_GPIO=y BR2_PACKAGE_LINUX_TOOLS_IIO=y BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y BR2_PACKAGE_GSTREAMER1=y BR2_PACKAGE_GST1_PLUGINS_BAD=y BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_X265=y BR2_PACKAGE_GST1_PLUGINS_UGLY=y BR2_PACKAGE_GST1_PLUGINS_UGLY_PLUGIN_X264=y BR2_PACKAGE_GST1_DEVTOOLS=y BR2_PACKAGE_GST1_INTERPIPE=y BR2_PACKAGE_GST1_LIBAV=y BR2_PACKAGE_GST1_PYTHON=y BR2_PACKAGE_GST1_RTSP_SERVER=y BR2_PACKAGE_GST1_SHARK=y BR2_PACKAGE_GSTD=y BR2_PACKAGE_GSTREAMER1_EDITING_SERVICES=y BR2_PACKAGE_BZIP2=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_P7ZIP=y BR2_PACKAGE_UNRAR=y BR2_PACKAGE_UNZIP=y BR2_PACKAGE_ZIP=y BR2_PACKAGE_DHRYSTONE=y BR2_PACKAGE_LMBENCH=y BR2_PACKAGE_DIFFUTILS=y BR2_PACKAGE_FINDUTILS=y BR2_PACKAGE_GAWK=y BR2_PACKAGE_E2FSPROGS=y BR2_PACKAGE_MTD=y BR2_PACKAGE_GPTFDISK=y BR2_PACKAGE_GPTFDISK_GDISK=y BR2_PACKAGE_GPTFDISK_SGDISK=y BR2_PACKAGE_I2C_TOOLS=y BR2_PACKAGE_PCIUTILS=y BR2_PACKAGE_RNG_TOOLS=y BR2_PACKAGE_PYTHON3=y BR2_PACKAGE_PYTHON_FLASK=y BR2_PACKAGE_PYTHON_PIP=y BR2_PACKAGE_JPEG=y BR2_PACKAGE_DTC=y BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_LIBGPIOD=y BR2_PACKAGE_LIBGPIOD_TOOLS=y BR2_PACKAGE_LIBIIO=y BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON=y BR2_PACKAGE_COLLECTD=y BR2_PACKAGE_COLLECTD_EXEC=y BR2_PACKAGE_COLLECTD_CSV=y BR2_PACKAGE_CAN_UTILS=y BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_IPERF=y BR2_PACKAGE_IPERF3=y BR2_PACKAGE_IPTABLES=y BR2_PACKAGE_IPUTILS=y BR2_PACKAGE_IW=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_RSYNC=y BR2_PACKAGE_WGET=y BR2_PACKAGE_BASH=y BR2_PACKAGE_FILE=y BR2_PACKAGE_SCREEN=y BR2_PACKAGE_ACL=y BR2_PACKAGE_COREUTILS=y BR2_PACKAGE_HTOP=y BR2_PACKAGE_PROCPS_NG=y BR2_PACKAGE_PSMISC=y BR2_PACKAGE_NANO=y BR2_TARGET_ROOTFS_CPIO_GZIP=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_TARBALL=y BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,polarfire-soc,u-boot)linux4microchip+fpga-2023.06.tar.gz" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="microchip_mpfs_icicle" BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/uboot-fragment.config" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_PACKAGE_HOST_BMAP_TOOLS=y BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENEXT2FS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_GPTFDISK=y BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_SQUASHFS=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/uboot-env.txt" BR2_PACKAGE_DT_OVERLAY_MCHP=y BR2_PACKAGE_DT_OVERLAY_MCHP_PLATFORM="mpfs_icicle" BR2_PACKAGE_MPFS_EXAMPLES=y BR2_PACKAGE_HOST_HSS_PAYLOAD_GENERATOR=y BR2_PACKAGE_HOST_HSS_PAYLOAD_GENERATOR_CFG="$(BR2_EXTERNAL_MCHP_PATH)/board/microchip/icicle/config.yaml" BR2_PACKAGE_HOST_HSS_PAYLOAD_GENERATOR_SRC="$(BINARIES_DIR)/u-boot.bin"

kolabit commented 1 year ago

Linux c795e099602c 5.15.0-78-generic #85~20.04.1-Ubuntu SMP Mon Jul 17 09:42:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

jamiegibbons commented 1 year ago

After debugging, we can see that the addition of BR2_PACKAGE_GST1_LIBAV=y is causing the problem. This is a large package and does not fit in the initramfs. Our suggestion is for you to use our icicle_rootfs_defconfig instead. I have taken this default configuration and added the packages you need. I have tested this for you to ensure it works. Please see the attached file for reference (remove the .txt, added it so that github would accept the file). I hope this helps. icicle_rootfs_gstreamer_defconfig.txt

kolabit commented 1 year ago

I have disabled BR2_PACKAGE_GST1_LIBAV, and get bad sdcard.img again. Will try icicle_rootfs_defconfig and let you know asap.

kolabit commented 1 year ago

It works OK with icicle_rootfs_defconfig. Thanks for help!