I.MX6 SABRE SD L3.0.35

时间:2022-09-03 09:25:12

1). copy u-boot

sudo dd if=u-boot-mx6q-sabresd.bin of=/dev/sdb bs=512 seek=2 skip=2 conv=fsync

2). copy uImage

sudo dd if=uImage of=/dev/sdb bs=512 seek=2048 conv=fsync

3). copy rootfs


4). run bootcmd in u-boot env:

#: setenv loadaddr 0x10800000
#: setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
#: setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk1p1 rootwait rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666 video=mxcfb0:dev=hdmi,1920x1080M@60 ,if=RGB24'
#: setenv bootcmd_mmc 'run bootargs_base bootargs_mmc;mmc dev 2;mmc read ${loadaddr} 0x800 0x2000;bootm'
#: setenv bootcmd 'run bootcmd_mmc'

#: saveenv

#: run bootcmd


增加对xenomai的支持:

  1. GCC 4.8.1, 同时将3.14.28的arch/arm/lib/memset.S copy到3.0.35对应的地方:如果不这么做的话,GCC4.8.1编译之后,会在kmem_alloc的地方crash.

  2. cd $LINUX_DIR, make uImage,生成编译结果之后dd if=arch/arm/boot/uImage of=/dev/sdb bs=512 seek=2048 conv=fsync; 查看运行结果,能够正常boot,说明所有配置一切正都正确

  3. cp $xenomai_dir%/ksrc/arch/arm/patches/mxc/*.patch $LINUX_DIR

  4. patch -p1 < *.pre..patch  使用mx6的pre patch

  5. patch -p1 < *.patch 使用正常的patch

  6. patch -p1 < *.post..patch 使用post patch

  7. make uImage开始编译

  8. 将原来的根文件系统下的/etc/rc.d/init.d/gtk2删除,如果不删除,则会启动GPU等,导致内核crash,

编译完成之后,内核自动带xenomai补丁,可以通过cd /proc/xenomai/查看到有相应的文件生成,同时在boot log中能够看到如下的日志:

I-pipe: Domain Xenomai registered.
Xenomai: hal/arm started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.6.3 (Lies and Truths) loaded.
Xenomai: debug mode enabled.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.


测试Xenomai的运行情况:

1) export PATH=/opt/poky/1.5.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/

2) cd $xenomai_dir

3) ./configure CFLAGS="-march=armv7-a -mfpu=vfp3" --build=-march=armv7-a -mfpu=vfp3 --host=arm-poky-linux-gnueabi

4) make

5) make DESTDIR=$INSTALL_ABSOLUTE_PATH install