谷动谷力

 找回密码
 立即注册
查看: 6558|回复: 4
打印 上一主题 下一主题
收起左侧

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

[复制链接]
跳转到指定楼层
楼主
发表于 2022-5-6 23:11:03 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
Uboot 命令TFTP 下载RT-Smart系统镜像并烧写到emmc



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


准备

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

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

下载系统镜像
  1. => tftp emmc.img
  2. Using ethernet@02188000 device
  3. TFTP from server 192.168.0.26; our IP address is 192.168.0.100
  4. Filename 'emmc.img'.
  5. Load address: 0x80800000
  6. Loading: #################################################################
  7.          #################################################################
  8.          .......
  9.          ####################
  10.          1.6 MiB/s
  11. done
  12. Bytes transferred = 69207040 (4200400 hex)
复制代码

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

写入emmmc

按上面计算写emmc命令为mmc write 0x80800000 0 21002
  1. => mmc write 0x80800000 0 21002

  2. MMC write: dev # 1, block # 0, count 135170 ... 135170 blocks written: OK
复制代码

注:从内存地址0x80800000开始 写到emmc0blk开始写 135170(x21002) blks(块) 



 这时看uboot环境还是之前的,这内存的,boo可以直接启动

设置uboot环境变量并保存:
第二次不了,环境变量,是新系统镜像的,所以要重新设置一下
  1. setenv bootcmd "fatload mmc 1:1 0x80001000 /kernel/rtthread.bin; dcache flush; go 0x80001000"
  2. saveenv
复制代码


RT-Smart系统命令:
  1. boot
复制代码


执行结果:
  1. => setenv bootcmd "fatload mmc 1:1 0x80001000 /kernel/rtthread.bin; dcache flush; go 0x80001000"
  2. => saveenv
  3. Saving Environment to MMC...
  4. Writing to MMC(1)... done
  5. => boot
  6. reading /kernel/rtthread.bin
  7. 1182208 bytes read in 52 ms (21.7 MiB/s)
  8. ## Starting application at 0x80001000 ...

  9. \ | /
  10. - RT -     Thread Smart Operating System
  11. / | \     5.0.0 build Dec 23 2021
  12. 2006 - 2020 Copyright by rt-thread team
  13. lwIP-2.1.2 initialized!
  14. [15] E/drv.enet: emac device init success

  15. [20] I/I2C: I2C bus [i2c3] registered
  16. [24] I/I2C: I2C bus [i2c4] registered
  17. [83] E/drv.enet:
  18. PHY Link down, please check the cable connection and link partner setting.

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

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

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

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

  39. [5692] I/mcf.link: MCF link port(3) register successfully.
  40. msh />[5722] I/mcf.trans: MCF(V0.1.0) initialized successfully.
  41. [5722] I/urpc: uRPC(V0.1.0) initialize successfully.
  42. [5722] I/mcf.trans: MCF protocol started successfully.
复制代码



内核成功启动,试试命令
  1. msh />
  2. msh />ls
  3. Directory /:
  4. kernel              <DIR>
  5. root                <DIR>
  6. sd                  <DIR>
  7. msh />
  8. RT-Thread shell commands:
  9. reboot           - reboot system
  10. cpu_usage        - display cpu usage
  11. dbg              - dbg
  12. memcheck         - check memory data
  13. memtrace         - dump memory trace information
  14. gic_dump         - show gic status
  15. list_page        - show page info
  16. list_fd          - list file descriptor
  17. lsof             - list open files
  18. mount            - mount<device><mountpoint><fstype>
  19. unmount          - unmount the mountpoint
  20. hello            - say hello world
  21. clear            - clear the terminal screen
  22. version          - show RT-Thread version information
  23. list_thread      - list thread
  24. list_sem         - list semaphore in system
  25. list_event       - list event in system
  26. list_mutex       - list mutex in system
  27. list_mailbox     - list mail box in system
  28. list_msgqueue    - list message queue in system
  29. list_memheap     - list memory heap in system
  30. list_mempool     - list memory pool in system
  31. list_timer       - list timer in system
  32. list_device      - list device in system
  33. list             - list all symbol in system
  34. help             - RT-Thread shell help.
  35. ps               - List threads in the system.
  36. free             - Show the memory usage in the system.
  37. ls               - List information about the FILEs.
  38. cp               - Copy SOURCE to DEST.
  39. mv               - Rename SOURCE to DEST.
  40. cat              - Concatenate FILE(s)
  41. rm               - Remove(unlink) the FILE(s).
  42. cd               - Change the shell working directory.
  43. pwd              - Print the name of the current working directory.
  44. mkdir            - Create the DIRECTORY.
  45. mkfs             - format disk with file system
  46. df               - disk free
  47. echo             - echo string to file
  48. set              - set or show environment variable
  49. list_channel     - list IPC channel information
  50. list_process     - list process
  51. kill             - send a signal to a process
  52. killall          - kill processes by name
  53. list_shm         - show share memory info
  54. sys_log          - sys_log 1(enable)/0(disable)
  55. ifconfig         - list the information of all network interfaces
  56. ping             - ping network host
  57. dns              - list and set the information of dns
  58. netstat          - list the information of TCP / IP
  59. pwm_enable       - pwm_enable pwm1 1
  60. pwm_disable      - pwm_disable pwm1 1
  61. pwm_set          - pwm_set pwm1 1 100 50
  62. date             - get date and time or set [year month day hour min sec]
  63. wifi             - wifi command.

  64. msh />
复制代码

nice成功了

0?wx_fmt=png.jpg (54.72 KB, 下载次数: 63)

0?wx_fmt=png.jpg
回复

使用道具 举报

沙发
 楼主| 发表于 2022-5-10 21:33:48 | 只看该作者
设置uboot启动延时
  1. setenv bootdelay 0
复制代码
回复 支持 反对

使用道具 举报

板凳
发表于 2022-5-12 21:16:09 | 只看该作者
本帖最后由 fannifu 于 2022-5-12 23:45 编辑

dhcp 下截 emmc.img 烧录
  1. dhcp 0x80800000 192.168.0.38:emmc.img
复制代码
回复 支持 反对

使用道具 举报

地板
发表于 2022-5-12 23:46:59 | 只看该作者
烧录
  1. mmc write 0x80800000 0 41AA
复制代码
回复 支持 反对

使用道具 举报

5#
发表于 2022-5-12 23:58:47 | 只看该作者
烧写uboot
  1. mmc write 0x80800000 1 3fe
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-4-26 11:11 , Processed in 0.090512 second(s), 48 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

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