L4T on Apalis T30 (Toradex - ARM A9 + Tegra 3 )

Hello all,

1st Part :

I’m trying to install L4T R16.5 on the SoC provided by Toradex, the Apalis T30.
However, I am running into some troubles.
The Apalis is initially shipped with a BSP and Angstrom… which is no good for me, I need Ubuntu!

I am following the release notes from here : https://developer.nvidia.com/linux-tegra-rel-16

I can’t manage to flash the system image onto my Apalis… maybe there are some differences with the Cardhu ? To be more precise, I can create the system.img but I can’t manage to flash it into the board.
I set my module in Recovery mode, and from the “lsusb” command I can see a NVida Device connected.

---------- If you have any ideas on this, please help :) ----------------------


2nd Part :

Then, I started trying many different things.
I downloaded the stock Apalis Linux image from here :
http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/

I also downloaded the drivers, codecs and Sample File Sytem from L4T R16.5, and I replaced the rootfs of the Apalis from the rootfs from L4T.

I can flash this image onto my Apalis from the update.sh script provided by Toradex.
I have a running Ubuntu 12.04 LTS, that seems to be the right L4T release.
After installing ubuntu-desktop, I have a working graphical desktop !

HOWEVER, I don’t have any hardware acceleration. The Tegra 3 GPU is not detected.

The nvidia-detector utility gives me “none”…

Desktop feels a bit laggy, and my video decoding capabilities are very low.
From a simple webcam, I have a 2sec lag and low fps.

Xorg.conf seems ok, the tegra drivers are still in the folder /usr/lib/x11/modules/drivers
The ABI Xserver version is 11.

I have tried literaly a hundred things to get a working Ubuntu on the Apalis T30, and now I am seeking for help.

Thanks for your time,
Regards,
Gregoire

The nvidia 16.5 release supports only the Cardhu and you need to install the drivers and rootfs from Toradex for Toradex boards. I would assume that the Toradex releases support about the same stuff as the nvidia releases.

Video encoding and decoding (without showing anything) only depends on GStreamer, so for those you don’t need to have fully accelerated X.Org running. For actually showing the decoded video or any 3D stuff you need to have X.Org drivers running.

What GStreamer pipeline did you use decoding the video? Do note that the GStreamer is the only supported API for video codecs.

Can you attach your /var/log/Xorg.0.log? That should tell if the Tegra3 drivers for X.Org get loaded.

As I recall Toradex created their version based on L4T R16.5, but with a significantly different kernel. Following this they used some of the nVidia binary files from R16.5 directly, but the rest was their own recipe.

I’m guessing you’d need to keep constant the Toradex kernel and the Toradex /lib/firmware files (thus also modules tied to the kernel). Following this, CODECs would also need to be used from Toradex (due to licensing you may or may not find these in the nVidia L4T repo). Unfortunately it has been quite some time since I’ve dealt with this, but Toradex left notes on the nVidia binaries in

rootfs/usr/share/common-licenses/trdx-nv-binaries-restricted-codecs

…sorry, I can’t remember where the CODECs were stored. For licensing reasons I do believe these files were given their own distinct folder. These files would likely be key to hardware accelerated access.

Thanks for these answers !

@kulve : Thanks, here is my X.org log file : http://www.pastebin.com/ntzhk982
If you find any useful information, please tell me :)
I am quite now to video processing on Linux so I am not sure I am using Gstreamer correctly. I will investigate this point. However, I do want to display my camera output on the screen as well as some image processing features.

@linuxdev : Thanks for this insight ! I am actually using the kernel (uImage), bootloader (u-boot) and bctfile provided by Toradex for the Apalis T30. I am only replacing the rootfs Sample File System from L4T 16.5.
However, I am using the Nvidia codecs and not the Toradex ones.

Indeed there is a huge difference in the rootfs/usr/share/common-licences directory :

I do have the trdx-nv-binaries, trdx-nv-binaries-gstapps, trdx-nv-binaries-restricted-codes in the Toradex image.

Should I copy the content of this directory into the rootfs of my “custom” image ? (Toradex + L4T).
Just a reminder, Toradex image is based on Angstrom Linux where as L4T is Ubuntu 12.04 LTS.

Thanks for your help !!

The X.Org log doesn’t show anything obviously wrong. It does find and load the accelerated Tegra driver for X.Org.

If you using Ubuntu, you may want to use something more light weight desktop environment, like XFCE4.

When using a webcam, you need to explicitly use the GStreamer, or otherwise only SW components are used and the perfomance will be horrible.

