centos 7.3
64位
进入目录:
/home/sama5d2
有两个文件夹:
buildroot_2018_06_12.tar.gz
和
multi-serial_2018_06_12.tar.gz
##1. 编译内核
运行命令:
tar xvf multi-serial_2018_06_12.tar.gz
会解压出一个目录:
/home/sama5d2/multi-serial/
进入目录:
/home/sama5d2/multi-serial/kernel/SAMA_XIN2/
执行如下命令:
export PATH=$PATH:/home/sama5d2/multi-serial/toolchain/gcc-arm-none-eabi-5_2-2015q4/bin
export CROSS_COMPILE=arm-none-eabi-
export ARCH=arm
make ARCH=arm CROSS_COMPILE=arm-none-eabi- distclean
make ARCH=arm CROSS_COMPILE=arm-none-eabi- sama5_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage dtbs
make ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage dtbs -j4 快一些
编译成功之后,会在
/home/sama5d2/multi-serial/kernel/SAMA_XIN2/arch/arm/boot 目录下:
生成内核镜像文件,该文件名字是 zImage 。
会在目录/home/sama5d2/multi-serial/kernel/SAMA_XIN2/arch/arm/boot/dts下生成文件:
myd_ja5d2x_lcd7i.dtb
拷贝 烧写文件到对应的目录:
cp /home/sama5d2/multi-serial/kernel/SAMA_XIN2/arch/arm/boot/dts/myd_ja5d2x_lcd7i.dtb /home/sama5d2/multi-serial/burnTool/burnKernelAndDTB
cp /home/sama5d2/multi-serial/kernel/SAMA_XIN2/arch/arm/boot/zImage /home/sama5d2/multi-serial/burnTool/burnKernelAndDTB
##2. 烧写内核
通过 samaba 映射到windows 下面的一个网络磁盘:比如是Y盘:
界面如下:
###使板子进入烧录模式:
使用如下的板子:
USB供电
连接串口,并用Putty打开。
这样板子进入了烧写模式。
在Windows下面,进入命令行模式:
执行如下指令:
cd /D Y:\multi-serial\burnTool\burnKernelAndDTB
Y:\multi-serial\burnTool\sam-ba_3.1.4-win32\sam-ba_3.1.4\sam-ba.exe -x burn_kernel_dtb.qml
烧写完毕之后,重启板子。
中间可能会失败,如果失败就重新来一次。
##3. 编译文件系统
进入目录:/home/sama5d2/
(1)tar xvf buildroot_2018_06_12.tar.gz
得到如下目录:
/home/sama5d2/buildroot/
(2)进入如下目录:
cd /home/sama5d2/buildroot/sama5d2_buildroot/
可以看一下文件do_cmd.sh 和readme.txt的内容
(3)执行如下指令:
./ do_cmd.sh
(4)执行如下指令:
cd …/buildroot-2017.02.2/
(5)执行如下指令:
make 如果出错的话,执行 sudo make
出的错误如下:(之前没有这个错误,执行sudo make 就可以了)
You seem to have the current working directory in your
LD_LIBRARY_PATH environment variable. This doesn’t work.
make[1]: *** [core-dependencies] 错误 1
make: *** [_all] 错误 2
(6)
生成的文件系统映像所在目录为
/home/sama5d2/buildroot\buildroot-2017.02.2/output/images/rootfs.tar
4 生成 文件系统映像
真实的执行命令,上面的先不要管
/home/sama5d2/multi-serial/ubiCreate/sama5d2_rootfs_to_ubi.sh
sudo cp /home/sama5d2/multi-serial/ubiCreate/sama5d2x-rootfs.ubi /home/sama5d2/multi-serial/burnTool/burnFileSystem/
5 烧写文件系统映像
###使板子进入烧录模式:
使用如下的板子:
USB供电
连接串口,并用Putty打开。
这样板子进入了烧写模式。
在Windows下面,进入命令行模式:
执行如下指令:
cd /D Y:\multi-serial\burnTool\burnFileSystem
Y:\multi-serial\burnTool\sam-ba_3.1.4-win32\sam-ba_3.1.4\sam-ba.exe -x multi_serial_rootfs.qml
烧写完毕之后,重启板子。
中间可能会失败,如果失败就重新来一次。
22
ubuntu 16.04
sudo apt-get install texinfo
sudo apt-get install libncurses5-dev
如何打包备份 资料
cd /home/sama5d2/multi-serial/kernel/SAMA_XIN2/
export PATH=$PATH:/home/sama5d2/multi-serial/toolchain/gcc-arm-none-eabi-5_2-2015q4/bin
export CROSS_COMPILE=arm-none-eabi-
export ARCH=arm
make ARCH=arm CROSS_COMPILE=arm-none-eabi- distclean
cd /home/sama5d2
sudo tar zcvf multi-serial_2021_04_25.tar.gz multi-serial
error arm-none-linux-gnueabi-gcc: No such file or directory
我们有时候输入arm-none-linux-gnueabi-gcc -v 会提示
bash: /home/bhj/QtLib/arm-2014.05/bin/arm-none-linux-gnueabi-gcc: No such file or directory
问题是32位于64位不兼容造成的。解决方法如下:
sudo apt-get install lib32z1
sudo apt-get install mtd-utils
mkfs.ubifs
1
如何解决ubuntu系统下source: not found错误
若在ubuntu系统下运行含有source命令的shell脚本时,出现source: not found错误,原因可能是shell的解释器不是bash,需把shell的解释器更改为bash。
请按以下步骤更改shell的解释器:
执行ls -l /bin/sh命令,若得到结果/bin/sh -> dash,则说明shell的解释器为dash。
执行dpkg-reconfigure dash命令,然后选择no。
再次执行ls -l /bin/sh命令,若得到结果/bin/sh -> bash,则说明成功更改shell的解释器为bash
ubuntu
sudo apt-get install autoconf automake libtool