【发布时间】:2020-02-14 09:50:53
【问题描述】:
给我的系统一些话。
我在 Xilinx 开发板 zc706 上工作。 freertos 的基本示例正在运行。
现在的问题是:如何通过网络启动应用程序? freertos 应用程序是一种裸机方法。 通常使用像 u-boot 这样的加载器,但我发现的示例仅适用于 linux 用例。
补充: 使用 XMD 控制台可以将 u-boot 加载到内存中
XMD% source ps7_init.tcl
XMD% ps7_init
XMD% dow u-boot
Processor started. Type "stop" to stop processor
Processor Stop Condition Unknown
Processor Reset .... DONE
Downloading Program -- u-boot
section, .text: 0x04000000-0x040524d7
section, efi_runtime_text: 0x040524d8-0x040524fb
section, .rodata: 0x04052500-0x040650d1
section, .hash: 0x040650d4-0x040650ff
section, .dtb.init.rodata: 0x04065100-0x0406866f
section, .data: 0x04068670-0x0406b31b
section, .got.plt: 0x0406b31c-0x0406b327
section, efi_runtime_data: 0x0406b328-0x0406b3ff
section, .u_boot_list: 0x0406b400-0x0406c71f
section, .rel.dyn: 0x0406c720-0x04077d5f
section, .bss: 0x0406c720-0x040ad29f
Download Progress..10.20.30.40.50.60.70.80.90.Done
Setting PC with Program Start Address 0x04000000
XMD% run
RUNNING> 0
XMD%
结果是在 com 端口上看到的:
U-Boot 2017.01-00012-g374a838 (May 29 2017 - 17:55:04 +0200)
Model: Zynq ZC706 Development Board
Board: Xilinx Zynq
I2C: ready
DRAM: ECC disabled 1 GiB
MMC: sdhci@e0100000: 0 (SD)
SF: Detected s25fl128s_64k with page size 512 Bytes, erase size 128 KiB, total 32 MiB
*** Warning - bad CRC, using default environment
In: serial@e0001000
Out: serial@e0001000
Err: serial@e0001000
Model: Zynq ZC706 Development Board
Board: Xilinx Zynq
Net: ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot: 0
Device: sdhci@e0100000
Manufacturer ID: 27
OEM: 5048
Name: SD16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
** Unable to read file uImage **
Zynq>
补充: 我已经使用标志 FSBL_DEBUG 构建了 FSBL: (项目 -> 属性 -> C/C++ 构建 -> 设置 -> ARM gcc 编译器 -> 符号) 我仅使用引导加载程序部分构建 bin 文件并将其放在 SD 卡上: Xilinx 工具->创建启动映像
补充: 问题是,SDK 需要一个名为 u-boot.elf 的文件。在构建 u-boot 后扩展不存在。
所以现在我的主机上运行了一个 TFTP 服务器,并且 u-boot 找到了 uEnv.txt 文件,但是这个文件中的 cmd 没有运行:
如何设置 u-boot 并提供正确的 loadAddress 来加载 freeRTos elf 文件?
tftpboot cmd 似乎是:
tftpboot [loadAddress] [bootfilename]
e.g.
tftpboot 0x80400000 vlm-boards/14726/uImage
zc706板子的加载地址是多少?
加法:
与 TFTP 服务器的下载连接似乎有效: 但是在使用“go” cmd 启动后会发生重置。
Zynq> setenv ipaddr 192.168.150.101
Zynq> setenv netmask 255.255.255.0
Zynq> setenv gatewayip 192.168.150.1
Zynq> serverip=192.168.150.100
Zynq> ping 192.168.150.100
Using ethernet@e000b000 device
host 192.168.150.100 is alive
Zynq> tftpboot 0x8000 FreeRTOS_HelloWorld.elf
Using ethernet@e000b000 device
TFTP from server 192.168.150.100; our IP address is 192.168.150.101
Filename 'FreeRTOS_HelloWorld.elf'.
Load address: 0x8000
Loading: ###############
2.8 MiB/s
done
Bytes transferred = 205675 (3236b hex)
Zynq> go 0x8000
## Starting application at 0x00008000 ...
undefined instruction
pc : [<0000fa60>] lr : [<3ff443c4>]
reloc pc : [<c40cda60>] lr : [<040023c4>]
sp : 3eb20cf4 ip : 0000001c fp : 3ff4437c
r10: 3eb1f9b0 r9 : 3eb21ee8 r8 : 3ffaef30
r7 : 00000000 r6 : 00008000 r5 : 00000002 r4 : 3eb2f9b4
r3 : 00008000 r2 : 3eb2f9b4 r1 : 3eb2f9b4 r0 : 00001084
Flags: nZcv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...
提前谢谢
【问题讨论】:
-
它是在 ARM 上运行还是在 FPGA 上运行?您可以使用示例进行 linux 启动并将 linux 镜像替换为 freertos 镜像。
-
最初在 ARM 上
-
据我所知: 1. 创建 FSBL 2.1 下载 uboot 源 2.2 为 zc706 板配置 uboot 2.3 构建 uboot 更换 linux 映像后,是否需要进行其他更改对于 freertos elf 文件?
-
一旦加载到内存中,您可能希望“bootelf”启动您的应用程序。
标签: xilinx u-boot freertos zynq