当前位置:网站首页>Implementation of Ti am335x industrial control module network and file system nfs
Implementation of Ti am335x industrial control module network and file system nfs
2022-07-26 02:02:00 【szembed】
The verification of this content uses yingpengfei embedded CoM-335x Core module and Evaluation Board EAC-335X, The brief introduction is as follows :



1 summary
Software debugging is a necessary stage in the product development life cycle , Include kernel 、 The root file system 、 Application software, etc . The usual practice is to burn first BootLoader、 kernel 、 The root file system , Re debug application software . During the debugging phase, you may need to burn the kernel frequently 、 Root file or download application , This will take a lot of time . Download the kernel and mount the root file system through the network , It can solve the problem of frequent burning .
This manual , It mainly introduces how to pass TFTP Download the kernel and mount NFS The root file system .
Operating environment :
- platform :EVB-335x
- operating system :Ubuntu 16.04server 64-bit ( Kernel version 4.4.0-131-generic)
- nfs:nfs-kernel-server_1.2.8-9ubuntu12_amd64
2 The software requirements
NFS The agreement includes version 2、version 3、 version 4 Three versions ( Hereinafter referred to as NFSv2、NFSv3、NFSv4), It should be implemented when the motherboard starts the kernel NFS Mount the file system , Must ensure u-boot、kernel And NFS server The versions are consistent .
2.1 u-boot NFS Instructions
Support NFS Instructions , To configure u-boot To be defined :
#define CONFIG_CMD_NFS //u-boot The default support NFS, stay u-boot Source code include/config_cmd_default.h View in
#define CONFIG_NFSBOOTCOMMAND // You can configure files at the board level include/configs/com335x.h In the definition of ( It's not necessary , This configuration is used for ease of understanding , Because it knows its meaning by seeing its name ). If this item is defined ,u-boot In the environment variable “nfsboot=” Parameters , by nfsboot Assignment as NFS Configuration of .
explain :
1、U-boot 2014.04(COM-335x Use this version ) Support NFSv2, stay u-boot Source code net/nfs.c View in , Such as code list 2-1 Shown ( In red );
Code list 2-1
static void
rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen)
{
Of ubuntu 16.04 host , Because the default does not support NFSv2, So set compatibility , stay “2.3 NFS server matters needing attention ” Described in the .
3、 The new version of the u-boot Supported by NFS Higher protocol version , for example u-boot 2018.01 The default support NFSv2, If the host does not support NFSv2, Then use NFSv3.
4、 Kernel version matching problem , see “2.2 kernel To configure ”.
5、NFS The revision of the version is not simple “ Code list 2-1” Medium pkt.u.call.rpcvers = htonl(2); And pkt.u.call.vers = htonl(2); Value , It can be compatible with other versions NFS. Besides , The new version u-boot The workload of transplantation is heavy . therefore , Recommended in the NFS server End solve the problem of version compatibility .
2.2 kernel To configure
The kernel needs to support NFS Type root file system . Execute in the root directory of the kernel source code :
make ARCH=arm menuconfig
Choose in turn
File systems --->
[*] Network 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
[*] NFS client support for NFSv4.1 (EXPERIMENTAL)
[*] Root file system on NFS
Configuration is shown in figure 2-2 Shown .

explain : When chosen NFS client support , Namely support NFSv2.NFSv3、NFSv4、NFSv4.1 Optional , It depends on the actual situation .
Besides , Still need to choose kernel level autoconfiguration. Choose in turn :
[*] Networking support --->
--- Networking support
[*] IP: kernel level autoconfiguration
Pictured 2-3 Shown :

2.3 NFS server matters needing attention
build NFS server Please refer to Ubuntu Official website .
COM-335x Of U-boot Supported by NFS v2 edition , and Ubuntu 16.04 Support NFS v4 edition . Due to version incompatibility , When mounting NFS File system , Appear as shown in figure 2-4 The error shown .

modify “/etc/default/nfs-kernel-server” file , Make it compatible with NFS v2 edition , Add the following statement at the end of the file , Pictured 2-5 Shown .
RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"

To configure NFS server, Use the document editing tool to open /etc/exports , Set directories respectively 、 visit IP、 Options ( Usually set permissions, etc ), Pictured 2-6 Shown .

explain :
/home/daniel/rootfs Appoint NFS File system load directory ;
* Set access IP,* On behalf of all IP, It can also be a host or a IP paragraph ( for example 192.168.x.x);
(rw,sync,no_root_squash) Set permissions and other options , Set according to the demand .
2.4 other
TFTP For downloading kernel images , Set up in NFS server On the same host , Please refer to Ubuntu Official website .
3 Implementation process
With NVM Storage u-boot Of COM-335x For example , Brief introduction NFS The implementation process of file mounting .
1、 Prepare the kernel and root file system :
Put the kernel (uImage) Save to TFTP To configure (/etc/default/tftpd-hpa file ) Specified directory , Pictured 3-1 Shown ,TFTP_DIRECTORY The value is TFTP The directory of the server .

Unzip the root file system to /etc/exports The directory specified , Pictured 3-2 Shown .

explain : Replace the kernel , Replace uImage File can ; The application is saved to the root file system .
2、 burn u-boot
erase Nand Flash, Will be used to start NFS Of MLO And u-boot.img Save to SD The root directory of the card , Power on and automatically burn u-boot. Burn complete , see u-boot Environment variables of (env) To configure , Pictured 3-3 Shown .

NFS Introduction to environment variable parameters , As shown in the table 3-1 Shown :
surface 3-1
serverip | NFS server IP( necessary ) |
ipaddr | a main board IP( necessary ) |
gatewayip | gateway ( It's not necessary , It is recommended to set ) |
netmask | Subnet mask ( necessary ) |
hostname | Host name ( It's not necessary ) |
netdev | Network devices ( It's not necessary ), for example eth0. |
rootpath | NFS Save directory of root file system ( necessary ) |
here , chart 3-3 The configuration in may not meet the requirements , for example rootpath、serverip etc. . Use according to the actual situation setenv Instruction configuration :
setenv rootpath /your/dirctory/rootfs
setenv serverip 192.168.1.x
saveenv ß---- Setup completed , use saveenv preservation , Unsaved settings are only valid once
After the setting is correct , Input boot or run bootcmd Start the system , Or power on again .
3、 see NFS
After system startup , see NFS Mounting of the root file system , And file system directory structure . Pictured 3-4 Shown :

The information in the figure is displayed normally , It means NFS Start up .
边栏推荐
- [C language brush leetcode] 1604. Warn people who use the same employee card more than or equal to three times within an hour (m)
- E. Split into two sets
- I.MX6UL核心模块使用连载-CAN、蜂鸣器测试 (十一)
- 1. Mx6ul core module serial use - touch screen calibration (IX)
- pdf. JS introduction
- The slow loading of the first entry page of vite local operation
- I.MX6UL核心模块使用连载-nand flash读写测试 (三)
- 一款可插拔的AM335X工控模块板载wifi模块
- How does Flink SQL configure to print the insert parameter log
- 1. Mx6ul core module serial Ethernet test (VII)
猜你喜欢

Video game quiz? I think it's useless. It's better to do these well!

mysql 事务隔离级别

SQL manual blind injection and error reporting injection

Protect syslog servers and devices

一款可插拔的AM335X工控模块板载wifi模块

1. Mx6ul core module uses serial can and buzzer test (XI)

DialogRPT-Dialog Ranking Pretrained Transformers

Advantages of composition API

Pt onnx ncnn conversion problem record (followed by yolov5 training)

PHP Alipay transfer to Alipay account
随机推荐
Arm assembly foundation of SOC
Software group verification
These practical security browser plug-ins improve your efficiency
Characteristics and determination of neuraminidase from Clostridium perfringens in Worthington
Guys, the flinksql datahub source table has a field timestamp 16 bits, which is written to ora
[in simple terms, play with FPGA learning 11 --- testbench writing skills 1]
[Verilog digital system design (Xia Yuwen) 3 ----- basic concepts of Verilog syntax 1]
还在用==0 null equal 判断空值吗,对isEmpty 和 isBlank有多少了解呢
1. Mx6ul core module use serial TF card read / write test (V)
达梦数据库表导入导出按钮灰色,导入不了dmp文件
Worthington nuclease and Micrococcus related research and determination scheme
JS add random pixel noise background to the page
Video game quiz? I think it's useless. It's better to do these well!
《穷爸爸与富爸爸》读后小结
Pt onnx ncnn conversion problem record (followed by yolov5 training)
Move bricks (greedy perturbation + 01 backpack)
大佬们, flinksql datahub源表,源表有字段 timestamp 16位, 写入Ora
Create a future and enjoy extraordinary | gbase Nantah General Motors unveiled opengauss Developer Day 2022
G. Count the trains (thought set + two points)
Proto conversion dart | project uses protobuf | fluent uses grpc