Search code examples
xilinxu-bootfreertoszynq

It possible to boot freertos over network?


some words to my system.

Im work on the Xilinx development-board zc706. The basic example of freertos are running.

Now the question is: How i can boot the application over network? A freertos application is a bare-metal approach. Typically a loader like u-boot is been used, but the examples I find, was only for the linux use-case.

Addition: With the XMD console its possible to load the u-boot in the memory

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% 

The result ist seen with on a com port:

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>

Addition: I have build the FSBL with the flag FSBL_DEBUG: (Project -> Properties -> C/C++ Build -> Settings -> ARM gcc compiler -> Symbols) The I build the bin file only with the boot loader partion and put it on the SD card: Xilinx Tools->Create Boot Image

Addition: The problem is, that the SDK needs a file with name u-boot.elf. The extention was not there after the build of u-boot.

So now I have a TFTP-Server running on my host and the u-boot find the uEnv.txt file, but the cmd in this file doesn't run:

How I can setup the u-boot an give the right loadAddress to loadthe freeRTos elf-file?

The tftpboot cmd seems to be:

tftpboot [loadAddress] [bootfilename]
e.g.
tftpboot 0x80400000 vlm-boards/14726/uImage

What is the load address of the zc706 board?

Addition:

The connection an the download with the TFTP-server seems to work: But after starting with the "go" cmd a reset occur.

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 ...

Thx in advance


Solution

  • The solution is: The Xilinx SDK supply as an output an Elf-File, which the u-boot understands:

    tftpboot 0x000000 FreeRTOS_ZC706_HelloWorld.elf
    bootelf 0x0
    

    Thanks