关闭

ubuntu12.04 MX28调试记录

1024人阅读 评论(0) 收藏 举报
分类:

对于ubuntu12.04的用户可能会报如下错误:

funbox@funbox-System:/opt/freescale/ltib$ ./ltib 

ltib cannot be run because one or more of the host packages needed to run it
are either missing or out of date or not in ltib's standard path.  Please
install/upgrade these packages on your host.  If you have your own utilities
in non-standard paths, please add an entry into the .ltibrc file for example:

%path_std
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/my/own/exes

Package                Minimum ver   Installed info
-------                -----------   ---------------
zlib                   0             not installed

Died at ./ltib line 1409.
traceback:
 main::host_checks:1409
  main:554


Started: Thu Nov 19 10:11:02 2015
Ended:   Thu Nov 19 10:11:03 2015
Elapsed: 1 seconds

需要执行如下patch-ltib-ubuntu12.04.sh:

#!/usr/bin/env bash

# get the patch tarball and untar it
wget -O ubuntu-ltib-patch.tgz https://community.freescale.com/servlet/JiveServlet/downloadBody/93454-102-3-2834/ubuntu-ltib-patch.tgz
tar -xzvf ubuntu-ltib-patch.tgz

# execute the script which do the patching
ltibDir=`pwd`
cd ubuntu-ltib-patch
./install-patches.sh $ltibDir



1.拷贝L2.6.35_1.1.0_130130_source.tar.gz到/opt/freescale
2.# /opt/freescale
   # tar xvf L2.6.35_1.1.0_130130_source.tar.gz
   # ./L2.6.35_1.1.0_130130_source/install
   # cd ltib
   # ./ltib

执行./ltib时出现如下错误:

funbox@funbox-System:/opt/freescale/ltib$ ./ltib 

I ran the command: sudo -S -l which returned:

[sudo] password for funbox: Sorry, try again.
[sudo] password for funbox: Sorry, try again.
[sudo] password for funbox: Sorry, try again.
sudo: 3 incorrect password attempts

This means you don't have sudo permission to execute rpm commands as root
without a password.  This is needed for this build script to operate correctly.

To configure this, as root using the command "/usr/sbin/visudo",
and add the following line in the User privilege section:

funbox ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

traceback:
 main::check_sudo_setup:2467
  main::host_checks:1413
   main:554


Started: Thu Nov 19 09:15:14 2015
Ended:   Thu Nov 19 09:15:20 2015
Elapsed: 6 seconds


Build Failed

3.解决上述错误
  # sudo vi /etc/sudoers
在最后一行加入,然后保存
funbox ALL=NOPASSWD: /usr/bin/rpm,/opt/freescale/ltib/usr/bin/rpm
注意:funbox是用户名

4.错误解决
  1) compr_lzo.c:31:23: fatal error: lzo/lzo1x.h: No such file or directory
     # sudo apt-get install liblzo2-dev
     # rm /opt/freescale/ltib/usr/src/rpm/BUILD/mtd-utils/ -rf

  2) uuid/uuid.h: No such file or directory

# sudo apt-get install uuid-dev
# rm /opt/freescale/ltib/usr/src/rpm/BUILD/mtd-utils/ -rf

5.此时可以运行./ltib脚本不过此时还遇到了一个问题在编译lxdialog时遇到编译错误明显是ncurses的问题该问题的主要原因是-lncurses选型没有生效,修改如下:

将lkc-1.4-lxdialog.patch里面的3112行的

mconf_LIBS= -lncurses

mconf: $(mconf_OBJ) $(lxdialog_LIB)

             $(CC) $(LDFLAGS) $(mconf_LIBS) $^ -o S@ 

修改为

mconf_LIBS= 

mconf: $(mconf_OBJ) $(lxdialog_LIB)

             $(CC) $(LDFLAGS) $(mconf_LIBS) $^ -o S@ -lncurses

6./opt/freescale/ltib/dist/lfs-5.1/mux_server/mux_server.spec的25行

%{__cc} %{optflags} -lpthread mux_server.c -o mux_server -lpthread
修改为

mux_server.c -o mux_server -lpthread

7.出现Can't touch .host_wait_warning31

# chmod 777 /opt/freescale

# chmod 777 /opt/freescale/ltib

8.解压u-boot,解压出来的文件存放到/opt/freescale/ltib/rpm/BUILD/u-boot-2009.08

# ./ltib -m prep -p u-boot

9.单独编译u-boot

# make CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi- mx28_evk_config

make CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi- 

10.编译kernel

./ltib -m scbuild -p kernel

11.imx-bootlets控制GPIO实现点亮LED

# vi boot_prep/init-mx28.c,在int _start(int arg)函数加入

    HW_PINCTRL_MUXSEL3_SET(3 << 2); //PINID_LCD_D17
    HW_PINCTRL_DOE1_SET(1 << 17);
    HW_PINCTRL_DOUT1_SET(1 << 17);

    HW_PINCTRL_MUXSEL3_SET(3 << 4); //PINID_LCD_D18
    HW_PINCTRL_DOE1_SET(1 << 18);
    HW_PINCTRL_DOUT1_SET(1 << 18);

12.生成updater_ivt

MFGTool 烧写 Nand flash 的原理是:使用 USB 将 updater 系统送入 DDR 中启动运行,并通过 USB 发送 ucl.xml 文件中的命令以及 ucl.xml 文件中所指定的 uboot、内核、文件系统等文件到开发板,从而实现将 uboot、内核、文件系统烧写到 Nand Flash 上。而此 updater 系统也是一个精简版的 linux 系统,也需要支持新的 Nand Flash,因此需要重新制作一遍 updater 系统。
关于制作 updater 系统的方法如下:
1.在内核目录下执行 make imx28evk_updater_defconfig;
2.然后执行 make,在 arch/arm/boot 目录下生成 zImage;
3.将 zImage 拷贝到 bootloader/imx-bootlet 工具目录下,执行 build_updater 脚本,即可生
成 updater_ivt.sb 文件,即为 updater 系统。
另外,uboot 也需要执行 Nand Flash 拷贝操作,因此,也需修改其驱动,而 uboot 中的
Nand Flash 驱动与 linux 的完全一样。

# vi /opt/freescale/ltib/rpm/BUILD/imx-bootlets-src-2.6.35.3-1.1.0/linux_prep/board/iMX28_EVK.c

#char cmdline_def[] = "gpmi=g console=ttyAM0,115200 root=ubi0:rootfs rootfstype=ubifs  fec_mac= ethact";




0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:68524次
    • 积分:952
    • 等级:
    • 排名:千里之外
    • 原创:41篇
    • 转载:0篇
    • 译文:1篇
    • 评论:9条
    文章分类
    最新评论