【RT-Smart】Uboot 命令TFTP 下载RT-Smart系统镜像并烧写到emmc

Uboot 命令TFTP 下载RT-Smart系统镜像并烧写到emmc

上回说到Windows下通过 Uboot TFTP 方式下载和启动rt-smart 内核, 其实只是通过TFTP下载rt-smart 内核到内存,启动开发板,并不是下载到emmc(ROM),怎么烧写emmc呢? 下面讲解

准备

  • 设置TFTP服务
  • 设置开板板IP
  • 设置服务器TFTP

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

下载系统镜像

=> tftp emmc.img
Using ethernet@02188000 device
TFTP from server 192.168.0.26; our IP address is 192.168.0.100
Filename 'emmc.img'.
Load address: 0x80800000
Loading: #################################################################
         #################################################################
         .......
         ####################
         1.6 MiB/s
done
Bytes transferred = 69207040 (4200400 hex)

提示下载启始地址0x80800000,大小69207040Bytes /512Bytes/blk = 135170 转换为16进制 0x21002
写入emmmc

按上面计算写emmc命令为mmc write 0x80800000 0 21002

=> mmc write 0x80800000 0 21002

MMC write: dev # 1, block # 0, count 135170 ... 135170 blocks written: OK

注:从内存地址0x80800000开始 写到emmc0blk开始写 135170(x21002) blks(块) 
在这里插入图片描述

这时看uboot环境还是之前的,这内存的,boo可以直接启动
 
设置uboot环境变量并保存:

第二次不了,环境变量,是新系统镜像的,所以要重新设置一下

setenv bootcmd "fatload mmc 1:1 0x80001000 /kernel/rtthread.bin; dcache flush; go 0x80001000"
saveenv

RT-Smart系统命令:

boot

新环境变量启动

执行结果

=> setenv bootcmd "fatload mmc 1:1 0x80001000 /kernel/rtthread.bin; dcache flush; go 0x80001000"
=> saveenv
Saving Environment to MMC...
Writing to MMC(1)... done
=> boot
reading /kernel/rtthread.bin
1182208 bytes read in 52 ms (21.7 MiB/s)
 Starting application at 0x80001000 ...

\ | /
- RT -     Thread Smart Operating System
/ | \     5.0.0 build Dec 23 2021
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
[83] E/drv.enet:
PHY Link down, please check the cable connection and link partner setting.

[117] I/SDIO: emmc card capacity 3817472 KB.
found part[0], begin: 2098176, size: 128.0MB
found part[1], begin: 136315904, size: 128.0MB
[154] I/touch: rt_touch init success
[158] I/gt911: touch device gt911 init success
[163] I/sal.skt: Socket Abstraction Layer initialize success.
emmc file system initialization done!
Dir / sd0 mount failed!
[1634] E/[RW007]: The wifi Stage 1 status 0 0 0 1
[1641] I/WLAN.dev: wlan init success
[1646] I/WLAN.lwip: eth device init ok name:w0
[1646] I/WLAN.dev: wlan init success
[1656] I/WLAN.lwip: eth device init ok name:w1

rw007  sn: [rw00700000000fc584a2c4d43]
rw007 ver: [RW007_2.1.0-a7a0d089-57]

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

[5667] W/WLAN.mgnt: F:rt_wlan_connect L:1091 not find ap! ssid:rt-thread
hello rt-smart!
/sd/wifi.sh wi-fi configuration file not exist in sd card!
[5674] I/mcf.link.tcp: TCPServer Waiting for client on port 5555...

[5692] I/mcf.link: MCF link port(3) register successfully.
msh />[5722] I/mcf.trans: MCF(V0.1.0) initialized successfully.
[5722] I/urpc: uRPC(V0.1.0) initialize successfully.
[5722] I/mcf.trans: MCF protocol started successfully.

在这里插入图片描述

内核成功启动,试试命令,

msh />
msh />ls
Directory /:
kernel              <DIR>
root                <DIR>
sd                  <DIR>
msh />
RT-Thread shell commands:
reboot           - reboot system
cpu_usage        - display cpu usage
dbg              - dbg
memcheck         - check memory data
memtrace         - dump memory trace information
gic_dump         - show gic status
list_page        - show page info
list_fd          - list file descriptor
lsof             - list open files
mount            - mount<device><mountpoint><fstype>
unmount          - unmount the mountpoint
hello            - say hello world
clear            - clear the terminal screen
version          - show RT-Thread version information
list_thread      - list thread
list_sem         - list semaphore in system
list_event       - list event in system
list_mutex       - list mutex in system
list_mailbox     - list mail box in system
list_msgqueue    - list message queue in system
list_memheap     - list memory heap in system
list_mempool     - list memory pool in system
list_timer       - list timer in system
list_device      - list device in system
list             - list all symbol in system
help             - RT-Thread shell help.
ps               - List threads in the system.
free             - Show the memory usage in the system.
ls               - List information about the FILEs.
cp               - Copy SOURCE to DEST.
mv               - Rename SOURCE to DEST.
cat              - Concatenate FILE(s)
rm               - Remove(unlink) the FILE(s).
cd               - Change the shell working directory.
pwd              - Print the name of the current working directory.
mkdir            - Create the DIRECTORY.
mkfs             - format disk with file system
df               - disk free
echo             - echo string to file
set              - set or show environment variable
list_channel     - list IPC channel information
list_process     - list process
kill             - send a signal to a process
killall          - kill processes by name
list_shm         - show share memory info
sys_log          - sys_log 1(enable)/0(disable)
ifconfig         - list the information of all network interfaces
ping             - ping network host
dns              - list and set the information of dns
netstat          - list the information of TCP / IP
pwm_enable       - pwm_enable pwm1 1
pwm_disable      - pwm_disable pwm1 1
pwm_set          - pwm_set pwm1 1 100 50
date             - get date and time or set [year month day hour min sec]
wifi             - wifi command.

msh />

nice成功了

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值