Windows下通过 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 工具

首先下载并安装 Tftpd64 工具

设置 TFTP 服务器

在windowss电脑上,提前设置好 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 启动” 倒计时

msh />reboot 
[96355] E/NO_TAG: resetting ...

进入u-boot命令模式

如果没有进入到手动模式,则开发板会自动进入到 i.MX6ULL 核心板自带的嵌入式 rt-smart 系统。

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 启动” 倒计时结束之前,按下键盘任意键,进入到手动模式)

=>

在进入 “uboot 启动” 倒计时结束之前,按下键盘任意键,进入到手动模式

这样已经进入u-boot命令模式

测试是否连通电脑

uboot没有DHCP client 不能自动获取IP,用ipaddr命令,按提示手动IP

=> 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

设置开发板ip

=> setenv ipaddr 192.168.0.100

设置TFTP服务器ip

TFTP服务器就是我们的电脑

=> setenv ipaddr 192.168.0.100

保存设置

如果不保存,下次使用还要设置

=> saveenv

再次测试是否连通电脑

=> ping 192.168.0.26

Using ethernet@02188000 device

host 192.168.0.26 is alive

这回与电脑网络通了

测试下载 rtthread.bin

=> tftp rtthread.bin

Using ethernet@02188000 device

TFTP from server 192.168.0.26; our IP address is 192.168.0.100

Filename 'rtthread.bin'.

Load address: 0x80800000

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

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

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

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

         1.2 MiB/s

done

Bytes transferred = 1095360 (10b6c0 hex)

下载成功,我的网络设置是正确的

通过TFFTP启动 RT-smart 内核

输入命令,将 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!
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值