目录

一、硬件连接:

二、tftp服务器安装

简介:

目的:

安装:

使用:

三、NFS服务安装

安装:

目的:

使用方法:

四、启动时出现问题:


一、硬件连接:

三个设备ip都设置在一个网段192.168.1.x。

虚拟机桥接设置方式:编辑-虚拟网络编辑器。

问题1:uboot使用ping命令测试连接windows不通

可能原因:

没有设置有效ipaddr、ethaddr、clientip、gatewayip、serverip。

解决方法:

查看是否设置ip、mac、clientip地址。没有设置的则需要设置对应的环境变量

设置ip命令:setenv ipaddr 192.168.1.11 开发板ip

设置mac命令:一般不用设置。

设置clientip命令:setenv clientip 192.168.1.11 开发板ip

设置serverip命令:setenv clientip 192.168.1.10 虚拟机ip

二、tftp服务器安装

简介:

tftp是一种文件传输协议,基于UDP端口69,一般Linux主机作为服务端,嵌入式开发板作为客户端。

目的:

用来和虚拟机连接传输文件、下载内核文件等

安装:

安装tftp
sudo apt-get install tftp-hpa tftpd-hpa
创建tftp服务器文件夹,改权限
mkdir -p /home/用户名/tftpboot
chmod 777 /home/用户名/tftpboot

编辑配置文件
sudo vim /etc/default/tftpd-hpa

添加以下内容

TFTP_DIRECTORY="/home/用户名/tftpboot" 
TFTP_OPTIONS="-l -c -s"

安装完成。

sudo service tftpd-hpa restart 重启tftp服务。

使用:

当tftp客户端 访问时会直接访问设置的文件夹/home/用户名/tftpboot。

示例:uboot命令tftpboot:

在实践中用到的两条命令tftpboot 0x01f00000 rk3288-firefly.dtb; tftpboot 0x02000000 zImage;

把tftp服务器 /tftpboot目录中的内核文件zImage下载到目标板内存的0x02000000地址中, 设备树文件rk3288-firefly.dtb下载到0x01f00000。

三、NFS服务安装

安装:

sudo apt-get install nfs-kernel-server

sudo vim /etc/exports

/etc/exports 文件中添加以下内容用于指定nfs文件夹。

/home/用户名/nfs_rootfs    *(rw,nohide,insecure,no_subtree_check,async,no_root_squash) 

sudo service nfs-kernel-server restart 启动服务

目的:

开发板直接通过网络挂载 PC 机中的文件夹,一般用于挂载开发板的根文件系统。

使用方法:

uboot通过启动参数设置nfs信息。关于nfs部分,在内核文档里(Documentation/filesystems/nfs/nfsroot.txt)有详细说明

2.) Kernel command line-------------------
When the kernel has been loaded by a boot loader (see below) it needs to be told what root fs device to use. And in the case of nfsroot, where to find both the server and the name of the directory on the server to mount as root. This can be established using the following kernel command line parameters:
root=/dev/nfsThis is necessary to enable the pseudo-NFS-device. Note that it's not a real device but just a synonym to tell the kernel to use NFS instead of a real device.
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]If the `nfsroot' parameter is NOT given on the command line,the default "/tftpboot/%s" will be used.<server-ip>    Specifies the IP address of the NFS server.The default address is determined by the `ip' parameter(see below). This parameter allows the use of differentservers for IP autoconfiguration and NFS.<root-dir>    Name of the directory on the server to mount as root.If there is a "%s" token in the string, it will bereplaced by the ASCII-representation of the client'sIP address.<nfs-options>    Standard NFS options. All options are separated by commas. The following defaults are used: port        = as given by server portmap daemonrsize       = 4096wsize        = 4096timeo        = 7retrans     = 3acregmin    = 3acregmax    = 60acdirmin   = 30acdirmax   = 60flags      = hard, nointr, noposix, cto, ac
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>

示例:

setenv bootargs root=/dev/nfs nfsroot=192.168.1.130:/home/book/nfs_rootfs rw ip=192.168.1.11;

①root=/dev/nfs 固定用法,告诉内核通过nfs启动。

②nfsroot=192.168.1.130:/home/book/nfs_rootfs 指定nfs地址

③rw ip=192.168.1.11;   指定客户端即开发板ip地址

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

整条启动参数为:
=> setenv ipaddr 192.168.1.11; setenv serverip 192.168.1.130; tftpboot 0x01f00000 rk3288-firefly.dtb; tftpboot 0x02000000 zImage; setenv bootargs root=/dev/nfs nfsroot=192.168.1.130:/home/book/nfs_rootfs rw ip=192.168.1.11; bootz 0x02000000 - 0x01f00000

简述:通过tftp服务复制内核和设备树到内存,挂载nfs根文件系统,启动内核。

