找回密码
 立即注册

TQIMX6UL开发板手动烧写

发表于 2018-3-13 11:19:50 | 显示全部楼层 |阅读模式
本帖最后由 embedsky 于 2018-3-13 11:25 编辑

      如果无法从nand启动,在sd卡烧写前要先制作sd启动卡,具体方法可以参考在Linux平台下Windows平台下制作SD启动卡,如果nand可以启动可以直接从nand启动。

      光盘的烧写镜像在:TQIMX6UL_COREB_CD/出厂烧录镜像合集/Linux 镜像/tqimx6ul_v1.0;烧写镜像的名称可以在uboot 中设置的。如未设置将使用以下默认名称。

镜像内容
默认镜像名称
Bootloader镜像
u-boot.imx
内核镜像
zImage
Dtb镜像
tq-imx6ul.dtb
文件系镜像
rootfs.ubifs

1. 准备一张tf卡,将第一个分区格式化成fat格式。

2. 将烧写的镜像复制tf卡里的第一个分区里(vfat格式)。

  1. $ ls /media/qingleqq/DF15-3F7C/
  2. $ cp u-boot.imx zImage tq-imx6ul.dtb rootfs.ubifs /media/qingleqq/DF15-3F7C/.
  3. $ ls /media/qingleqq/DF15-3F7C/
  4. $ ls /media/qingleqq/DF15-3F7C/*
  5. tq-imx6ul.dtb rootfs.ubifs u-boot.imx zImage
复制代码

/media/qingleqq/DF15-3F7C/为笔者sd卡挂载目录,只作参考,以实际为准。


烧写

(1) 进入下载菜单

1. 如不能从nand 启动,将拔码打到sd 卡启动。插上已经做好的tf 启动卡。否则拔码打到 nand 启动。

2. 接上串口,上电;在以下倒数完成之前按任意键。

  1. ......
  2. Normal Boot
  3. Hit any key to stop autoboot: 1 #这里是1 秒
  4. ......
复制代码

按任意键中断自动启动,进入命令行菜单

  1. Out: serial
  2. Err: serial
  3. Net: FEC0
  4. Normal Boot
  5. Hit any key to stop autoboot: 0
  6. ##### TQ-IMX6UL U-boot MENU #####
  7. [SDCARD MODE]
  8. ###################################
  9. [1] Download u-boot.bin to Nand Flash
  10. [2] Download Logo image(logo.bin) to Nand Flash
  11. [3] Download Linux Kernel (zImage.bin) to Nand Flash
  12. [4] Download Device tree blob(*.dtb)
  13. [5] Download UBIFS image (root.ubifs) to Nand Flash
  14. [6] Download YAFFS image (root.yaffs2) to Nand Flash
  15. [7] Download Program to SDRAM and Run it
  16. [8] Boot the system
  17. [9] Format the Nand Flash
  18. [0] Set the boot parameters
  19. [n] Enter TFTP download mode menu
  20. [r] Restart u-boot
  21. [t] Test kernel Image (zImage)
  22. [q] Return console
  23. [x] read uboot to sdcard
  24. Please press a key to continue :
复制代码

接下来是烧写对应的镜像。镜像的烧写顺序可随意,要烧写什么镜像也可以安实际需要来决定。


(2)u-boot烧写

按1烧写uboot 镜像:


  1. [q] Return console
  2. [x] read uboot to sdcard
  3. Please press a key to continue :1
  4. reading u-boot.imx
  5. 613376 bytes read in 66 ms (8.9 MiB/s)
  6. nand erase.part u-boot;
  7. NAND erase.part: device 0 offset 0x0, size 0x400000
  8. Erasing at 0x3e0000 -- 100% complete.
  9. OK
  10. filesize = 95c00
  11. nand write.e 807ffc00 0x100000 96000
  12. NAND write: device 0 offset 0x100000, size 0x96000
  13. 614400 bytes written: OK
  14. ##### TQ-IMX6UL U-boot MENU #####
  15. [SDCARD MODE]
  16. ###################################
复制代码

(3)Logo烧写

  1. ##### TQ-IMX6UL U-boot MENU #####
  2. [SDCARD MODE]
  3. ###################################
  4. [1] Download u-boot.bin to Nand Flash
  5. [2] Download Logo image(logo.bin) to Nand Flash
  6. [3] Download Linux Kernel (zImage.bin) to Nand Flash
  7. [4] Download Device tree blob(*.dtb)
  8. ....
  9. [q] Return console
  10. [x] read uboot to sdcard
  11. Please press a key to continue :2
  12. reading logo.bmp
  13. 385076 bytes read in 49 ms (7.5 MiB/s)
  14. NAND erase.part: device 0 offset 0x600000, size 0x400000
  15. Erasing at 0x9e0000 -- 100% complete.
  16. OK
  17. NAND write: device 0 offset 0x600000, size 0x5e034
  18. 385076 bytes written: OK
  19. ##### TQ-IMX6UL U-boot MENU #####
  20. [SDCARD MODE]
  21. ###################################
  22. [1] Download u-boot.bin to Nand Flash
复制代码

(4)内核烧写

按3烧写内核

  1. ##### TQ-IMX6UL U-boot MENU #####
  2. [SDCARD MODE]
  3. ###################################
  4. [1] Download u-boot.bin to Nand Flash
  5. [2] Download Logo image(logo.bin) to Nand Flash
  6. [3] Download Linux Kernel (zImage.bin) to Nand Flash
  7. [4] Download Device tree blob(*.dtb)
  8. ......
  9. [x] read uboot to sdcard
  10. Please press a key to continue :3
  11. reading zImage
  12. 6049496 bytes read in 310 ms (18.6 MiB/s)
  13. NAND erase.part: device 0 offset 0xa00000, size 0xa00000
  14. Erasing at 0x13e0000 -- 100% complete.
  15. OK
  16. NAND write: device 0 offset 0xa00000, size 0x5c4ed8
  17. 6049496 bytes written: OK
  18. ##### TQ-IMX6UL U-boot MENU #####
  19. [SDCARD MODE]
  20. ###################################
复制代码

(5) dtb 烧写

按4烧写dtb文件

  1. ##### TQ-IMX6UL U-boot MENU #####
  2. [SDCARD MODE]
  3. ###################################
  4. [1] Download u-boot.bin to Nand Flash
  5. [2] Download Logo image(logo.bin) to Nand Flash
  6. [3] Download Linux Kernel (zImage.bin) to Nand Flash
  7. [4] Download Device tree blob(*.dtb)
  8. ......
  9. [x] read uboot to sdcard
  10. Please press a key to continue :4
  11. NAND erase.part: device 0 offset 0x1400000, size 0x200000
  12. Erasing at 0x15e0000 -- 100% complete.
  13. OK
  14. reading tq-imx6ul.dtb
  15. 36834 bytes read in 20 ms (1.8 MiB/s)
  16. NAND write: device 0 offset 0x1400000, size 0x8fe2
  17. 36834 bytes written: OK
  18. ##### TQ-IMX6UL U-boot MENU #####
  19. [SDCARD MODE]
  20. ###################################
复制代码

(6)文件系统烧写

按5烧写ubi文件系统,当前只支持ubi文件系统。

  1. [t] Test kernel Image (zImage)
  2. [q] Return console
  3. [x] read uboot to sdcard
  4. Please press a key to continue :5
  5. reading rootfs.ubifs
  6. 35680256 bytes read in 1747 ms (19.5 MiB/s)
  7. NAND erase.part: device 0 offset 0x1600000, size 0xea00000
  8. Erasing at 0xffe0000 -- 100% complete.
  9. OK
  10. ubi0: attaching mtd1
  11. ubi0: scanning is finished
  12. ubi0: empty MTD device detected
  13. ubi0: attached mtd1 (name "mtd=5", size 234 MiB)
  14. ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
  15. ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
  16. ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
  17. ubi0: good PEBs: 1872, bad PEBs: 0, corrupted PEBs: 0
  18. ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
  19. ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number:
  20. 0
  21. ubi0: available PEBs: 1828, total reserved PEBs: 44, PEBs reserved for bad PEB
  22. handling: 40
  23. No size specified -> Using max size (232112128)
  24. Creating dynamic volume rootfs of size 232112128
  25. 35680256 bytes written to volume rootfs
  26. ##### TQ-IMX6UL U-boot MENU #####
  27. [SDCARD MODE]
  28. ###################################
复制代码

到此各部分的烧写已经完成。


(7) 启动测试

按8启动系统,测试是否烧写成功:

  1. [7] Download Program to SDRAM and Run it
  2. [8] Boot the system
  3. [9] Format the Nand Flash
  4. [0] Set the boot parameters
  5. [n] Enter TFTP download mode menu
  6. [r] Restart u-boot
  7. [t] Test kernel Image (zImage)
  8. [q] Return console
  9. [x] read uboot to sdcard
  10. Please press a key to continue :8
  11. use nandboot
  12. NAND read: device 0 offset 0xa00000, size 0xa00000
  13. 10485760 bytes read: OK
  14. NAND read: device 0 offset 0x1400000, size 0x200000
  15. 2097152 bytes read: OK
  16. Kernel image @ 0x80800000 [ 0x000000 - 0x5c4ed8 ]
  17. ## Flattened Device Tree blob at 83000000
  18. Booting using the fdt blob at 0x83000000
  19. Using Device Tree in place at 83000000, end 8300bfe1
  20. Modify /soc/aips-bus@02000000/bee@02044000:status disabled
  21. ft_system_setup for mx6
  22. Starting kernel ...
  23. Booting Linux on physical CPU 0x0
  24. Linux version 4.1.15-gcb8ab66-dirty (qingleqq@z-work) (gcc version 5.2.0 (GCC) )
  25. #262 SMP PREEMPT Fri Jan 6 13:33:47 CST 2017
  26. CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
  27. CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
  28. Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
  29. Reserved memory: failed to allocate memory for node 'linux,cma'
  30. Memory policy: Data cache writealloc
  31. .....
复制代码
http://www.embedsky.com/index.php?g=home&m=news&a=show&id=86
回复

使用道具 举报

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

本版积分规则

embedsky

版主

发私信

Qt开源社区——开源 共享 自由

微信扫一扫
查看精品教程!