通过Uboot TFTP启动rt-smart内核

描述

Windows下通过 Uboot  TFTP 方式下载和启动rt-smart 内核

i.MX6ULL 系列处理器启动方式多样,启动时会首先执行芯片内部 Boot ROM 中的程序。Boot ROM 会根据 BOOT_MODE 寄存器、eFUSEs、配置管脚等状态来决定启动模式以及启动设备。故在启动前,用户可根据自己需要配置 ART-Pi Smart 开发板的启动方式。
目前,ART-Pi Smart 开发板有以下两种启动方式:
 

  • eMMC 模式(默认启动模式):ART-Pi Smart 上电时,默认从 eMMC 启动,自动运行 U-Boot
  • USB 模式:选择从 USB  启动,通过 USB 接口(上方的 USB-TypeC OTG 接口),串行下载固件
    操作方法:开发板上电之后,先按下 "BOOT 启动按键" 不松开,然后,再按下 “RST 复位键”,即可切换到 USB 固件下载模式。
     

我选择通过 Uboot  TFTP 方式下载和启动rt-smart 内核

  • 首先下载并安装 Tftpd64 工具 (查看附件有安装包)
  • 在测试电脑上,提前设置好 TFTP 服务器,并配置目录定位到 rtthread.bin 文件所在的目录
     
  • 将 ART-Pi Smart 开发板通过有线网口和测试电脑处于同一个局域网(例,将开发板和测试电脑通过网线连接到同一台路由器或交换机)
    ⚠️将网线插到 ART-Pi Smart 开发板的网口,请检查网口上两个 LED 灯(绿色和黄色)是否亮起。
  • 将 USB-TypeC(下面的)连接到电脑给开发板上电,上电时将默认从 eMMC 启动,自动运行 U-Boot
  • 在测试电脑上,打开串口调试终端:115200 波特率、8 位数据位、1 位停止位、无奇偶校验、无流控,启动终端
  • 一般插上串口线,还没那么启动终端,uboot就启动完了,重启一下 输入reboot命令 或按下 ART-Pi Smart 开发板上的 “ RST 复位键” ,让开发板复位并进入到 “uboot 启动” 倒计时
    1.  

 


 

  • 在进入 “uboot 启动” 倒计时结束之前,按下键盘任意键,进入到手动模式
     
U-Boot 2017.03-g002b758ac9-dirty (Nov 24 2021 - 20:08:02 +0800)