启动过程如下

DDR Version 1.06 20171020
In
Channel a: DDR3 400MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Channel b: DDR3 400MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Memory OK
Memory OK
OUT
Boot1 Release Time: Apr 11 2018 10:32:58, version: 2.36
ChipType = 0x8, 229
mmc2:cmd19,256
SdmmcInit=2 0
BootCapSize=2000
UserCapSize=7456MB
FwPartOffset=2000 , 2000
mmc0:cmd5,32
SdmmcInit=0 0
BootCapSize=0
UserCapSize=15193MB
FwPartOffset=2000 , 0
StorageInit ok = 47454
LOADER Check OK! 0x0, 105551
tag:TOS    error,addr:0x4000
hdr 032c77e4 + 0x0:0x6d903ceb,0x2e73666b,0x00746166,0x00010402,
TOS    Check OK! 0x8400000, 192918
Enter Trust OS
INF [0x0] TEE-CORE:init_primary_helper:377: Initializing (1.1.0-316-g7b4ec90 #59 Wed May 30 08:26:33 UTC 2018 arm)INF [0x0] TEE-CORE:init_primary_helper:378: Release version: 1.3INF [0x0] TEE-CORE:init_primary_helper:379: Next entry point address: 0x0INF [0x0] TEE-CORE:init_teecore:83: teecore inits doneU-Boot 2017.09 (Jul 13 2021 - 05:18:23 -0400)Model: Firefly-RK3288
DRAM:  2 GiB
Relocation Offset is: 7de63000
MMC:   dwmmc@ff0c0000: 1, dwmmc@ff0f0000: 0
*** Warning - bad CRC, using default environmentIn:    serial
Out:   serial
Err:   serial
Model: Firefly-RK3288
switch to partitions #0, OK
mmc1 is current device
do_rkimg_test found IDB in SDcard
Boot from SDcard
get part misc fail -1
Net:
Warning: ethernet@ff290000 (eth0) using random MAC address - b6:9e:5e:84:ac:1b
eth0: ethernet@ff290000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  0
=>
=> setenv ipaddr 192.168.1.11
=> setenv serverip 192.168.1.130; tftpboot 0x01f00000 rk3288-firefly.dtb; tftpboot 0x02000000 zImage; setenv bootargs root=/dev/nfs nfsroot=192.168.1.130:/home/book/nfs_rootfs rw ip=192.168.1.11; bootz 0x02000000 - 0x01f00000
ethernet@ff290000 Waiting for PHY auto negotiation to complete.... done
Speed: 100, full duplex
Using ethernet@ff290000 device
TFTP from server 192.168.1.130; our IP address is 192.168.1.11
Filename 'rk3288-firefly.dtb'.
Load address: 0x1f00000
Loading: ######468.8 KiB/s
done
Bytes transferred = 74546 (12332 hex)
Speed: 100, full duplex
Using ethernet@ff290000 device
TFTP from server 192.168.1.130; our IP address is 192.168.1.11
Filename 'zImage'.
Load address: 0x2000000
Loading: ##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################2.2 MiB/s
done
Bytes transferred = 8009904 (7a38b0 hex)
## Flattened Device Tree blob at 01f00000Booting using the fdt blob at 0x1f00000Loading Device Tree to 0ffea000, end 0ffff331 ... OK
Adding bank: start=0x00000000, size=0x08400000
Adding bank: start=0x09200000, size=0x76e00000Starting kernel ...[    0.000000] Booting Linux on physical CPU 0x500
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu

四、启动时出现问题:

NFS挂载失败:

提示end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)

分析:

sudo    mount    -t    nfs    127.0.0.1:/home/book/nfs_rootfs        /mnt 挂载自己能成功。

解决:

重新配置内核,勾选支持nfs,重新编译。参考文章

1、配置网络部分,主要是使能CONFIG_IP_PNP以在2中能够看到Root file system on NFS选项

Networking support

Networking options

TCP/IP networking

[*]IP: kernel level autoconfiguration

[*] IP: DHCP support

[*] IP: BOOTP support

2、配置开启nfs服务

File systems  --->

Network File Systems  --->

<*> NFS client support

[*] NFS client support for NFS version 3

[*] NFS client support for the NFSv3 ACL protocol extension

[*] NFS client support for NFS version 4 (EXPERIMENTAL)

[*] NFS client support for NFSv4.1 (DEVELOPER ONLY)

[*] Root file system on NFS

更换重新配置的内核后通过nfs启动成功。

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

注:内容参考《Firefly-RK3288开发板高级用户使用手册V1.2》

