Hello,
I am currently working on a iMX6 Sabre Lite Boart. Since I am fairly new to embedded devices, I looked into precompiled images to install on my board. I already used this one, and I am currently working with this Arch Linux image (which is designed for the Nitrogen6X, but works on my Sabre Lite Board). The problem is I am not sure whether I do have a CAN driver for my CAN connector or not, and I don't seem to have any can interface (no canX interface shows with ip addr command).
So I would like to know if there is a way to get the CAN connector to work with the image I am using ? If not, what would be the best image to install (that would have the CAN connector working) on my board ?
Any help would be greatly appreciated.
Hello,
The CAN driver may not be included by default in kernel, so either you build it by yourself and then insert it in the kernel (by an insmod I guess), or you can re-compile a kernel which will have natively the driver. If you want to do so you'll have to use LTIB or Yocto.
Best regards,
Thanks AlbertT for your answer.
Do you have any link, tutorial or guide that could explain me how to compile and add such a driver in the kernel ? Do you know if the LTIB tarball contains a guide on how to compile it and use it ?
EDIT:
I downloaded last LTIB version from Freescale website. After running ./ltib command, I get an error concerning the package zlib, which I do not have. I installed zlib1g and zlib1g, and even installed zlib from sources, but I still get this error. Is this a known issue on Ubuntu 12.10. Is there a workaround for this ?
If you want to do it with LTIB you can download the last BSP which is available here:i.MX6 Q/D/DL/S L3.0.35_4.0.0 GA release
The documentation can be found on the same page, you should be able to configure and compile for Sabre Lite. Then you'll have to configure the kernel, for instance by checking "Configure the kernel" in LTIB configuration, and then add the CAN support. I never did it but I guess that's the way I would proceed, if anyone has a better experience, don't hesitate to share your opinion !
If you want to do it by yourself, just download the kernel sources here :https://github.com/boundarydevices/linux-imx6/tree/boundary-imx_3.0.35_1.1.1
Some help can be found here :http://boundarydevices.com/cross-compile-i-mx6-kernel-using-ltib-toolchain/
So you'll have to install the cross toolchain by yourself (something like sudo apt-get install gcc-arm-linux-gnueabi), adapt the export to this toolchain, and use "make menuconfig" to configure the kernel.
That's the big lines.
I downloaded this version of LTIB. After running ./ltib for the first time, I get an error concerning missing packages. After installing them, I still get an error concerning the zlib package. I installed zlibg and zlibg-dev, which is indicated on several forums, but I get the same error. I installed zlib from sources, and I still get the same error.
Is this a known issue when running ltib on Ubuntu 12.10?
Is there a workaround?
Hi jcpep, The solution to this problem has already been solved : https://community.freescale.com/thread/302017
Please run this patch in your ltib directory:
copy this to a file ubuntuPatch.patch.
run :
patch -p1 < ubuntuPatch.patch
This should help
--- original/bin/Ltibutils.pm | 2012-08-15 12:04:53.728901999 -0500 |
+++ ltib/bin/Ltibutils.pm | 2012-08-15 12:12:01.916901781 -0500 |
@@ -562,7 +562,7 @@
binutils => 'ar --version 2>/dev/null',
'gcc-c++' => 'g++ --version 2>/dev/null',
glibc => 'ldd --version 2>/dev/null',
- 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libm.so' || -f '/usr/lib32/libm.so' || -f '/usr/lib/x86_64-linux-gnu/libm.so' || -f '/usr/lib/i386-linux-gnu/libm.so' },
+ 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libm.so' || -f '/usr/lib32/libm.so' || -f '/usr/lib/x86_64-linux-gnu/libm.so' || -f '/usr/lib/i386-linux-gnu/libm.so' || -f '/usr/lib64/libz.so' },
'glibc-headers' => sub { -f '/usr/include/stdio.h' },
'libstdc++' => sub {
return system_nb(<<TXT) == 0;
@@ -585,6 +585,7 @@
zlib => sub { my @f = (glob('/usr/lib/libz.so*'),
glob('/lib/libz.so*'),
glob('/lib64/libz.so*'),
+ | glob('/lib/i386-linux-gnu/libz.so*'), |
glob('/usr/lib/i386-linux-gnu/libz.so*'),
glob('/usr/lib32/libz.so*'),
glob('/usr/lib/x86_64-linux-gnu/libz.so*') ); @f > 1 ? 1 : 0 },
The patch didn't seem to apply correctly : here is the output of the command patch -p1 < ubuntuPatch.patch :
patching file bin/Ltibutils.pm
Hunk #1 FAILED at 562.
Hunk #2 FAILED at 585.
2 out of 2 hunks FAILED -- saving rejects to file bin/Ltibutils.pm.rej
and here is the content of the Ltibutils.pm.rej file :
1 --- bin/Ltibutils.pm 2012-08-15 12:04:53.728901999 -0500
2 +++ bin/Ltibutils.pm 2012-08-15 12:12:01.916901781 -0500
3 @@ -562,7 +562,7 @@
4 binutils => 'ar --version 2>/dev/null',
5 'gcc-c++' => 'g++ --version 2>/dev/null',
6 glibc => 'ldd --version 2>/dev/null',
7 - 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libm.so ' || -f '/usr/lib32/libm.so' || -f '/usr/lib/x86_64-linux-gnu/libm.so' || -f '/usr/lib/i386-linux-gnu/libm.so' },
8 + 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libm.so ' || -f '/usr/lib32/libm.so' || -f '/usr/lib/x86_64-linux-gnu/libm.so' || -f '/usr/lib/i386-linux-gnu/libm.so' || -f '/usr/lib64/libz.so' },
9 'glibc-headers' => sub { -f '/usr/include/stdio.h' },
10 'libstdc++' => sub {
11 return system_nb(<<TXT) == 0;
12 @@ -585,6 +585,7 @@
13 zlib => sub { my @f = (glob('/usr/lib/libz.so*'),
14 glob('/lib/libz.so*'),
15 glob('/lib64/libz.so*'),
16 + glob('/lib/i386-linux-gnu/libz.so*'),
17 glob('/usr/lib/i386-linux-gnu/libz.so*'),
18 glob('/usr/lib32/libz.so*'),
19 glob('/usr/lib/x86_64-linux-gnu/libz.so*') ); @f > 1 ? 1 : 0 },
I modified the Ltibutils.pm file manually, but it didn't solve my problem : the install is still blocking because of the flex-2.5.37-1355511909.patch file.
I advice you to delete your ltib directory. Apply this script :
#!/bin/bash
# Install packages needed by LTIB
sudo aptitude -y install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev
sudo aptitude -y install libdbus-glib-1-dev liborbit2-dev intltool
sudo aptitude -y install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool
sudo aptitude -y install uuid-dev liblzo2-dev
sudo aptitude -y install tcl dpkg
# Packages required for 64-bit Ubuntu
# Do "uname -a" and see if the word "x86_64" shows up.
if uname -a|grep -sq 'x86_64'; then
sudo aptitude -y install ia32-libs libc6-dev-i386 lib32z1
fi
# The following recommended for Linux development.
# They are not required by LTIB.
sudo aptitude -y install gparted emacs22-nox openssh-server
sudo aptitude -y install nfs-common nfs-kernel-server lintian
sudo aptitude -y install git-core git-doc git-email git-gui gitk
sudo aptitude -y install diffstat indent tofrodos fakeroot doxygen uboot-mkimage
sudo aptitude -y install sendmail mailutils meld atftpd sharutils
sudo aptitude -y install manpages-dev manpages-posix manpages-posix-dev linux-doc
sudo aptitude -y install vnc4server xvnc4viewer
Then invoke again your ltib directory with :
$ ./L3.0.35_4.0.0_130424_source/install
Here apply the previous patch ubuntuPatch.patch
You shlould not have any Hunk#, check if the patch was correctly applied :
$ find . -name '*.rej'
And normally, it will solve your problem of zlib
Apply this script :
As I mentionned it earlier, I could solve the zlib problem thanks to Leo workaround. Now, the problem that is blocking me is the retrieving of a flex-2.5.37-1355511909.patch file, whose link seems to be dead.
I too searched for the file flex-2.5.37-1355511909.patch but couldnt find it.
So i removed the line which is showing this patch file and patch p1 line in the flex.spec at ltib/dist/lfs*/flex
then it continued. After that during compiling lks, flex gave some segmentation fault/Killed problem. for this i copied the /usr/bin/flex to /opt/freescale/ltib/usr/bin overwriting it. then it continued.
My mistake ... All the packages are in pkgs folder of the source ...
Hi,
I do not any workaround yet but it can be done easily. Ltib looks for host libraries on this file bin/Ltibutils.pm, so search for those complaining packages:
zlib | => sub { my @f = (glob('/usr/lib/libz.so*'), |
glob('/lib/libz.so*'), | |
glob('/lib64/libz.so*'), | |
glob('/usr/lib/i386-linux-gnu/libz.so*'), | |
glob('/usr/lib32/libz.so*'), | |
glob('/usr/lib/x86_64-linux-gnu/libz.so*') ); @f > 1 ? 1 : 0 }, | |
zlib-devel' => sub { -f '/usr/include/zlib.h' }, |
On your console, search on /usr lo locate these libraries and add the path to both sub's, then try ltib again.
Leo
Hi Leo,
Thanks to your workaround, I could get past this point. But then, I got an error during the build of m4. Here is the content of host_config.log for this error :
Processing: m4
================
Build path taken because: no prebuilt rpm,
Try m4-1.4.16.tar.gz.md5 from the PPP
wget: unable to resolve host address `auslxsc01.am.freescale.net'
Try m4-1.4.16.tar.gz.md5 from the GPP
http://bitshrine.org/gpp//m4-1.4.16.tar.gz.md5:
2013-06-06 10:00:57 ERROR 404: Not Found.
Try m4-1.4.16.tar.gz from the PPP
wget: unable to resolve host address `auslxsc01.am.freescale.net'
Try m4-1.4.16.tar.gz from the GPP
http://bitshrine.org/gpp//m4-1.4.16.tar.gz:
2013-06-06 10:00:58 ERROR 404: Not Found.
Can't get: m4-1.4.16.tar.gz at ./ltib line 802.
Died at ./ltib line 1392.
traceback:
main::build_host_rpms:1392
main::host_checks:1447
main:554
Started: Thu Jun 6 09:56:21 2013
Ended: Thu Jun 6 10:00:58 2013
Elapsed: 277 seconds
These packages failed to build:
m4
Build Failed
These links indeed seem dead. I dowloaded the m4-1.4.16.tar.gz here. How could I get the LTIB install to get past this point ?
Strange :smileysad:
Place the .tar.gz and .md5 into /opt/freescale/pkgs and continue building.
Leo
After placing both th .tar.gz and .tar.gz.md5 files into /opt/freescale/pkgs, I get the same error concerning the a patch file.
Processing: flex
==================
Build path taken because: no prebuilt rpm,
Try flex-2.5.37-1355511909.patch.md5 from the PPP
wget: unable to resolve host address `auslxsc01.am.freescale.net'
Try flex-2.5.37-1355511909.patch.md5 from the GPP
http://bitshrine.org/gpp//flex-2.5.37-1355511909.patch.md5:
2013-06-07 18:15:08 ERROR 404: Not Found.
Try flex-2.5.37-1355511909.patch from the PPP
wget: unable to resolve host address `auslxsc01.am.freescale.net'
Try flex-2.5.37-1355511909.patch from the GPP
http://bitshrine.org/gpp//flex-2.5.37-1355511909.patch:
2013-06-07 18:15:09 ERROR 404: Not Found.
Can't get: flex-2.5.37-1355511909.patch at ./ltib line 802.
Died at ./ltib line 1392.
traceback:
main::build_host_rpms:1392
main::host_checks:1447
main:554
Started: Fri Jun 7 18:13:20 2013
Ended: Fri Jun 7 18:15:09 2013
Elapsed: 109 seconds
These packages failed to build:
flex
Build Failed
Before that, I also get this error :
Build time for bison: 59 seconds
sudo /opt/freescale/ltib/usr/bin/rpm --root / --dbpath /opt/freescale/ltib/ var/lib/rpm -e --allmatches --nodeps --define '_tmppath /home/jessica/LTIB/ freescale/ltib/tmp' bison 2>/dev/null
sudo /opt/freescale/ltib/usr/bin/rpm --root / --dbpath /opt/freescale/ltib/ var/lib/rpm --prefix / --ignorearch -ivh --replacepkgs --replacefiles --nod eps --excludedocs --define '_tmppath /home/jessica/LTIB/freescale/ltib/tmp' /opt/freescale/ltib/usr/src/rpm/RPMS/i686/bison-2.6-1.i686.rpm
error: failed to stat /run/user/jessica/gvfs: Permission denied
Preparing... ############################################### ###
bison ############################################### ###
The second issue (permission denied) is actually seen in all LTIB builds, I do not know how to fix it but apparently it does not affect the end-product (the whole built). For the download issue, I am not sure what is going on. In case you can switch to Yocto as a builder system, can you give it a try? For that particular board (sabre lite), on Yocto packages are constantly being updated (which is not the case for LTIB) so I am sure you will have a successful build through it.
Leo