CPU:   Freescale i.MX6ULL rev1.1 696 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 39C
Reset cause: WDOG
Model: Freescale i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT7016 (1024x600)
Video: 1024x600x24
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device
Net:   eth1: ethernet@020b4000, eth0: ethernet@02188000 [PRIME]
Normal Boot
Hit any key to stop autoboot:  0 (#在进入 “uboot 启动” 倒计时结束之前,按下键盘任意键,进入到手动模式)
=>
  • 这样已经进入u-boot命令模式
    如果没有进入到手动模式,则开发板会自动进入到 i.MX6ULL 核心板自带的嵌入式 rt-smart 系统。
  • 测试是否连通电脑
     
=> ping 192.168.0.26
ethernet@02188000 Waiting for PHY auto negotiation to complete.... done
*** ERROR: `ipaddr' not set
ping failed; host 192.168.0.26 is not alive
  • uboot没有DHCP client 不能自动获取IP,用ipaddr命令,按提示手动IP
  • 设置开发板ip及TFTP服务器IP

     
=> setenv ipaddr 192.168.0.100
=> setenv serverip 192.168.0.26
=> saveenv
  • 再次测试是否连通电脑
     
=> ping 192.168.0.26
Using ethernet@02188000 device
host 192.168.0.26 is alive
  • 这回与电脑网络通了
  • 测试下载 rtthread.bin
     
=> dhcp 0x80001000 192.168.0.26:rtthread.bin;dcache flush;go 0x80001000

BOOTP broadcast 1

BOOTP broadcast 2

DHCP client bound to address 192.168.0.69 (520 ms)

Using ethernet@02188000 device

TFTP from server 192.168.0.26; our IP address is 192.168.0.69

Filename 'rtthread.bin'.

Load address: 0x80001000

Loading: #################################################################

#################################################################

#################################################################

###################

1.4 MiB/s

done

Bytes transferred = 1095360 (10b6c0 hex)

## Starting application at 0x80001000 ...


\ | /

- RT -     Thread Smart Operating System

/ | \     5.0.0 build May  1 2022

2006 - 2020 Copyright by rt-thread team

lwIP-2.1.2 initialized!

[15] E/drv.enet: emac device init success

[20] I/I2C: I2C bus [i2c3] registered

[24] I/I2C: I2C bus [i2c4] registered

[73] I/SDIO: SD card capacity 7565312 KB.

found part[0], begin: 4194304, size: 7.216GB

[88] E/drv.enet: PHY Link down, please check the cable connection and link partner setting.

[138] I/SDIO: emmc card capacity 3817472 KB.

found part[0], begin: 2098176, size: 500.0MB

found part[1], begin: 526386176, size: 1.0GB

found part[2], begin: 1600128000, size: 10.0MB

found part[3], begin: 1610613760, size: [161] I/touch: rt_touch init success

[165] I/gt911: touch device gt911 init success

[171] I/sal.skt: Socket Abstraction Layer initialize success.

200.0MB

emmc file system initialization done!

sd0 file system initialization done!

open em failed!

hello rt-smart

msh />[3390] W/app.filesystem: sd card mount to '/mnt' failed!

[5130] D/drv.enet: enet1 link up
  • 下载成功,我的网络设置是正确的

输入命令,将 rt-smart 内核固件文件 rtthread.bin,通过网络加载至内存中运行

命令格式:dhcp  TFTP 服务器 IP(即,测试电脑 IP 地址):固件文件(xx.bin文件);dcache flush;go 固件入口地址

=> dhcp 0x80001000 192.168.0.26:rtthread.bin;dcache flush;go 0x80001000

BOOTP broadcast 1

BOOTP broadcast 2

DHCP client bound to address 192.168.0.69 (520 ms)

Using ethernet@02188000 device

TFTP from server 192.168.0.26; our IP address is 192.168.0.69

Filename 'rtthread.bin'.

Load address: 0x80001000

Loading: #################################################################

#################################################################

#################################################################

###################

1.4 MiB/s

done

Bytes transferred = 1095360 (10b6c0 hex)

## Starting application at 0x80001000 ...


\ | /

- RT -     Thread Smart Operating System

/ | \     5.0.0 build May  1 2022

2006 - 2020 Copyright by rt-thread team

lwIP-2.1.2 initialized!

[15] E/drv.enet: emac device init success

[20] I/I2C: I2C bus [i2c3] registered

[24] I/I2C: I2C bus [i2c4] registered

[73] I/SDIO: SD card capacity 7565312 KB.

found part[0], begin: 4194304, size: 7.216GB

[88] E/drv.enet: PHY Link down, please check the cable connection and link partner setting.

[138] I/SDIO: emmc card capacity 3817472 KB.

found part[0], begin: 2098176, size: 500.0MB

found part[1], begin: 526386176, size: 1.0GB

found part[2], begin: 1600128000, size: 10.0MB

found part[3], begin: 1610613760, size: [161] I/touch: rt_touch init success

[165] I/gt911: touch device gt911 init success

[171] I/sal.skt: Socket Abstraction Layer initialize success.

200.0MB

emmc file system initialization done!

sd0 file system initialization done!

open em failed!

hello rt-smart

msh />[3390] W/app.filesystem: sd card mount to '/mnt' failed!

[5130] D/drv.enet: enet1 link up

 

yes 成功了

i.MX6
打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分