I have an Apalis i.MX8 and an Ixora carrier board. I installed the minimal Linux image using the Toradex Easy Installer.
I didn’t found a clear/proper documentation to help me cross-compile C/C++ programs for the embedded system.
In fact, I have downloaded the cross-compiler from ARM website but I don’t have a proper sysroot (the compiler can’t find stdio.h). The /usr/include is empty (on both an archive I downloaded from Toradex, the OS image I guess, and in the embedded system file system).
Can someone explain me how to set up the toolchain so I can build C/C++ applications for the Apalis i.MX8 running the minimal Linux image ?
Linux apalis-imx8-06548561 5.4.193-5.7.0+git.f78299297185 #1 SMP PREEMPT Mon Jul 11 14:42:03 UTC 2022 aarch64 GNU/Linux
Thank you for your answer. But usually, how people develop programs for the Toradex minimal Linux kernel ? Until now, I only tested .NET Core but I do need to have some programs on my system (pppd for example).
Do they use Yocto to build an image that contains the programs/libraries they need ?
Toradex docs are outdated/missing for the Apalis i.MX8. I know they want people to use the containers but we are going to choose a SoM that doesn’t have enough memory for Torizon and that’s why I’m trying to understand how to build libraries/programs for a minimalist Linux system. I don’t know Yocto, I’ve played a bit with buildroot in the past.
Can’t say I’m doing things right way, but yes, Yocto is the way to build target image with pppd and other required components. Once you know component list it is ± just a matter of creating bb or bbappend file for image with required packages listed in IMAGE_INSTALL. Lazy way you may try editing layers/meta-toradex-demos/recipes-images/images/tdx-reference-minimal-image.bb and add there missing packages to IMAGE_INSTALL. If you don’t know whole set of packages, you may look in yocto build/deploy/ipk folder for required ipk’s. Some of rootfs-missing packages still may be built. Ones, which are not present in deploy/ipk can be built with bitbake your_package. Then you scp those packages to target and opkg install them. Not very convenien but OK way for packages with no or short dependency list. Don’t try to install something like python the same way, it’s better to bitbake image.
For C/C++ I’m using eclipse, proper debugger setup scp’s executable / library and other files I specify to target and uses gdb for debug as usual. Of course gdbserver should be present on target.
Once your executables are done, you still need to get in touch with Yocto creating your own recipes. Or… take rootfs *.xz file from your TEZI files set, uncompress it, add your files and compress back rootfs to *.xz :-).
Is there a non-dispersed, non-outdated, clear and straightforward documentation that explains how to create a minimal Linux image with Yocto for the Apalis i.MX8? Yocto seems to me very complex and initimidating. I don’t know where to start.
Would any of these options work for you? Also, when you want to add a new package, it’s always worth checking if the recipes are already available. You can check this with: bitbake-layers show-recipes. This command will list all the recipes available. You can browse https://layers.openembedded.org/layerindex/branch/master/layers/ for any missing recipes.
Can you please tell us how did you try to install it?
Your original question was, as subject suggests, about cross-compile. My advice with apt install package:arm64 was only about -dev packages, which may be used to provide static compile libs and header files needed to cross-compile on your Ubuntu amd64 machine. Of course apt on Ubuntu can’t be used to install to your target machine rootfs, this is exactly what you see, either curl for amd64 or curl for arm64, but not both simultaneously. But -dev packages for both amd64 and arm64 can be installed, link libs and headers get installed to arm64 gcc folders, so no problems with them.
I have a “Apalis-iMX8_Reference-Minimal-Image.rootfs.tar.xz” how can I install it ? I have already copied that file on a thumb drive, launched the Toradex Easy Installer, but the “mass storage” icon is still gray after I plugged the thumb drive.
Hi @embeddedmz! I’m glad we could help you succeed in this task.
All the files that will be used on the final image will be inside the deploy folder. On the tmp you’ll have some temporary files that are used during the build process and may be deleted or changed once you run bitbake again.
It was to know if I could use CMake to cross-compile a C/C++ program with the ARM compiler and the sysroot I found in tmp. We often program in C# .NET Core, I just tested that it works (SDK downloaded from Microsoft site, I saw that the ‘dotnet’ package is not available when I ran the bitbake command) and we can generate an image that contains the software packages we need so it’s not really important for the moment.