rk3288实践:嵌入式Linux开发环境搭建相关推荐

  1. 嵌入式linux编译环境搭建,嵌入式Linux开发环境搭建

    整理下嵌入式Linux开发环境搭建过程笔记. 一.制作u-boot.bin文件: tar xjf u-boot-1.1.6.tar.bz2 cd u-boot-1.1.6 patch -p1 < ...

  2. 嵌入式linux开发环境搭建——VirtualBox虚拟机网络环境解析

    嵌入式linux开发环境搭建--VirtualBox虚拟机网络环境解析 本博文转自:Pandoras Box http://blog.csdn.net/yxc135/article/details/8 ...

  3. 嵌入式Linux开发环境搭建-4-嵌入式编程基础知识

    嵌入式Linux开发环境搭建-4-嵌入式编程基础知识 1.安装代码编辑器 2.交叉编译工作使用 1.安装代码编辑器 参考文档 ubuntu几款好用的代码编辑器_百度经验 安装sublime text ...

  4. 嵌入式linux开发环境搭建(VMware16.0.0+Ubuntu16.04.3_X64)

    目录 一.安装VMware 1.VMware介绍 2.安装VMware16.0.0 二.安装ubuntu16.04.3 LTS 1.Ubuntu介绍 2.下载安装包iso 3.安装 四.新安装Ubun ...

  5. 嵌入式Linux开发环境搭建-曹国辉-专题视频课程

    嵌入式Linux开发环境搭建-1199人已学习 课程介绍         系统讲解嵌入式Linux开发环境搭建方法,包括虚拟机安装,ubuntu安装,交叉编译器安装及配置,嵌入式QT开发环境的构建,u ...

  6. 嵌入式Linux开发环境搭建-(4)安装交叉编译工具链

    在ubuntu16.04.2中,安装交叉编译工具链 在ubuntu中进行嵌入式应用程序开发,安装交叉编译工具链是不可缺少的一个环节. PC操作系统:ubuntu16.04.2 LTS 开发板:天嵌科技 ...

  7. 嵌入式设备开发专题《tiny4412开发,嵌入式linux开发环境搭建》

    嵌入式linux开发基础: 1.系统组成: 嵌入式linux系统的组成包括三部分:bootloader程序.linux内核.根文件系统 bootloader程序:系统上电后首先要执行的程序,主要功能是 ...

  8. 嵌入式Linux开发环境搭建(二)

    资料来自朱有鹏老师的<嵌入式开发环境搭建> 5.配置tftp服务器 第 1 步:安装 tftp 安装 tftp 所需的软件.首先需要安装 tftp-hpa,tftpd-hpa,前者是客户端 ...

  9. 嵌入式linux配置qt,基于qt的嵌入式Linux开发环境搭建

    摘要:本文主要介绍在PC机上搭建基于QT的嵌入式开发环境,其中很多源文件都是开发板自带,需要相应资料的可以评论留下邮箱地址. 版本:交叉编译工具链:GCC 4.7.3  [gcc-linaro-arm ...

最新文章

  1. 《Android应用开发攻略》——1.3 从命令行创建 “Hello, World”应用程序
  2. JQuery变量数字相加的研究
  3. Android开发之引用三方库导致SO库冲突的解决办法
  4. android xml中设置水平虚线及竖直虚线
  5. C语言强化——学生管理系统
  6. 刷新存储器的容量单位是什么_SRAM的容量扩展
  7. 奇安信荣获中国电子2021年度科技进步奖一、二等奖
  8. Nginx Unit 与 LEMUR 新架构
  9. 《Python核心编程》第二版第407页第十三章练习 续六 -Python核心编程答案-自己做的-...
  10. Nginx配置与安装及发布项目
  11. L2TP的LAC自动拨号实验
  12. 手机号测性别 微信男女检测原理解析 技术分享
  13. Wireshark捕获过滤器
  14. 谈谈我的感受:VS Code和Code Runner
  15. MATLAB2018a解压文件损坏,教大家解压压缩包提示已损坏的解决方法
  16. Git Branching基础操作学习笔记
  17. try、catch、finally 用法总结
  18. openssl_sign() 语法+RSA公私钥加密解密,非对称加密算法详解
  19. FaceNet使用简介
  20. OpenNI UserGuide

热门文章

  1. 《软件工程》第二章 可行性研究 作业
  2. tomcat服务器各文件夹的作用
  3. 互联网的历史(1969-2009) 1
  4. android 启动桌面快捷方式,安卓桌面快捷方式传递启动参数
  5. 年报解读 | 中国农业银行开启零售转型,2018年信用卡发卡量突破一亿张
  6. python里的π怎么输入?
  7. ENScanGo主域名批量提取脚本
  8. 安卓系统一键root:z4root详细使用教程
  9. 苹果CEO库克:苹果不会效仿Facebook推出加密货币,货币权应该留在国家手中
  10. iOS组件化系列之RubyMine如何调试Cocoapods插件