100ask roc-rk3399-pc

来自百问网嵌入式Linux wiki
Wiki讨论 | 贡献2019年6月20日 (四) 16:24的版本 (创建页面,内容为“==配套资料介绍== <syntaxhighlight lang="c" > 00_UserManual <-----------------包含用户手册 01_windows_tools <------------------开发涉及的所…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

配套资料介绍

 
00_UserManual			 <-----------------包含用户手册
01_windows_tools		 <------------------开发涉及的所有工具
02_images		         <-----------------系统镜像
   ├─nandflash		 <-----------------包含nandflash系统镜像
   └─sdcard                    <-----------------包含sd卡系统镜像
03_examples
04_lib
05_hardware			 <-----------------硬件相关资料
06_datasheet	
    ├─AM437x_Chip		 <-----------------CPU类相关手册
    └─Peripheral		 <-----------------外设芯片相关手册

快速入门

准备工作

要使用你的AM335x开发板,请提前准备好以下资源:

  • 一台可以上网的windows电脑
  • 100ask AM3358开发板
  • microSD卡/TF卡: Class10或以上的 8GB SDHC卡
  • 一个12v/2A的电源是配置
  • VMware-player-15.1.5.exe
  • Vmware ubuntu 18.04 64位虚拟机镜像
  • win32diskimager-1.0.0-install.exe
  • HPUSBDiskStorage_Format_Tool 2.0.6.EXE
  • MobaXterm_Portable_v11.0.zip

如需自行安装配置vmware ubuntu开发环境请参考Ubuntu开发环境配置

编译系统

获取源码

类别 国内coding仓库 国外github仓库
u-boot https://dev.tencent.com/u/weidongshan/p/100ask-am335x_uboot https://github.com/100askTeam/100ask-am335x_uboot
linux kernel https://dev.tencent.com/u/weidongshan/p/100ask-am335x_kernel https://github.com/100askTeam/100ask-am335x_kernel
根文件系统 https://dev.tencent.com/u/weidongshan/p/100ask-am335x_buildroot https://github.com/100askTeam/100ask-am335x_buildroot

git邮箱账号和用户名配置

git config --global user.email "you@example.com"
git config --global user.name "Your Name"
初次使用,需要配置用户名和密码才可以进行代码同步,用户名和密码根据自己情况设定,也可以随意设定

考虑到代码仓库过多,特使用repo工具管理代码
repo工具配置

book@100ask:~$ git clone  https://git.dev.tencent.com/codebug8/repo.git
book@100ask:~$ sudo cp repo/repo /bin/
book@100ask:~$  mkdir -p 100ask_am335x && cd 100ask_am335x
book@100ask:~/100ask_am335x$  repo init -u https://dev.tencent.com/u/weidongshan/p/manifests/git -b linux-sdk -m ti335x/100ask-am335x_linux_release_v1.0.xml --no-repo-verify
book@100ask:~/100ask_am335x$  repo sync -j4

上面使用的repo管理为国内coding仓库

设置工具链

交叉编译工具链主要是用于在ubuntu主机上编译并声称可以在其它平台上运行的系统。设置交叉编译工具主要是设置PATH, ARCH和CROSS_COMPILE三个环境变量,下面介绍具体设置方法。

  • 永久生效

如需永久修改,请修改用户配置文件, Ubuntu系统下,修改如下:

vim ~/.bashrc

在行尾添加或修改:

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihfexport
PATH=$PATH:<WORKDIR>/ToolChain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf/bin
  • 临时生效

执行完“export”命令后,该设置只对当前终端有效

book@100ask$ cd <WORKDIR>/ToolChain
book@100ask$ export PATH=$PATH:<WORKDIR>/ToolChain/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin
book@100ask$ export ARCH=arm
book@100ask$ export CROSS_COMPILE=arm-linux-gnueabihf-
  • 手动指定

Make编译时指定ARCH架构 CROSS_COMPILE交叉编译工具链

book@100ask$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- [命令]

编译uboot

book@100ask$ cd u-boot
book@100ask:u-boot$ make distclean
book@100ask:u-boot$ make 100ask_am335x_defconfig
book@100ask:u-boot$ make
  • uboot常用参数
    • nfs启动系统
setenv rootpath /work/rootfs_335x
set ipaddr 10.10.10.23
setenv serverip 10.10.10.66
setenv fdtfile am335x-evm.dtb
run netboot

编译linux kernel

book@100ask$ cd linux-kernel
book@100ask:linux-kernel$ make mrproper
book@100ask:linux-kernel$ make 100ask_am335x_defconfig
book@100ask:linux-kernel$ make zImage
book@100ask:linux-kernel$ make dtbs

编译内核模块

book@100ask:linux-kernel$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules

安装内核模块到nfs根文件系统

book@100ask:linux-kernel$ sudo make ARCH=arm INSTALL_MOD_PATH=</media/rootfs>  modules_install

编译根文件系统

配置文件 含义
100ask_am335x_qt_defconfig 文件系统版本(再默认版本支持了qt)
100ask_am335x_defconfig 完整系统镜像版本(包含uboot kernel最后会生成所有的文件以及一个完整的系统镜像)
book@100ask$ cd buildroot2018.02
book@100ask:buildroot2018.02$ make clean
book@100ask:buildroot2018.02$ make 100ask_am335x_defconfig
book@100ask:buildroot2018.02$ make menuconfig
book@100ask:buildroot2018.02$ make –jN		 /*N表示CPU的线程数*/

编译后生成文件介绍

 
buildroot2018.02	
	├── output
		├── images
	   	    ├── am335x-evm.dtb              <--设备树文件
	   	    ├── boot.vfat					<--分区文件
	   	    ├── MLO							<--启动引导
	   	    ├── ramdisk.gz					<--RAM格式根文件系统
	   	    ├── rootfs.cpio
	   	    ├── rootfs.cpio.gz
	   	    ├── rootfs.cpio.uboot
	   	    ├── rootfs.ext2					<--ext2格式根文件系统
	   	    ├── rootfs.ext4 -> rootfs.ext2
	   	    ├── rootfs.tar					<--打包后的根文件系统
	   	    ├── rootfs.tar.gz				<--打包并压缩的根文件系统,适用于NFSROOT启动
	   	    ├── rootfs.ubi					<--支持nandflash加载的根文件系统
	   	    ├── rootfs.ubifs
	   	    ├── sdcard.img					<--完整的SD卡系统镜像
	   	    ├── u-boot.bin					<--qspi启动的u-boot
	   	    ├── u-boot.img					<--u-boot镜像
	   	    ├── u-boot-spl.bin				<--spl启动镜像
	   	    ├── uEnv.txt					<--默认u-boot配置文件
	   	    └── zImage						<--内核镜像

sd卡启动

1.安装资料光盘下01_tools/SD Card Formatter 5.0.1 Setup.exe软件,安装完成后打开!
2.使用SdCardFormatter格式化SD卡,格式化步骤如下如所示!

100ask am335x SD P 004.png 100ask am335x SD P 005.png 100ask am335x SD P 006.png
(1)选择要格式化的SD卡,选中Quick format,点击Format (2)在弹出的对话框中点击是(Y) (3)等待格式化完成,在弹出的对话框中点击确定

3.安装资料光盘下01_tools/ win32diskimager-1.0.0-install.exe软件,安装完成后打开!
4.使用wind32diskimage烧写编译后的系统镜像,烧写步骤如下所示!

100ask am335x SD p 001.png 100ask am335x SD p 002.png 100ask am335x SD p 003.png
(1)选中需要烧写的SD卡设备,点击文件图标选择系统镜像文件,最后点击写入按钮开始烧写 (2)此时弹出烧写对话框,点击Yes按钮,继续烧写, 等待任务进度执行到100%) 烧写成功后,弹出写入成功,此时点击OK