可以通过网络启动freertos吗?

时间:2017-05-24 13:07:07

标签: xilinx u-boot freertos zynq

我的系统中有些话。

我在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-Server,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 ...

提前谢谢

2 个答案:

答案 0 :(得分:0)

解决方案是: Xilinx SDK提供了一个输出Elf-File,u-boot理解:

tftpboot 0x000000 FreeRTOS_ZC706_HelloWorld.elf
bootelf 0x0

由于

答案 1 :(得分:0)

tftpboot 0x0 hello.efl; bootelf 0x0;

可在Uboot 2019.2版本和FreeRTOS.elf中使用。

对于另一个核心,您需要使用arm-none-eabi-objcopy -O二进制hello.elf hello.bin将其转换为bin格式。 tftpboot在正确的内存位置下进行。并在CPU0代码中启动它。

相关问题