OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3924|回复: 3

uboot自动启动时tftp server 的IP地址如何修改?

[复制链接]

8

主题

29

帖子

0

精华

初级会员

Rank: 2

积分
57
金钱
57
注册时间
2020-3-26
在线时间
16 小时
发表于 2020-6-1 03:15:30 | 显示全部楼层 |阅读模式
3金钱
用什么方式修改uboot自动启动时tftp server 的IP地址?实际ip地址不是下面红色的(192.168.124.1),实际应该是(192.168.124.4)我在环境变量中都改成了
192.168.124.4
但是u-boot启动时还是去
192.168.124.1
)找文件

U-Boot 2016.03 (May 30 2020 - 15:35:43 +0800)
CPU:   Freescale i.MX6ULL rev1.1 69 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 56C
Reset cause: POR
Board: MX6ULL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Display: ATK-LCD-4.3-480x272 (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc0 is current device
Net:   FEC1
Normal Boot
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
switch to partitions #0, OK
mmc0 is current device
** No partition table - mmc 0 **
** No partition table - mmc 0 **
Booting from net ...
FEC1 Waiting for PHY auto negotiation to complete.... done
BOOTP broadcast 1
BOOTP broadcast 2
*** Unhandled DHCP Option in OFFER/ACK: 43
*** Unhandled DHCP Option in OFFER/ACK: 43
DHCP client bound to address 192.168.124.2 (842 ms)
Using FEC1 device
TFTP from server 192.168.124.1; our IP address is 192.168.124.2
Filename 'zImage'.
Load address: 0x80800000
Loading: T
Abort
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
*** Unhandled DHCP Option in OFFER/ACK: 43
*** Unhandled DHCP Option in OFFER/ACK: 43
DHCP client bound to address 192.168.124.2 (2186 ms)
Using FEC1 device
TFTP from server 192.168.124.1; our IP address is 192.168.124.2
Filename 'imx6ull-14x14-emmc-4.3-480x272-c.dtb'.
Load address: 0x83000000
Loading: *
Abort
Bad Linux ARM zImage magic!

以下是环境变量

=> print
baudrate=115200
board_name=EVK
board_rev=14X14
boot_fdt=try
bootargs=console=ttymxc0,115200 root=/dev/nfs ip=dhcp nfsroot=192.168.124.4:,v3,tcp
bootcmd=run findfdt;mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi
bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=1
bootfile=imx6ull-14x14-emmc-4.3-480x272-c.dtb
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc0
dnsip=192.168.124.4
ethact=FEC1
ethaddr=00:04:9F:04:dd:55
ethprime=FEC
fdt_addr=0x83000000
fdt_file=imx6ull-14x14-emmc-4.3-480x272-c.dtb
fdt_high=0xffffffff
fileaddr=83000000
filesize=97a7
findfdt=if test $fdt_file = undefined; then if test $board_name = EVK && test $board_rev = 9X9; then setenv fdt_file imx6ull-9x9-evk.dtb; fi; if test $board_name = EVK && test $board_rev = 14X14; then setenv fdt_file imx6ull-14x14-evk.dtb; fi; if test $fdt_file = undefined; then echo WARNING: Could not determine dtb to use; fi; fi;
gatewayip=192.168.124.4
get_cmd=dhcp
image=zImage
initrd_addr=0x83800000
initrd_high=0xffffffff
ip_dyn=yes
ipaddr=192.168.124.2
loadaddr=0x80800000
loadbootscript=fatload mmc ${mmcdev}{mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}{mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}{mmcpart} ${loadaddr} ${image}
logo_file=alientek.bmp
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused
mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=0
mmcpart=1
mmcroot=/dev/mmcblk0p2 rootwait rw
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}{nfsroot},v3,tcp
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
netmask=255.255.255.0
panel=ATK-LCD-4.3-480x272
script=boot.scr
serverip=192.168.124.4
splashimage=0x88000000
splashpos=m,m
Environment size: 2869/8188 bytes

最佳答案

查看完整内容[请看2#楼]

搞定了因为定义了ip_dyn=yes, 所以会去dhcp获取文件,把定义成ip_dyn=no,就从tftp获取了 => setenv ip_dyn no => saveenv Saving Environment to MMC... Writing to MMC(0)... done
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

8

主题

29

帖子

0

精华

初级会员

Rank: 2

积分
57
金钱
57
注册时间
2020-3-26
在线时间
16 小时
 楼主| 发表于 2020-6-1 03:15:31 | 显示全部楼层
搞定了因为定义了ip_dyn=yes, 所以会去dhcp获取文件,把定义成ip_dyn=no,就从tftp获取了

=> setenv ip_dyn no
=> saveenv
Saving Environment to MMC...
Writing to MMC(0)... done
回复

使用道具 举报

12

主题

56

帖子

0

精华

初级会员

Rank: 2

积分
178
金钱
178
注册时间
2020-3-11
在线时间
17 小时
发表于 2020-6-1 15:47:52 | 显示全部楼层
在u-boot的启动后,按下回车键,  使用printenv serverip 先看看你有没有设置好这个ip 如果没有设置,那就使用setenv  serverip 192.168.124.4 然后回车,并使用 saveenv保存 就可以了
回复

使用道具 举报

8

主题

29

帖子

0

精华

初级会员

Rank: 2

积分
57
金钱
57
注册时间
2020-3-26
在线时间
16 小时
 楼主| 发表于 2020-6-1 19:27:53 | 显示全部楼层
这个环境变量是有的,手工输入tftp命令默认也是192.168.124.1

=> printenv serverip
serverip=192.168.124.4

=> tftp zImage                       
Using FEC1 device
TFTP from server 192.168.124.1; our IP address is 192.168.124.2
Filename 'zImage'.
Load address: 0x80800000
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-25 12:38

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表