Building Toolchain For Raspberry Pi using yocto project

 Hello All,

In my previous post we have seen that how we can construct and embedded linux image for Raspberry Pi 4 using yocto project.

Previous post link: https://learnyoctowithme.blogspot.com/2022/03/constructing-embedded-linux-image-for_22.html

In this post we are going to see how we can build a toolchain for raspberrypi4 using yocto project

Pre-requisite is you need to familiar with my previous post(Constructing Embedded Linux Image for Raspberry Pi4 using yocto project) as it contains the setup details and required environment settings needed to build an image

Understand the fundamentals of toolchain from here: https://learnyoctowithme.blogspot.com/2022/03/building-toolchain-for-beaglebone-black.html

Lets build a toolchain for Raspberry Pi4 using yocto project

step 1 : Inside build_rpi folder, run the command

$ bitbake meta-toolchain

This will starts building our toolchain as per our specified architecture

 


NOTE: This will take considerable amount of time based on your system configuration, for me its took 2hrs to build toolchain

step 2: Inside build_rpi folder, you can find tmp directory and inside tmp directory you can find deploy folder and inside deploy folder you can find sdk directory

$ cd tmp/deploy/sdk



Here you can find "poky-glibc-x86_64-meta-toolchain-aarch64-raspberrypi4-64-toolchain-3.1.14.sh" script. 

step 3: execute the script as

$ ./poky-glibc-x86_64-meta-toolchain-aarch64-raspberrypi4-64-toolchain-3.1.14.sh


it will ask for the directory to install the toolchain and you can type . (. means current directory) and press Y to install toolchain

step 4: Now provide the executable permission to file "environment-setup-aarch64-poky-linux"

$ chmod 0777 environment-setup-aarch64-poky-linux

step 5: source the env file 

$ source environment-setup-aarch64-poky-linux

step 6: verify your cross compilation environment

$ echo $CC

$ echo $CXX


That's it now you have built the toolchain for rpi4-64 target.



Comments

Popular posts from this blog

Adding custom splash screen to yocto image

Adding libraries (pciutils,usbutils and util-linux) to our image using yocto project

Adding custom python script(to findout system info) to rootfs using yocto project