You may want to try something like this (I didn’t actually test it, so it might not be exactly right):

gst-launch-0.1 -v v4l2src ! "video/x-raw-yuv,width=(int)640,height=(int)480,framerate=(fraction)30/1" ! nvxvimagesink

Thanks !

Until now, I was configuring my webcam video input as follow :

mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=uyvy:device=/dev/video0:input=1:fps=25:alsa:amode=1:forcechan=2:audiorate=8000:adevice=plughw.1,0:forceaudio:immediatemode=0 -ao sdl

Is mplayer using Gstreamer ? or do I only use SW components ?
I’m going to test it soon and let you know the results

Unfortunately mplayer isn’t using GStreamer, so it’s SW only (even if ARM optimised).

I haven’t touched that in quite some time. I’m not certain which you need to use. Some of the Toradex files will be matches to nVidia files and are simply what Toradex inherited, but others may have been adjusted to work with the Toradex kernel or the T30 module hardware. If you have lots of time, it might just be a case of trial and error. I’d try to stick to the Toradex version where possible.

Alright I’m gonna keep trying and failing until hopefully something works !

Maybe you can help me with something else then… do you know if it is possible to replace the Angstrom distibution by a L4T or even a simple Ubuntu using OpenEmbedded and the Toradex BSP ??
See more here : http://developer.toradex.com/software-resources/arm-family/linux/board-support-package/openembedded-(core)

I am totally new on this kind of things so I don’t understand the article fully.
I will also ask again the Toradex support for this

Directly installing L4T will not work for the T30. Modifications would be extensive to make it work. In theory some of the other distributions for custom building embedded would work, just don’t expect it to be “easy”. As mentioned before, if you can start with the Toradex kernel and the firmware files around it, your chances are good (just not “quick”). This seems to be something like the approach Toradex took…they modified an L4T kernel, used some of the hardware access binaries, and then built everything around it.

Ehmm alright ! still seems like a hard challenge.

What do you think about this article ?

http://developer.toradex.com/software-resources/arm-family/linux/images/using-the-nvidia-provided-l4t-rootfs

That what I was using before but it looks like it’s not fully working.
Maybe I am using something the wrong way to enable the hardware acceleration.

Toradex seems to say it is possible, but you’d still have to import the same files from their non-L4T install for firmware and hardware access.

One particularly tricky place where just a simple update of the rootfs might not be obvious regards the boot loader (you must use the Toradex boot loader, the Toradex kernel relies on u-boot setting up a custom environment). In the case of u-boot on the T30 some of the hardware settings are actually provided from u-boot which would normally be provided by the rootfs once boot switches to the kernel (this seems to me to be a way of minimizing how much eMMC is required). In particular, I’ve run into issues where video appears to mysteriously ignore the rootfs files…it turned out that u-boot provided those settings and after that the X11 configuration files were ignored (especially obvious if using multiple displays). There is a similar issue for some of the networking, e.g., multiple NICs may do some “odd” things with MAC address settings because of u-boot configuration.

If your experimental T30 setup appears to not be fully working, consider if the settings were possibly locked in during u-boot stages prior to the kernel loading (i.e., the kernel does not set up those devices, but instead assumes the u-boot provided configuration). You can actually stop boot during the u-boot stage and experiment with those settings if you know which ones they are. Be especially suspicious of this requirement if you have multiple hardware devices of a particular type (e.g., dual display, dual NIC) and only one device works, or if both devices seem to be forced to have the same settings.

Hi Guys,
I started getting to work on Apalis T30 and really interested to have Ubuntu L4T instead of Angstrom based Linux on this board.
Please share if anyone was able to load the Ubuntu L4T successfully into the board and all drivers working well.
Please provide steps to newbies and new starters to help everyone start using the Ubuntu L4T correctly loaded on Apalis T30.
Thanks for sharing your knowledge.
Look forward to get your advises…

I have not tried, it would be a significant effort. Some observations I’ve made that might help. The T30 only has 8 GB of flash, so if you are porting the current L4T 21.x, you’re out of luck unless you either first cut down on the size, or put rootfs on a separate SD card. My thought is that you could start on something like Jetson (L4T R21.x is set for this), and see how well you can cut this down. Alternatively, depending on your carrier board, you could use an SD card or similar to make more space available. A good scheme would be u-boot, kernel, and firmware files on the built in T30 eMMC, pointing at the SD card for root partition. If the T30 handles something like a 16GB SD card, and if it’s version of u-boot can do this, life gets easier. You could leave the existing Angstrom variant on the T30 and boot different kernels and rootfs to SD card for experimentation.

