ARM-LINUX基础
+ -

ftfp内存烧写kernel

2025-07-31 15 0

编译zImage

修改Makefile为交叉编译,如ARCH=arm CROSSS_COMPILE=arm-linux-gnueabihf-,然后配置、编译

make distclean
make imx_v7_mfg_defconfig 
make zImage v=1 -j16
make dtbs //编译设备树

tftp服务器安装

sudo apt-get install xinetd

确保 /etc/xinetd.conf

zzmt@zzmt:~/Desktop/nfs$ cat /etc/xinetd.conf
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info

}

includedir /etc/xinetd.d

安装tftp

sudo apt-get install tftp-hpa tftpd-hpa
sudo apt-get install xinetd
chmod 777 /home/zzmt/Desktop/nfs

修改/etc/default/tftpd-hpa

zzmt@zzmt:~/Desktop/nfs$ cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/zzmt/Desktop/nfs"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"

配置

新建/etc/xinetd.d/tftp

zzmt@zzmt:~/Desktop/nfs$ cat /etc/xinetd.d/tftp
servicetftp
            {
                    socket_type = dgram
                    wait = yes
                    disable = no
                    user = root
                    protocol = udp
                    server = /usr/sbin/in.tftpd
                    server_args = -s /home/zzmt/Desktop/nfs -c
                    #log_on_success += PID HOST DURATION
                    #log_on_failure += HOST
                    per_source = 11
                    cps =100 2
                    flags =IPv4
            }

重启服务

sudo service tftpd-hpa restart

linux开发板下测试:

root@ATK-IMX6U:~# tftp -g -r helloworld.c 192.168.0.3
root@ATK-IMX6U:~# ls
driver  get  helloworld.c  shell

192.168.0.3:主机服务器

烧写

tftp 80800000 zImage
tftp 83000000 mx6ull-alientek-emmc.dtb
bootz 80800000 – 83000000

测试

=> tftp 80800000 zImage
Using FEC1 device
TFTP from server 192.168.0.3; our IP address is 192.168.0.66
Filename 'zImage'.
Load address: 0x80800000
Loading: #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #######################################################
     1.4 MiB/s
done
Bytes transferred = 5577664 (551bc0 hex)

完整测试

tftp测试

setenv bootcmd 'tftp 80800000 zImage;tftp 83000000 imx6ull-alientek-emmc.dtb; bootz 80800000 - 83000000;'
setenv bootargs console= ttymxc0, 115200 root=/dev/mmcblk1p2 rootwait rw
savenv

挂nfs根文件系统

setenv bootargs 'console=ttymxc0,115200 root=/dev/nfs \
nfsroot=192.168.0.3:/home/zzmt/Desktop/nfs/testfs,proto=tcp rw \
ip=192.168.0.66:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off '

测除uboot参数

env default -a
savenv

0 篇笔记 写笔记

关注公众号
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!