Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help bring up new board based on imx8mp #124

Open
bhupiister opened this issue Dec 12, 2024 · 2 comments
Open

Help bring up new board based on imx8mp #124

bhupiister opened this issue Dec 12, 2024 · 2 comments

Comments

@bhupiister
Copy link

Adding a SOM based on Engicam imx8mp

Current situation

We are using a SOM based on imx8mp. We have our own layer and can boot a custom yocto image on the board.
Initially, we adopted A/B update mechanism and everything went well, but the issue is with the space constraint of 8 gb emmc. Now with two partitions, each of 3.3gig, its difficult to run container-based applications.

We are looking to implement meta-updater

  • It is bit complicated to support a new board and requires some good level of understanding on type of kernel image, memory address for loading FIT image.
  • We did go ahead and tried the guide available to add our imx8mp based board.

Trial

  1. As per the 1st point in the link, I made sota_imx8mp-icore.bbclass
KERNEL_IMAGETYPES = "fitImage"
KERNEL_CLASSES += "kernel-fitimage"
IMAGE_FSTYPES = " ostreepush garagesign garagecheck ota-ext4 ostree.tar.bz2 ota.tar.xz wic" 
OSTREE_KERNEL = "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE}"
OSTREE_KERNEL_ARGS = "console=ttymxc1,115200 ramdisk_size=2048 root=/dev/ram0 rw rootfstype=ext4 ostree_root=/dev/mmcblk1p2"

WKS_FILE = "sdimage-imx8-sota.wks.in"
IMAGE_BOOT_FILES = "imx8mp-icore_boot.scr"
  1. As per the 2nd point, I created a custom wks file
part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 100
part / --source otaimage --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos

3)As per 3rd point, I created u-boot_2022.04.bbappend file with below content

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
DEPENDS += "u-boot-mkimage-native"

do_deploy:append () {
  install -d ${DEPLOYDIR}
  install -m 0644 ${WORKDIR}/interface.bin ${DEPLOYDIR}
  install -m 0644 ${WORKDIR}/interface_release.info ${DEPLOYDIR}

    cat > ${DEPLOYDIR}/imx8mp-icore_boot.txt << EOF
load mmc 1:2 \${load_addr} /boot/loader/uEnv.txt
env import -t \${fileaddr} \${filesize}
load mmc 1:2 \${load_addr} \${kernel_image}
bootm \${load_addr}
EOF

  mkimage -A arm64 -O linux -T script -d ${DEPLOYDIR}/imx8mp-icore_boot.txt ${DEPLOYDIR}/imx8mp-icore_boot.scr
}

Generating SD card image

The SD card image is created and when I boot it, I get the below output

## Loading kernel from FIT Image at 40400000 ...
   Using 'conf-engicam_imx8mp-icore-starterkit.dtb' configuration
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Created:      2024-03-11   9:31:42 UTC
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x40400108
     Data Size:    15368358 Bytes = 14.7 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x40480000
     Entry Point:  0x40480000
     Hash algo:    sha256
     Hash value:   54cd2a529a9c337406ece22465b686c345b2672717b06847de5349bd97ff4193
   Verifying Hash Integrity ... sha256+ OK
## Loading ramdisk from FIT Image at 40400000 ...
   Using 'conf-engicam_imx8mp-icore-starterkit.dtb' configuration
   Trying 'ramdisk-1' ramdisk subimage
     Description:  initramfs-ostree-image
     Created:      2024-03-11   9:31:42 UTC
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x412c56c4
     Data Size:    2293772 Bytes = 2.2 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    sha256
     Hash value:   3092a8aee7fd07bdd8d24a79169e530d339ce58959fcb35863bf45e8ca8c5c3a
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 40400000 ...
   Using 'conf-engicam_imx8mp-icore-starterkit.dtb' configuration
   Trying 'fdt-engicam_imx8mp-icore-starterkit.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Created:      2024-03-11   9:31:42 UTC
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x412a82d4
     Data Size:    59413 Bytes = 58 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   b90b8979e5fb095ce469b6911ef3feef1dbf13977528a6305a288f0dcdbf3830
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x412a82d4
   Uncompressing Kernel Image
**Error: inflate() returned -3**
gzip compressed: uncompress error -1
Must RESET board to recover
resetting ...

I tried setting the load_addr address manually thinking that there may be an overlap of addresses somewhere. But I again get the error

u-boot=> setenv load_addr 0x60000000
u-boot=> setenv fdtaddr 0x70000000
u-boot=> load mmc 1:2 ${loadaddr} /boot/ostree/poky-43941fa7486627fa6351143a7be3783b31f6633e91943213a81c3669eddf00ec/vmlinuz-5.15.71+g67aba053e67d6

## Loading kernel from FIT Image at 60000000 ...
   Using 'conf-engicam_imx8mp-icore-starterkit.dtb' configuration
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Created:      2024-03-11   9:31:42 UTC
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x60000108
     Data Size:    15368358 Bytes = 14.7 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x40480000
     Entry Point:  0x40480000
     Hash algo:    sha256
     Hash value:   54cd2a529a9c337406ece22465b686c345b2672717b06847de5349bd97ff4193
   Verifying Hash Integrity ... sha256+ OK
## Loading ramdisk from FIT Image at 60000000 ...
   Using 'conf-engicam_imx8mp-icore-starterkit.dtb' configuration
   Trying 'ramdisk-1' ramdisk subimage
     Description:  initramfs-ostree-image
     Created:      2024-03-11   9:31:42 UTC
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x60ec56c4
     Data Size:    2293772 Bytes = 2.2 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    sha256
     Hash value:   3092a8aee7fd07bdd8d24a79169e530d339ce58959fcb35863bf45e8ca8c5c3a
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 60000000 ...
   Using 'conf-engicam_imx8mp-icore-starterkit.dtb' configuration
   Trying 'fdt-engicam_imx8mp-icore-starterkit.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Created:      2024-03-11   9:31:42 UTC
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x60ea82d4
     Data Size:    59413 Bytes = 58 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   b90b8979e5fb095ce469b6911ef3feef1dbf13977528a6305a288f0dcdbf3830
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x60ea82d4
   Uncompressing Kernel Image
**Error: inflate() returned -5**
gzip compressed: uncompress error -1
Must RESET board to recover
resetting ...

Looking forward to get some help from the community members who can understand this error and help bring this board up. Thankyou.

@bhupiister
Copy link
Author

@pattivacek @ricardosalveti Can you guys help on this?

@pattivacek
Copy link
Collaborator

Sorry, I'm much too out of the loop to help here. Perhaps also @quaresmajose could help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants