Hi all.
I am trying to add mender to my costume build of Kirkstone Openstliunux .
I changed the meta-mender-community to work with my Kirkstone build and everything is looks ok except the image i build for the eMMC:
my stm32mp-gptimg.bbclass not creating the fip-a image with the UUID that metadata.bin has. what I need to add so the uuid of fip-a partition will be like in metadata.bin?
INFO: PSCI Power Domain Map:
INFO: Domain Node : Level 1, parent_node -1, State ON (0x0)
INFO: Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO: CPU Node : MPID 0x0, parent_node 0, State ON (0x0)
INFO: CPU Node : MPID 0xffffffff, parent_node 0, State OFF (0x2)
NOTICE: CPU: STM32MP153AAA Rev.B
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15
INFO: PMIC version = 0x21
INFO: Reset reason (0x54):
INFO: System reset generated by MPU (MPSYSRST)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using EMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r1.0(debug):v2.6-dirty
NOTICE: BL2: Built : 13:14:26, Nov 23 2021
ERROR: Unable to find the partition with the uuid mentioned in metadata
PANIC at PC : 0x2ffeca83
Exception mode=0x00000016 at: 0x2ffeca83
and the second problem that the do_image_gptimg cannot find bootfs.image_gptimg.env :
Couldn't get bitbake variable from ~/yoctoWorkspace/openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15/build-openstlinuxcv-stm32mp1-ground4-mx/tmp-glibc/work/stm32mp1_ground4_mx-ostl-linux-gnueabi/st-image-minimal/1.0-r0/bootfs.image_gptimg.env.
The build actually didnât make .env bootfs file and i have no clue why.
here my bbclass:
inherit image_types
# It is not possible to specify this using MENDER_IMAGE_BOOTLOADER_FILE/OFFSET,
# instead we use an append to "gptimg" to embed the bootloader
# STM32MP requires the disk image to be GPT for it to find the bootloader
IMAGE_CMD:gptimg:append:stcommon() {
# Remove file generated by mender-part-images.bbclass
rm "$wks"
cat >> "$wks" <<EOF
part metadata1 --source rawcopy --fsoptions "noauto" --part-name=metadata1 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/metadata.bin" --ondisk mmcblk --part-type 0x8301 --fixed-size 512K --align 480
part metadata2 --source rawcopy --fsoptions "noauto" --part-name=metadata2 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/metadata.bin" --ondisk mmcblk --part-type 0x8301 --fixed-size 512K
part fip-a --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fip-a --sourceparams="file=${DEPLOY_DIR_IMAGE}/fip/fip-stm32mp153a-ground4-mx-trusted.bin" --ondisk mmcblk --part-type 0x8301 --fixed-size 4096K
part fip-b --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fip-b --sourceparams="file=${DEPLOY_DIR_IMAGE}/fip/fip-stm32mp153a-ground4-mx-trusted.bin" --ondisk mmcblk --part-type 0x8301 --fixed-size 4096K
part u-boot-env --source rawcopy --part-name=u-boot-env --sourceparams="file=${WORKDIR}/uboot.env" --ondisk "$ondisk_dev" --align $boot_env_align_kb --no-table
part --source rootfs --rootfs-dir ${WORKDIR}/bootfs.${BB_CURRENTTASK} --ondisk "$ondisk_dev" --fstype=vfat --label boot --align $alignment_kb --fixed-size ${MENDER_BOOT_PART_SIZE_MB} --active $boot_part_params
part --source rootfs --ondisk "$ondisk_dev" --fstype=${ARTIFACTIMG_FSTYPE} --label primary --align $alignment_kb --fixed-size ${MENDER_CALC_ROOTFS_SIZE}k $exclude_path_options
part --source rootfs --ondisk "$ondisk_dev" --fstype=${ARTIFACTIMG_FSTYPE} --label secondary --align $alignment_kb --fixed-size ${MENDER_CALC_ROOTFS_SIZE}k $exclude_path_options
part --source rootfs --rootfs-dir ${IMAGE_ROOTFS}/data --ondisk "$ondisk_dev" --fstype=${ARTIFACTIMG_FSTYPE} --label data --align $alignment_kb --fixed-size ${MENDER_DATA_PART_SIZE_MB}
bootloader --ptable gpt
EOF
echo "### Contents of STM32MP1 wks file ###"
cat "$wks"
echo "### End of contents of STM32MP1 wks file ###"
# Call WIC
outimgname="${IMGDEPLOYDIR}/${IMAGE_NAME}.$suffix"
wicout="${IMGDEPLOYDIR}/${IMAGE_NAME}-$suffix"
BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$wicout/" ${WIC_CREATE_EXTRA_ARGS}
mv "$wicout/$(basename "${wks%.wks}")"*.direct "$outimgname"
}
Glad to hear youâre making progress! While looking at it, the base situation is not clear to me. You mention meta-mender-community, but as far as I can tell there is nothing STM32 related in there. So are you using a forked version? Or did you create board support in your personal version? If so, is it public somewhere?
Ok, I see. This has never been contributed back to us, so we obviously donât know anything about it yet. Will have a look and see if I can spot something. Is your fork accessible too, so I donât have to also forward, and probably run into both similar and different problems?
Can you please share the layers and configuration that you are using, or some form of setup instructions? I find puzzle pieces here and there, but feel like missing something.
Iâm really sorry, but all my tries to even set up a build failed at various stages. If you can prepare a reproducer (e.g. concise information which layers, their repos and revisions, plus all necessary configuration) then Iâm happy to try again, but at the moment I just have to stop.
Hi @TheYoctoJester ,
I think I making progress. I"ll push commit if it will be successful.
But didnât understand what fails your build you did everything according the link?
when trying to follow the original link, it is supposed to build for the thud release, which totally falls over on a recent Linux
bumping all layers to dunfell gets me into a parsing error
trying to set up fresh for either dunfell or kirkstone falls over because the repo manifest are either not there or faulty.
So taking just the original board integration post feels very hard to reproduce, at least to me. Plus you mentioned having a number of layers integrated which were nowhere mentioned. Taking all that together means that sorting the integration layer out is only one part, weâll also need to make it usable. And in order to help with that I need to be able to at least build it myself
I mean to take my repo
add it to regular build from STM32mp1 wiki
change the Mender layers (meta-mender-core and meta-mender-st-stm32mp) paths in bblayers according your build and then use the âSetup build environmentâ from original board integration post:
1 . Initialize the build environment:
. meta-mender-st-stm32mp/scripts/stm32mp-setup-mender.sh
2. You can edit the conf/local.conf file to provide your Mender server configuration
3. Building the image:
bitbake st-image-core
Great!
I forgot that I changed some configs for my custom board:
MENDER_UBOOT_STORAGE_DEVICE = â1â â in local.conf should be 0 for the basic machine.
And yes âstm32mp153a-ground4-mx.dtbâ its my custom bord device tree
Also you need to check the PARTS to be the same order as in âmeta-mender-st-stm32mp/classes/stm32mp-gptimg.bbclassâ
i think according my PR its need to be:
Hi,
I am working on the stm32mp157f-dk2 trying to integrate mender. Thanks for the great progress!
Did you push your latest changes to your pull request?
I managed to build but I see that the fsbl parts are missing from the stm32mp-gptimg.bbclass?