U-boot itself was not the default under Jetson up through R19.3; at R21.1 u-boot became default (R21.3 is the latest release at this time). Once you have the Toradex u-boot working to point at an SD card rootfs you’d have to start looking at u-boot itself, comparing u-boot environment for Angstrom T30 to environment of R21.x TK1.

I suspect that making modern L4T u-boot work with the old Angstrom rootfs first would be difficult, yet make life easier in the long run. The serial console itself would be the first point of comparison when doing so (without serial console you really just have fastboot instead of u-boot flexibility). Parts of the Toradex u-boot control some video settings (making separate display on DVI and LVDS a pain) and network settings (making multiple network card setup a pain), and the Angstrom version depends on this for some driver loading and driver settings. Under modern L4T for Jetson, such values are only used for initial kernel use, and then init takes over in a standard way. The conversion of modern L4T u-boot to handle the older T30 kernel would provide understanding of what is necessary to migrate to use of init for configuration that was originally done entirely in kernel and u-boot.

Hello guys,
I could manage to load the Ubuntu L4T rootfs into the Apalis T30 module and I can get into the Ubuntu login prompt and login to system.
However, it seems that the Ethernet is not connected as I cannot do “apt-get update” and cannot ping any website.

I only changed the Toradex rootfs with NVidia L4T rootfs so the U-Boot and Kernel is same as original Toradex linux.

Do you have any idea why and how I can fix this issue?

Many thanks,

What does “ifconfig -a” show?

There are a number of possibilities. By default L4T uses a simple DHCP. What is the output of “ifconfig”? It may be nothing more than a simple DHCP configuration, e.g., perhaps a MAC address changed and your DHCP server doesn’t like it.

Btw, do you have a Jetson to also check things out on? I ask because comparison of u-boot environment between T30 and Jetson would offer a lot of information on what L4T expects which T30 may prepare for differently (e.g., search for a different variable name in u-boot for the same data).

As mentioned before, network setup on the Angstrom-derived system depends almost entirely on u-boot setup (I’ve had a number of issues trying to build a custom network bridge appliance on T30). It seems that this older T30 Angstrom system inherits settings from u-boot, and then starts networking without any assistance from init files…in this case the T30 kernel network driver load itself causes the T30 to configure and start networking, inheriting from u-boot. In the case of Jetson, some network setup is possible for network boot options, but normal L4T boot uses init files. The mix may need adjustment.

In general it appears that one of the main goals of the T30 version of things was to optimize for reduced memory/storage requirements. My speculation is that hardware which was set up and working correctly from u-boot had it’s init from L4T cut out (making the busybox alternate setup inert). Some video settings and some network settings under this older system can not have “usual” settings changed in init files, but instead require u-boot settings to be adjusted.

Find the issue by myself,
need to use “dhclient eth0” to activate the Ethernet…

All are ok now… Any question, ask me…

Was the original u-boot entry (other than pointing at a new rootfs) in need of any edits?

Hi linuxdev/kiwa/others…,
I have spent almost all my times on Apalis T30 within last month to understand how this interesting device is working.
I have achieved quite good outcomes but still have some questions which actually related to my Linux knowledge and not Apalis itself.
That would be great if you guys can put me on the track and tell me how can I achieve the things I wanna explain bellow…

First of all and so far, I have created my very own custom Ubuntu 15.04 rootfs by using the qemu-debootstrap chroot.
I made an script which will create a SD card image and I boot the Apalis T30 for using the SD card instead of eMMC. Just because SD option is easier to test different SD images!
The boot process works fine and I can login to Ubuntu 15.04 without any problem.
In case you guys want to use my script just clone this git which I have created for Raspberry Pi 2 and change the ext4 partition to be replaced with ext3, and also copy the Toradex uImage to partition 1 instead of RPi2 kernels --> https://github.com/sghazagh/RPi2-Ubuntu

The script will pack them and you can boot the Apalis with SD card.
use U-boot “sdboot” to boot from SD card. Do not forget the u-boot to match “sdarg” variable to point to the right partition and mmcblk. The SD card slot is “mmc dev 2”. (Any question, ask…)

now my question,
What I have got is just the command prompt!!! How can I get X.org working?!
Actually I do not understand the requirements to have graphical interface.
I have confused by terms: X11.org, xWindow, xServer, xClient!
What do I need to install to be able to run a simple Hello Word application via graphical interface?!

I do appreciate if you share your thought and advise…

Thanks