The list of packages you need on the host development system can be large when covering all build scenarios using the Yocto Project. See Yocto Project Reference Manual for details.
The first step is to download and prepare all the Yocto Project environment, you
need to have the repo
tool installed in your host machine.
For Debian/Ubuntu Linux distro you can install it running:
sudo apt install repo
If you’re using other Linux distro or the repo
tools is not in the repository
you can download directly from upstream and set your distro as shown below:
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
PATH=${PATH}:~/bin
The next step is to download the BSP source code, we have a platform to fetch all files that is necessary to build the project.
To download all sources run the following commands:
mkdir yocto-project-reference-platform
cd yocto-project-reference-platform
repo init -u https://github.com/TotalCross/yocto-project-reference-platform.git -b dunfell
repo sync
At the end of the commands, you have every metadata you need to start work with.
Before starting to work you need to load the Yocto Project variables to run bitbake command:
source setup-environment build
Note that you need to run the command above for all new terminal, the loaded
variables are only visible to the terminal that you source the setup-environment
script.
To build the image run:
bitbake totalcross-demo-image
This process can take a long time depending on your host machine.
When the image is ready, the resulted files are available in the deploy
directory. By default it is located in build/tmp/deploy/images/$MACHINE
.
To flash the image to SD card run:
zcat build/tmp/deploy/images/$MACHINE/totalcross-demo-image-$MACHINE.wic.gz | sudo dd of=/dev/sdX bs=4M
The sdX
if the device that SD card was addressed in you host machine, you can check your using