<Spec>
- target Board : STM32mp157f-ev1, STM32mp157d-dk1
- Ubuntu : ubuntu-18.04.5-desktop-amd64
- stm32mpu Major ecosystem releases version : v3.0.0
- yocto version : OpenEmbedded v3.1 (Dunfell)
1. Install Pakage
# Packages required by OpenEmbedded/Yocto
$ sudo apt-get update
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 pylint xterm
$ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
$ sudo apt-get install libmpc-dev libgmp-dev
# Packages needed for some "Developer Package" use cases
$ sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev libssl-dev linux-headers-generic u-boot-tools device-tree-compiler bison flex g++ libyaml-dev libmpc-dev libgmp-dev
# For Ubuntu 20.04
$ sudo apt install python-is-python3
2. Install The Repo Utility
$ mkdir ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ PATH=${PATH}:~/bin
> repo init을 하기 위해서 최근 버그가 수정된 repo를 설치해야 한다.
3. STM32 yocto Download
$ mkdir -p STM/openstlinux-5.10-dunfell-mp1-21-03-31
$ cd STM/openstlinux-5.10-dunfell-mp1-21-03-31
$ repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.10-dunfell-mp1-21-03-31
$ repo sync

error.GitError: manifests var: 에러
$ git config --global user.name "whatmam"
$ git config --global user.email "whatmam@google.com"
4. bitbake 실행
$ DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh
$ bitbake st-image-weston
$ #qt5 build
$ bitbake st-example-image-qtwayland
$ bitbake st-example-image-qtwayland -c populate_sdk

> 한 번에 에러 없이 잘된다.. 다행이다.

Error: The OE SDK/ADT was detected as already being present in this shell
environment. Please use a clean shell when sourcing this environment script.
> 기존에 쓰던 쉘 프롬프트를 새로 열어서 하면 잘된다. 이유는 자세히 모르겠지만 환경변수 충돌 느낌인 듯하다..
5. 부팅 Sd 카드 생성
$ cd build-openstlinuxweston-stm32mp1/tmp-glibc/deploy/images/stm32mp1/scripts/
$ ./create_sdcard_from_flashlayout.sh ../flashlayout_st-image-weston/trusted/FlashLayout_sdcard_stm32mp157f-ev1-trusted.tsv
$ # FlashLayout_sdcard_stm32mp157f-ev1-trusted.raw 생성됨.
$ cat /proc/partitions #SD card 확인 (mmcblkX OR sdX)
$ sudo umount `lsblk --list | grep sdb | grep part | gawk '{ print $7 }' | tr '\n' ' '`
$ # umount all partitions
$ sudo dd if=../FlashLayout_sdcard_stm32mp157f-ev1-trusted.raw of=/dev/sdb bs=8M conv=fdatasync status=progress
$ ## Partition에 image 직접넣기 예시
$ sudo dd if=/dev/zero of=/dev/sdb3 conv=fdatasync
$ sudo dd if=tf-a-stm32mp157f-ev1-sdcard.stm32 of=/dev/sdb1 conv=fdatasync
$ sudo dd if=tf-a-stm32mp157f-ev1-sdcard.stm32 of=/dev/sdb2 conv=fdatasync
$ sudo dd if=fip-stm32mp157f-ev1-trusted.bin of=/dev/sdb3 conv=fdatasync
> 빌드가 완료되면 deploy 폴더가 생성된다. uboot, kernel, filesystem 등이 생성된고 부팅 SD card를 만들 수 있는 스크립트를 제공한다. 이를 이용해 만들어서 부팅까지 완료한다.
<참고>
https://koansoftware.com/yocto-project-meta-layer-for-stm32mp1-by-koan/
https://wiki.st.com/stm32mpu/wiki/How_to_build_and_use_an_SDK_for_QT
https://wiki.st.com/stm32mpu/wiki/How_to_create_your_own_machine
'STM32' 카테고리의 다른 글
4. STM32mp157 u-boot 분석 (0) | 2021.07.20 |
---|---|
3. STM32mp157 eMMC Booting (1) | 2021.07.19 |
2-3. STM32mp157 Distibution Package - galcore (0) | 2021.07.13 |
2-2. STM32mp157 Distibution Package - Kernel (0) | 2021.07.13 |
2-1. STM32mp157 Developer Package - uBoot (0) | 2021.07.13 |