OP-TEE Build for Rasberry Pi 3B
1. Ubuntu apt-get lock error 발생시 조치
$ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock $ sudo apt-get clean $ sudo apt-get update $ sudo dpkg --configure -a |
2. OPTEE Setup
- 전체 과정은 https://optee.readthedocs.io/en/latest/building/index.html 참고(기존 링크 변경됨.)
3. Prerequire package installation
https://optee.readthedocs.io/building/prerequisites.html#prerequisites
$ sudo apt-get install android-tools-adb android-tools-fastboot autoconf \ |
4. Repo setup
$ sudo apt-get install repo |
5. Check xml file for rasberry pi
https://github.com/OP-TEE/manifest
![]() |
6. Get source from Git server
TARGET : rpi3.xml
BRANCH : OPTEE v.3.0 이하는 rpi3_stable.xml, 3.1 이상은 3.x.0 형식
$ mkdir -p <optee-project> => repo init -u https://github.com/OP-TEE/manifest.git -m rpi3.xml -b 3.6.0 |
만약 git config를 해주지 않았다면 git config user.name과 user.email 선행 설정 필요.
7. Toolchain build
$ cd <optee-project>/build $ make -j2 toolchains |
8. Source build
$ make -j2 |
9. Build 전 수정사항
1) UART enable
RPI3의 경우 BT와 UART0, Mini UART를 할당해서 BT가 Enable되면 UART로 로그가 나오지 않음.
이를 위해 아래 내용 수정
$ vi <optee-project>/build/rpi3/firmware/config.txt 맨 마지막 항에 아래 구문 추가 dtoverlay=pi3-disable-bt |
2) check-bin-arch 수정
최초 빌드에는 괜찮은데, 한번 빌드 된 뒤에 Rebuild 수행시 binary architecture checking 과정에서 bootcode.bin, start.elf 등 Broadcom release binary에 대해 64bit 용이 아니라고 에러가 발생.
부팅시 32Bit으로 부팅하고, Trusted firmware와 U boot이 올라가면서 64bit으로 변경해주기 때문에 해당 과정은 불필요.
따라서 주석 처리함.
$ vi <optee-project>/buildroot/support/scripts/check-bin-arch
# Architecture is correct |