I discovered Yocto early last year when I was working with an application to use the Ettus E310’s to detect drones. The goal was to have tensorflow running on the E310 itself, alongside using it’s already built workflow of python support from UHD. Let’s not get into the niggly bits I found with that project (gnuradio support for python being 3.8, UHD support for RFNoC and matching that also, let alone compiling for tensorflow). The main situation I want to cover here:

I want to run my own code compiled for an NI target device

– Many of my customers as an NI salesperson

Now, a typical thing to do is one of two options:

  • Compile on target
  • Cross compile

Here’s where you may find some drawbacks that on first glance, appear unresolvable and you pack it all up and try with something else… but fear not! First, I’ll go through why these approaches don’t work in some/most cases (depending on the hardware you’re working with) and next, I’ll introduce the NI OS a bit more before explaining how we solve this issue. Finally, the new builds don’t build right off the cuff, I’ll submit some CARs with our github to get those fixed, in the mean time, I’ll document them here first.

So, why not compile on target? It’s always a great way to get it working right? Unfortunately, you are assuming your compilation tools on the target are the right version. What you may find however is that you’ll get an error such as “Minimum version for compiling requires GCC 3.7” or something of this regard. You may be thinking, no problem, opkg update gcc. But it may not have a new version available and only say it has the newest version. We’ll find out why this is later and hopefully you’ll make an “awwwww” sound! ;).

You may also be like me and think, fine, I’ll go compile gcc on the target as well, you’ll probably spend a long while going through a whole stack of dependencies with this approach, spending hours or even days watching compilation after compilation. Or worse, if your hardware is limited like any embedded device, you’ll likely crash it, have to restart and be in a loop of crashing with no success.

This is when cross compilers might sound like the ticket too right? Well, cross compilers are two things mainly:

  • A copy of your sys root, representing header files available on the target for includes
  • The build tools for the target like gcc, automake, binutils, make etc…

So you go find the cross compiler on NI and try with that, but you still hit the minimum version problem. Now what to do though, you can’t recompile the build tool to update gcc… or can you?

Tags:

One thought on “Compiling the NI Linux RT with Yocto

  1. Thank you for every other informative website.
    The place else could I get that kind of info written in such
    an ideal approach? I’ve a project that I am simply now running
    on, and I’ve been at the look out for such info.

All fields marked with an asterisk (*) are required