Yocto bitbake image for ODYSSEY – STM32MP157C

Hi, I have a custom image and custom distro I have been using with the STM32MP157C-DK2, I’m trying to build it and deploy it on the ODYSSEY – STM32MP157C board - so far without success.

I git cloned meta-st-odyssey layer and added it using bitbake-layers.

The command I’m running is:
DISTRO=poky-customdistro MACHINE=stm32mp1 bitbake mycustom-image-name

Note that I’m using MACHINE=stm32mp1 as per the repo documentation, and from what I can see on meta-st-odyssey you’re appending on the stm32mp1 machine.

Although I would expect something like MACHINE=stm32mp157c-odyssey to be the ideal usage…

When the build finishes I get a lot of .ubi files, also a flashlayout folder to user with STM32_Programmer_CLI, some rootfs.wic files and one .wks file.

This is where I run into issues… So far I’ve tried:

1. using dd if=mycustom-image-name-stm32mp1-20210823120809.rootfs.wic to flash the sdcard with the rootfs.wic file, but then when i try to boot from the sdcard I get a panic:

PANIC at PC : 0x2fff2d17
Exception mode=0x00000016 at: 0x2fff2d17

2. tried putting the board in dfu mode, by stopping the autoboot process and doing (is there a way to put the board in DFU mode like we do on STM32MP157C-DK2?):

STM32MP> env set dfu_alt_info "DDR ram 0xC0000000 0x20000000"
STM32MP> dfu 0 ram 0
crq->brequest:0x0

I am using a TypeA to TypeA usb cable on lower USB Port, and I can detect the board on the computer by running: STM32_Programmer_CLI -l usb

But when I try to flash using STM32_Programmer_CLI I get the following error:

$ > STM32_Programmer_CLI -c port=usb1 -w flashlayout_mycustom-image-name/trusted/FlashLayout_sdcard_stm32mp157c-odyssey-trusted.tsv`
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.6.0
      -------------------------------------------------------------------
USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : USB download gadget
SN          : 0023001B3338510139303435
FW version  : 0x0110
IAP

*Error: TSV files are only supported for STM32MP

So my questions is, what is the correct way to build a custom distro/custom image to this board and flash it?

Note: with the board STM32MP157C-DK2 i use the USB in DFU mode and STM32_Programmer_CLI to flash it without any problem.

Also I believe it would be of great help if you provided a STM32CUBEMX .ioc file for both the SOM and the Odyssey board, as that is also what is recommended in ST documentation to generate the necessary device tree files for other custom machines.
Example: https://wiki.somlabs.com/index.php/Customizing_the_device_tree_VisionSOM-STM32MP1

======
Just for reference, I tried going the expected way, with OpenSTLinux by following all the instructions in the repo meta-st-odyssey and this is the result:

My bitbake-layers configuration:

bitbake-layers show-layers
NOTE: Starting bitbake server...
layer                 path                                      priority
==========================================================================
meta-python           .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-python  7
meta-oe               .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-oe  6
meta-gnome            .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-gnome  7
meta-initramfs        .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-initramfs  8
meta-multimedia       .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-multimedia  6
meta-networking       .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-networking  5
meta-webserver        .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-webserver  6
meta-filesystems      .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-filesystems  6
meta-perl             .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-openembedded/meta-perl  6
meta-st-stm32mp       .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-st/meta-st-stm32mp  6
meta-qt5              .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-qt5  7
meta-st-openstlinux   .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-st/meta-st-openstlinux  5
meta                  .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/openembedded-core/meta  5
meta-st-odyssey       .../openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-st-odyssey  6