OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 727|回复: 3

[XILINX] 分步式编译无法进入linux,需要输入uboot指令。

[复制链接]

30

主题

71

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
254
金钱
254
注册时间
2020-10-19
在线时间
54 小时
发表于 2024-2-21 18:11:02 | 显示全部楼层 |阅读模式
情况描述:我采用的是2020.2系列的支持包和linux5.4.0版本的内核。我尝试了很多方法,但最终都会出现下述错误:
  1. 启动日志:
  2. U-Boot 2020.01 (Feb 18 2024 - 05:15:40 +0000)

  3. CPU:   Zynq 7z010
  4. Silicon: v3.1
  5. DRAM:  ECC disabled 512 MiB
  6. Flash: 0 Bytes
  7. NAND:  0 MiB
  8. MMC:   mmc@e0100000: 0
  9. Loading Environment from SPI Flash... SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
  10. OK
  11. In:    serial@e0001000
  12. Out:   serial@e0001000
  13. Err:   serial@e0001000
  14. Net:
  15. ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr -1, interface rgmii-id

  16. Warning: ethernet@e000b000 using MAC address from DT
  17. eth0: ethernet@e000b000
  18. Hit any key to stop autoboot:  0
  19. JTAG: Trying to boot script at 0x3000000
  20. ## Executing script at 03000000
  21. Wrong image format for "source" command
  22. JTAG: SCRIPT FAILED: continuing...
  23. switch to partitions #0, OK
  24. mmc0 is current device
  25. Scanning mmc 0:1...
  26. Found U-Boot script /boot.scr
  27. 2169 bytes read in 15 ms (140.6 KiB/s)
  28. ## Executing script at 03000000
  29. Wrong Image Format for bootm command
  30. ERROR: can't get kernel image!
  31. SCRIPT FAILED: continuing...
  32. MMC Device 1 not found
  33. no mmc device at slot 1
  34. SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
  35. device 0 offset 0x40000, size 0x1fc0000
  36. SF: 33292288 bytes [url=home.php?mod=space&uid=95564]@[/url] 0x40000 Read: OK
  37. QSPI: Trying to boot script at 0x3000000
  38. ## Executing script at 03000000
  39. Wrong image format for "source" command
  40. QSPI: SCRIPT FAILED: continuing...


  41. no devices available
  42. NAND: SCRIPT FAILED: continuing...
  43. NOR: Trying to boot script at 0x3000000
  44. ## Executing script at 03000000
  45. Wrong image format for "source" command
  46. NOR: SCRIPT FAILED: continuing...
  47. starting USB...
  48. Bus usb@e0002000: USB EHCI 1.00
  49. scanning bus usb@e0002000 for devices... 1 USB Device(s) found
  50.        scanning usb for storage devices... 0 Storage Device(s) found

  51. Device 0: unknown device

  52. Device 1: unknown device
  53. BOOTP broadcast 1
  54. DHCP client bound to address 192.168.1.78 (8 ms)
  55. *** ERROR: `serverip' not set
  56. Cannot autoload with TFTPGET
  57. missing environment variable: pxeuuid
  58. missing environment variable: bootfile
  59. Retrieving file: pxelinux.cfg/01-00-0a-35-00-1e-53
  60. *** ERROR: `serverip' not set
  61. missing environment variable: bootfile
  62. Retrieving file: pxelinux.cfg/C0A8014E
  63. *** ERROR: `serverip' not set
  64. missing environment variable: bootfile
  65. Retrieving file: pxelinux.cfg/C0A8014
  66. *** ERROR: `serverip' not set
  67. missing environment variable: bootfile
  68. Retrieving file: pxelinux.cfg/C0A801
  69. *** ERROR: `serverip' not set
  70. missing environment variable: bootfile
  71. Retrieving file: pxelinux.cfg/C0A80
  72. *** ERROR: `serverip' not set
  73. missing environment variable: bootfile
  74. Retrieving file: pxelinux.cfg/C0A8
  75. *** ERROR: `serverip' not set
  76. missing environment variable: bootfile
  77. Retrieving file: pxelinux.cfg/C0A
  78. *** ERROR: `serverip' not set
  79. missing environment variable: bootfile
  80. Retrieving file: pxelinux.cfg/C0
  81. *** ERROR: `serverip' not set
  82. missing environment variable: bootfile
  83. Retrieving file: pxelinux.cfg/C
  84. *** ERROR: `serverip' not set
  85. missing environment variable: bootfile
  86. Retrieving file: pxelinux.cfg/default-arm-zynq-zynq
  87. *** ERROR: `serverip' not set
  88. missing environment variable: bootfile
  89. Retrieving file: pxelinux.cfg/default-arm-zynq
  90. *** ERROR: `serverip' not set
  91. missing environment variable: bootfile
  92. Retrieving file: pxelinux.cfg/default-arm
  93. *** ERROR: `serverip' not set
  94. missing environment variable: bootfile
  95. Retrieving file: pxelinux.cfg/default
  96. *** ERROR: `serverip' not set
  97. Config file not found
  98. BOOTP broadcast 1
  99. DHCP client bound to address 192.168.1.78 (7 ms)
  100. *** ERROR: `serverip' not set
  101. Cannot autoload with TFTPGET
  102. BOOTP broadcast 1
  103. DHCP client bound to address 192.168.1.78 (9 ms)
  104. *** ERROR: `serverip' not set
  105. Cannot autoload with TFTPGET
