1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > linux rootfs编译进内核 九鼎x6818开发板笔记:uboot kernel rootfs编译和烧写

linux rootfs编译进内核 九鼎x6818开发板笔记:uboot kernel rootfs编译和烧写

时间:2022-10-20 06:22:22

相关推荐

linux rootfs编译进内核 九鼎x6818开发板笔记:uboot kernel rootfs编译和烧写

下面记录了如何搭建嵌入开发环境,如何编译uboot、kernel、和文件系统,如何烧写镜像以及如何配置uboot环境变量。

阅读注意:记录中(Base框中的内容)一些操作故意被添加,为了展示文件内容,故意调用cat(Ubuntu)或者type(window)命令;为了展示文件夹下的列表,故意用ls或者dir列出文件夹下的文件。记录中xiptech@ubuntu:~$前缀的为Ubuntu下的操作,X6818#前缀的为开发板uboot操作。为了表明后面的操作是在什么平台,我还加了“下面进行xxx操作”的转场描述。

准备工作

下面进行window操作

1、vm安装ubuntu 15.04 x64

2、共享一个window目录到ubuntu

window分享的目录E:\SVNFile\9dx6818Studio

映射到ubuntuxiptech@ubuntu:/mnt/hgfs/Share$pwd

/mnt/hgfs/Share

下面进行ubuntu操作

3、ubuntu下添加一个工作目录xiptech@ubuntu:~$mkdir9dx6818

4、将9dx6818共享到window

通过ui操作共享:在9dx6818文件夹上右键Local Network Share

或者直接修改smb.conf共享:xiptech@ubuntu:sudogedit/etc/samba/smb.conf

文末尾添加[ubuntu_9dx6818]

comment=9dx6818studioonubuntu

path=/home/xiptech/9dx6818

browseable=yes

writable=yes

public=yes

guestok=yes

重启samba服务xiptech@ubuntu:sudo/etc/init.d/smbdrestart

下面进行window操作

5、建立网络映射

u-boot编译

下面进行ubuntu操作

1、源码拷贝解压

x6818_linux_160719.tar.bz2解压到/home/xiptech/9dx6818/

编译

u-boot配置说明:

/home/xiptech/9dx6818/x6818_linux_160719/uboot下有几个配置

nsih.txt: uboot实际编译的文件,默认为 ibox6818 卡片电脑 2GB 配置文件;

nsih-2G16b-800M.txt: x6818 开发板 2GB DDR3 的配置文件;

nsih-1G16b-800M.txt: x6818 开发板配置文件;

nsih-2G8b-800M.txt: ibox6818 2GB DDR3 的配置文件;

所以我们的开发版用的是nsih-1G16b-800M.txt,写一个编译脚本mk_x6818_board.sh并执行编译xiptech@ubuntu:~/9dx6818/x6818_linux_160719$catmk_x6818_board.sh

echo"configddr3=1G16b-800M"

cpuboot/nsih-1G16b-800M.txtuboot/nsih.txt

./mk-u

xiptech@ubuntu:~/9dx6818/x6818_linux_160719$./mk_x6818_board.sh

输出xiptech@ubuntu:~/9dx6818/x6818_linux_160719/out/release$ls*bin

ubootpak.bin

内核编译

编译xiptech@ubuntu:~/9dx6818/x6818_linux_160719$./mk-k

输出xiptech@ubuntu:~/9dx6818/x6818_linux_160719/out/release$ls*img

boot.img

文件系统编译

安装依赖软件xiptech@ubuntu:sudoapt-getinstalltexinfo

xiptech@ubuntu:sudoapt-getinstallgit

xiptech@ubuntu:sudoapt-getinstalllib32stdc++-4.9-dev

xiptech@ubuntu:sudoapt-getinstalllib32z1

打开文件buildroot/output/build/host-ncurses-5.9/include/curses.h找到externNCURSES_EXPORT(bool)mouse_trafo(int*,int*,bool);/*generated*/

将这句注释删除掉:/*generated*/

编译xiptech@ubuntu:~/9dx6818/x6818_linux_160719$./mk-b

输出xiptech@ubuntu:~/9dx6818/x6818_linux_160719/out/release$ls*rootfs*

qt-rootfs.img

...额!文件系统build3个钟头...

fastboot烧写镜像

1、连接串口和usb

开发版操作SecureCRT连接开发版调试串口(default:115200、右边那个串口),使用安卓数据线连接电脑usb和开发版OTG接口

下面进行windows操作

2、安装fastboot工具

安装到E:\SVNFile\9dx6818Studio\utils\fastbootE:\SVNFile\9dx6818Studio\utils\fastboot的目录

/09/0115:27

/09/0115:27

/02/1208:08815,104adb.exe

/02/1208:0896,256AdbWinApi.dll

/02/1208:0860,928AdbWinUsbApi.dl

/03/2415:171,787,392ApkInstaller.ex

/06/0911:20404ApkInstaller.in

/02/1208:08157,184fastboot.exe

/10/2316:0463license

下面进行开发板操作

3、开发板重启并敲回车进入u-boot

4、进入fastboot模式X6818#fastboot

FastbootPartitions:

mmc.2:ubootpak,img:0x200,0x78000

mmc.2:2ndboot,img:0x200,0x4000

mmc.2:bootloader,img:0x8000,0x70000

mmc.2:boot,fs:0x100000,0x4000000

mmc.2:system,fs:0x4100000,0x2f200000

mmc.2:cache,fs:0x33300000,0x1ac00000

mmc.2:misc,fs:0x4e000000,0x800000

mmc.2:recovery,fs:0x4e900000,0x1600000

mmc.2:userdata,fs:0x50000000,0x0

Supportfstype:2ndbootfactoryrawfatext4emmcnandubiubifs

Reservedpart:partmapmemenvcmd

DONE:Logobmp311by300(3bpp),len=280854

DRAW:0x47000000->0x46000000

LoadUSBDriver:android

Coreusbdevicetieconfigurationdone

OTGcableConnected!

------------------------------------------

下面进行window操作

5、镜像准备

将需要烧写的镜像拷贝到E:\SVNFile\9dx6818Studio\upgrade目录E:\SVNFile\9dx6818Studio\upgrade的目录

/08/2815:0016,998,632boot.img

/08/2817:36536,870,912qt-rootfs.img

/08/2815:00303,544ubootpak.bin

6、烧写

添加三个脚本用于发起烧写,直接双击执行脚本烧写E:\SVNFile\9dx6818Studio\upgrade>typeupgrade_ubootpak.cmd

fastbootflashubootpakubootpak.bin

pause

E:\SVNFile\9dx6818Studio\upgrade>typeupgrade_boot.cmd

fastbootflashbootboot.img

pause

E:\SVNFile\9dx6818Studio\upgrade>type"upgrade_qt-rootfs.cmd"

fastbootflashsystemqt-rootfs.img

pause

下面进行开发板操作

7、u-boot环境变量配置X6818#setenvbootcmd"ext4loadmmc2:10x48000000uImage;bootm0x48000000"

X6818#setenvbootargs"lcd=wy070mltp=gslx680-linuxroot=/dev/mmcblk0p2rwrootfstype=ext4"

X6818#setenvubootpak1

X6818#setenvboot1

X6818#setenvsystem1

X6818#setenvuserdata0

X6818#setenvcache0

X6818#save

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。