cancel
Showing results for 
Search instead for 
Did you mean: 

stm32mp257f-EV1 yocto

raimondas
Associate II

Can someone explain how to build own custom yocto linux ?

I have experience with raspberry pi, but stm32mp2 have none normal explanation.

I have cloned from git scarthgap branch of poky, meta-openembedded, meta-st-stm32mp and meta-st-openlinux. Also, I have downloaded stm32mp SDK.

I can't understand if cubemx project for the board is needed ?

if needed how to add it if I have generated it ? I have many years of embedded programming of stm32

I can't find any build machine for bitbake for stm32mp257f-ev1 ?

Overall, trying to build default machine="stm32mp2" gives plenty errors, which I cannot understand.

Maybe someone can provide very direct explanation for building image ?

1 ACCEPTED SOLUTION

Accepted Solutions
raimondas
Associate II

Thank You @PatrickF 

However provided references not giving any real information on development, just concept. practically documentation is shity.

I have solved in few days but it was to long.

 

1. Download source code

git clone -b scarthgap https://github.com/yoctoproject/poky.git

git clone -b scarthgap https://git.openembedded.org/meta-openembedded

git clone -b scarthgap https://github.com/STMicroelectronics/meta-st-stm32mp.git

git clone -b scarthgap https://github.com/STMicroelectronics/meta-st-openstlinux.git

2. Make build enviroment

source poky/oe-init-build-env

3. modify local.conf in build → conf

MACHINE = "stm32mp2"

DISTRO ?= "openstlinux-weston"

ACCEPT_EULA_stm32mp2 = "1"

PREFERRED_VERSION_libcamera = "0.3.0"

Here a problems with default libcamera 0.4.0 so it is needed to downgrade

4. modify bblayers.conf in build → conf

BBLAYERS ?= " \

/home/raimondas/poky/meta \

/home/raimondas/poky/meta-poky \

/home/raimondas/poky/meta-yocto-bsp \

/home/raimondas/meta-openembedded/meta-oe \

/home/raimondas/meta-openembedded/meta-multimedia \

/home/raimondas/meta-openembedded/meta-networking \

/home/raimondas/meta-openembedded/meta-python \

/home/raimondas/meta-openembedded/meta-gnome \

/home/raimondas/meta-openembedded/meta-webserver \

/home/raimondas/meta-st-stm32mp \

/home/raimondas/meta-st-openstlinux \

/home/raimondas/build/workspace \

"

5. modify file name

from

/home/raimondas/meta-st-openstlinux/oe-core/recipes-core/systemd/systemd_255.13.bbappend

to

/home/raimondas/meta-st-openstlinux/oe-core/recipes-core/systemd/systemd_255.18.bbappend

6. build

bitbake st-image-weston

or

bitbake st-image-core #this one only using ssh, it's headless.

7. preparing to flash emmc

cd ~/build/tmp-glibc/deploy/images/stm32mp2

and

STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-core/optee/FlashLayout_emmc_stm32mp257f-ev1-optee.tsv

Whats all for basic setup. 

I wanted something as core-image-base or minimal, with hdmi/dsi output, but this time it is not supported currently.

 

 

View solution in original post

5 REPLIES 5
PatrickF
ST Employee

Hi @raimondas 

there is many information inside wiki

https://wiki.st.com/stm32mpu/wiki/Which_STM32MPU_Embedded_Software_Package_better_suits_your_needs

https://wiki.st.com/stm32mpu/wiki/STM32MPU_Developer_Package

 

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
raimondas
Associate II

Thank You @PatrickF 

However provided references not giving any real information on development, just concept. practically documentation is shity.

I have solved in few days but it was to long.

 

1. Download source code

git clone -b scarthgap https://github.com/yoctoproject/poky.git

git clone -b scarthgap https://git.openembedded.org/meta-openembedded

git clone -b scarthgap https://github.com/STMicroelectronics/meta-st-stm32mp.git

git clone -b scarthgap https://github.com/STMicroelectronics/meta-st-openstlinux.git

2. Make build enviroment

source poky/oe-init-build-env

3. modify local.conf in build → conf

MACHINE = "stm32mp2"

DISTRO ?= "openstlinux-weston"

ACCEPT_EULA_stm32mp2 = "1"

PREFERRED_VERSION_libcamera = "0.3.0"

