compulab-yokneam / meta-compulab-hab

1 stars 0 forks source link

hardknott and imx8mp #1

Closed arrow53 closed 1 year ago

arrow53 commented 2 years ago

@vraevsky this is super helpful. I'm trying to get it to work with hardknott and the ucm-imx8m-plus.

I'm running into a seg fault when I try to make the imx-boot image. Any ideas?

cst-tools$ make imx-boot
cd hab && ../tools/csf.u
++ pwd
+ SOC=/yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab
+ CST=../linux64/bin/cst
+ O=/yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/signed/u
+ install -d /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/signed/u
+ command -v ../linux64/bin/cst
+ [[ 0 -ne 0 ]]
+ ifile=flash.bin
+ ofile=flash.bin
++ awk -F: '(/hab block/)&&(gsub(/ /,"_",$1))&&($0=$1"=\""$2"\"")' /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/flash_evk.log
+ eval
+ _spl_hab_block+=' "/yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/flash.bin"'
+ _sld_hab_block+=' "/yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/flash.bin"'
++ awk -v SOC=/yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab -v ifile=flash.bin '(/^0x/)&&($0=","$0" \""SOC"/"ifile"\"")' 'ORS= ' /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/print_fit_hab.log
+ blocks=
+ cat /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/csf_fit.in
+ cat
+ cat
+ cat /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/csf_spl.in
+ cat
+ ../linux64/bin/cst -i /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/signed/u/csf_spl.txt -o /yocto/compulab-encrypt-hardknott/build-ucm-imx8m-plus/tmp/deploy/images/ucm-imx8m-plus/cst-tools/hab/signed/u/csf_spl.bin
../tools/csf.u: line 30: 3237287 Segmentation fault      (core dumped) ${CST} -i ${O}/csf_spl.txt -o ${O}/csf_spl.bin
make: *** [Makefile:34: hab/signed/u] Error 139
phishstang65 commented 1 year ago

@arrow53 - I am getting the same issue with the segmentation fault. Could you please tell me what you did to fix the issue? Thank you very much.

arrow53 commented 1 year ago

do you have a imx-boot_%.bbappend in your meta layer?

arrow53 commented 1 year ago

if so, can you post it

phishstang65 commented 1 year ago

@arrow53 - thanks for responding. Yes, I do - I added the 'iot-gate-imx8plus' machine to the COMPATIBLE_MACHINE variable.

# Include the iot-gate-imx8plus machine
COMPATIBLE_MACHINE = "(ucm-imx8m-mini|mcm-imx8m-mini|iot-gate-imx8|iot-gate-imx8plus)"
phishstang65 commented 1 year ago

In my Yocto sources directory these are the other imx-boot_%.bb related files:

developer@docker-desktop:~/compulab-nxp-bsp/sources$ find . -name imx-boot_%.bbappend
./meta-karousels/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
./meta-imx/meta-cockpit/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
./meta-bsp-imx8mp/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
./meta-compulab-hab/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
arrow53 commented 1 year ago

I'd bail on this layer and pull in what you need into your own layer. I was never able to get it to work without tweaking. Here is what I'm using in my own layer

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

DEST = "${DEPLOY_DIR_IMAGE}/"
# ToDo: additional OSC support
SOC_DIR = "iMX8M"

SOC_TARGET = "iMX8MP"

do_compile_append () {
    bbdebug 1 "Do compile append"
    install -d ${DEST}
    sed -i '/@rm -f u-boot.its $(dtb)$/d' iMX8M/soc.mak
    sed -i 's/$(DTB_PREPROC) $(PLAT)-evk.dtb $(dtb) $(dtbs)/$(DTB_PREPROC) ucm-imx8m-plus.dtb $(dtb) $(dtbs)/g' iMX8M/soc.mak
    for target in flash_evk print_fit_hab; do
        make SOC=${SOC_TARGET} ${target} 2>&1 | tee ${DEST}/${target}.log
        if [ ${target} = "flash_evk" ]; then
            if [ -e "${S}/${SOC_DIR}/flash.bin" ]; then
                cp ${S}/${SOC_DIR}/flash.bin ${DEST}/
            fi
        fi
    done
}
phishstang65 commented 1 year ago

@arrow53 - thanks for sharing your file, it helped me at least not get a segmentation fault.

vraevsky commented 1 year ago

Hi All,

The imx8-kirkstone branch has been updated with the imx8mp family support: https://github.com/compulab-yokneam/meta-compulab-hab

Sorry for that inconvenience.