复制代码
这是我的boot.scr文件:
  1. # Generate boot.scr:
  2. # mkimage -c none -A arm -T script -d boot.cmd.default boot.scr
  3. #
  4. ################


  5. for boot_target in ${boot_targets};
  6. do
  7. if test "${boot_target}" = "jtag" ; then
  8. bootm 0x00200000 0x04000000 0x00100000
  9. exit;
  10. fi
  11. if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then
  12. if test -e ${devtype} ${devnum}:${distro_bootpart} /image.ub; then
  13. fatload ${devtype} ${devnum}:${distro_bootpart} 0x10000000 image.ub;
  14. bootm 0x10000000;
  15. exit;
  16. fi
  17. if test -e ${devtype} ${devnum}:${distro_bootpart} /zImage; then
  18. fatload ${devtype} ${devnum}:${distro_bootpart} 0x00200000 zImage;;
  19. fi
  20. if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
  21. fatload ${devtype} ${devnum}:${distro_bootpart} 0x00100000 system.dtb;
  22. fi
  23. if test -e ${devtype} ${devnum}:${distro_bootpart} /rootfs.cpio.gz.u-boot; then
  24. fatload ${devtype} ${devnum}:${distro_bootpart} 0x04000000 rootfs.cpio.gz.u-boot;
  25. bootm 0x00200000 0x04000000 0x00100000
  26. exit;
  27. fi
  28. if test -e ${devtype} ${devnum}:${distro_bootpart} /system.bit; then
  29. fatload ${devtype} ${devnum}:${distro_bootpart} 0x00800000 system.bit;
  30. fpga loadb 0 ${fileaddr} ${filesize}
  31. fi
  32. bootz 0x00200000 - 0x00100000
  33. exit;
  34. fi
  35. if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then
  36. sf probe 0 0 0;
  37. if test "image.ub" = "image.ub"; then
  38. sf read 0x10000000 0x1000000 0xF00000;
  39. bootm 0x10000000;
  40. exit;
  41. fi
  42. if test "image.ub" = "uImage"; then
  43. sf read 0x00200000 0x1000000 0x500000;
  44. sf read 0x04000000 0x1580000 0xA00000
  45. bootm 0x00200000 0x04000000 0x00100000
  46. exit;
  47. fi
  48. exit;
  49. fi
  50. if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then
  51. nand info
  52. if test "image.ub" = "image.ub"; then
  53. nand read 0x10000000 0x1000000 0x6400000;
  54. bootm 0x10000000;
  55. exit;
  56. fi
  57. if test "image.ub" = "uImage"; then
  58. nand read 0x00200000 0x1000000 0x3200000;
  59. nand read 0x04000000 0x4600000 0x3200000;
  60. bootm 0x00200000 0x04000000 0x00100000
  61. exit;
  62. fi
  63. fi
  64. done
复制代码
根据之前大佬的建议,我尝试将zImage改成了Image,并且修改了boot.scr。但仍旧不行,后来在启动时,进入uboot命令窗口,我输入了如下四条指令:
  1. 1. u-boot> fatload mmc 0 0x00200000 zImage
  2. 2. u-boot> fatload mmc 0 0x00100000 system.dtb
  3. 3. u-boot> fatload mmc 0 0x04000000 rootfs.cpio.gz.u-boot
  4. 4. u-boot> bootz 0x00200000 0x04000000 0x00100000
复制代码
起初执行到第三步时,没有读取成功,于是我将rootfs.cpio.gz.u-boot也放入了FAT分区。
然后重新执行了,顺利进入了系统。我是根据领航v3教程操作的,教程中并未将该文件放入FAT分区。
请问该用什么办法直接上电自动进入,而不是输入uboot命令后才能进入?能力有限,并未深入了解这些东西,仅是复现。

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

2

主题

102

帖子

0

精华

高级会员

Rank: 4

积分
645
金钱
645
注册时间
2021-8-3
在线时间
152 小时
发表于 2024-2-21 19:09:58 | 显示全部楼层
先用资料盘里的启动文件试试,不行的话可能是环境变量的问题,需要把flash格式化
回复 支持 反对

使用道具 举报

30

主题

71

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
254
金钱
254
注册时间
2020-10-19
在线时间
54 小时
 楼主| 发表于 2024-2-22 14:01:37 | 显示全部楼层
helloqds 发表于 2024-2-21 19:09
先用资料盘里的启动文件试试,不行的话可能是环境变量的问题,需要把flash格式化

不知道是不是开发板不一样。我选的是和自己一样的7010的zyqn_petalinux中的linux_driver_boot中的文件,然后拷贝到SD卡直接启动不了了。
回复 支持 反对

使用道具 举报

30

主题

71

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
254
金钱
254
注册时间
2020-10-19
在线时间
54 小时
 楼主| 发表于 2024-2-22 16:34:03 | 显示全部楼层
helloqds 发表于 2024-2-21 19:09
先用资料盘里的启动文件试试,不行的话可能是环境变量的问题,需要把flash格式化

我把SD卡重新制作了一下,还是不行。
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-22 11:21

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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