Here a problems with default libcamera 0.4.0 so it is needed to downgrade

4. modify bblayers.conf in build → conf

BBLAYERS ?= " \

/home/raimondas/poky/meta \

/home/raimondas/poky/meta-poky \

/home/raimondas/poky/meta-yocto-bsp \

/home/raimondas/meta-openembedded/meta-oe \

/home/raimondas/meta-openembedded/meta-multimedia \

/home/raimondas/meta-openembedded/meta-networking \

/home/raimondas/meta-openembedded/meta-python \

/home/raimondas/meta-openembedded/meta-gnome \

/home/raimondas/meta-openembedded/meta-webserver \

/home/raimondas/meta-st-stm32mp \

/home/raimondas/meta-st-openstlinux \

/home/raimondas/build/workspace \

"

5. modify file name

from

/home/raimondas/meta-st-openstlinux/oe-core/recipes-core/systemd/systemd_255.13.bbappend

to

/home/raimondas/meta-st-openstlinux/oe-core/recipes-core/systemd/systemd_255.18.bbappend

6. build

bitbake st-image-weston

or

bitbake st-image-core #this one only using ssh, it's headless.

7. preparing to flash emmc

cd ~/build/tmp-glibc/deploy/images/stm32mp2

and

STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-core/optee/FlashLayout_emmc_stm32mp257f-ev1-optee.tsv

Whats all for basic setup. 

I wanted something as core-image-base or minimal, with hdmi/dsi output, but this time it is not supported currently.

 

 

I exactly followed the instructions you mentioned

the build says

 

I changed the systemd_255.17.bbappend to systemd_255.18.bbappend

```

ERROR: No recipes in default available for:
../meta-st-openstlinux/oe-core/recipes-core/systemd/systemd_255.18.bbappend

```

Here is my bblayer

```

$ cat conf/bblayers.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/poky/meta \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/poky/meta-poky \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/poky/meta-yocto-bsp \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-openembedded/meta-oe \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-openembedded/meta-python \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-openembedded/meta-networking \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-openembedded/meta-multimedia \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-openembedded/meta-gnome \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-openembedded/meta-webserver \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-st-openstlinux \
/home/work-dir-stm32mp257f-ev1/poky-manifest-yocto/meta-dir/meta-st-stm32mp \
"
```

raimondas
Associate II

Hello,

 

Please check if you exactly have scarthgap version of all software. In my case, I had error with 255.13 version, your version is newer 255.17 so you have some differences in downloaded software from github, comparing to my example.

I have done also such builds with newer versions, but was unlucky. So please keep identical to succeed.

sanjaysb
Associate II

Hi @raimondas@PatrickF 

I'm trying to understand the NOR Flash boot sequence of stm32mp257f-ev1.

Im using generated FlashLayout_nor-sdcard_stm32mp257f-ev1-optee.tsv to flash the st-image-weston image.

I want to understand how exactly the boot sequence is started and how it reaches to the u-boot (normal-world boot).

 

I had a pre-work in understanding this boot sequence, I need a clarification on my understanding

The stm32mp2 boards follow arm trusted boot chain. That means TF-A and OPtee will be the FSBL and U-boot will be SSBL.

 

So during the power on cycle the ROM code initiates the OCTOSPI interface of the Processor in Legacy SPI (MOSI and MISO) mode at HSI/2 = 32MHz speed.

 

Then it loads the Initial DT + BL2(optee) to SRAM and initialise the CPU clock and DDR.

Once the CPU is initialised, based on the arm-firmware SPI_NOR and SPI_MEM framework and the boot_device.c configuration, the OCTO SPI is configured to QUADSPI in 1-1-4 (QREAD) mode at max speed (133MHz) speed and loads the remaining Boot Loaders to DDR, and after BL32 the processor enters the UBoot (normal world boot). (To be specific i'm using macronix mx66l5xx series.)

 

I followed these references to understand whatever i explained earlier, please clarify my understanding and exactly how all fits in the boot sequence. 

1. NOR Boot - ROM Code WiKi Page 

2. boot_device.c configuration file (arm-firmware : github)  

3. spi_nor.h (github : arm-firmware) 

4. spi_nor.c (github : arm-firmware) 

 

And also please confirm that NOR will be only used for BOOT (That too only till coping the Bootloaders into DDR, after that NOR will not be used for any other operation after normal-world boot).