UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor nunu
Visitor
3,217 Views
Registered: ‎06-08-2017

How using U-boot to start a bare metal application?

Hi, 

 

My aim is to start a bare metal application from a tftp-server.after after startting from SD-Card a u-boot.

I have also some general questions.

 

What I had done till now:

Create FSLB (with SDK), u-boot.elf, hello_world.elf (with SDK).

 

This files wrapped together to a bin-file with

Xilinx SDK
  Xilinx Tools -> Create Image:
  FSBL              (bootloader)
  u-boot.elf        (datafile)

 

The lscript.ld looks like:

  lscript.ld (FSBL)                       Base Address    Size
  ps7_ram_0_S_AXI_BASEADDR                0x00000000      0x00030000
  ps7_ram_1_S_AXI_BASEADDR                0xFFFF0000      0x0000FE00
  
  lscript.ld (Hello_World.elf)            Base Address    Size
  ps7_ddr_0_S_AXI_BASEADDR                0x100000        0x3FF00000                    
  ps7_qspi_linear_0_S_AXI_BASEADDR        0xFC000000      0x2000000
  ps7_ram_0_S_AXI_BASEADDR                0x0             0x30000
  ps7_ram_1_S_AXI_BASEADDR                0xFFFF0000      0x0000FE00

 

I have read the the u-boot has a specific memory start-addresses: In file sturctur of the u-boot i find this file

u-boot-xlnx/arch/arm/config.mk

 which contains: 

#ifndef CONFIG_STANDALONE_LOAD_ADDR
#ifneq ($(CONFIG_ARCH_OMAP2),)
CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
#else
CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
#endif
#endif

 How this addresses are involved to the addresse of the lscripts.ld?

 

Now to the behavior of the system til now.

After the u-boot starts the network environment variables are set and the connection to the tftp-server could be established.

 

 

Zynq> setenv ipaddr 192.168.xxx.101 
Zynq> setenv netmask 255.255.255.0
Zynq> setenv gatewayip 192.168.xxx.1
Zynq> serverip=192.168.xxx.100
Zynq> tftpboot 0x8000 FreeRTOS_HelloWorld.elf
Using ethernet@e000b000 device
TFTP from server 192.168.xxx.100; our IP address is 192.168.xxx.101
Filename 'FreeRTOS_HelloWorld.elf'.
Load address: 0x8000
Loading: ###############
         3 MiB/s
done
Bytes transferred = 205675 (3236b hex)

 

After using different addresses for the "go" command, the system comes to two different situations:

Zynq> go 0x8000
## Starting application at 0x00008000 ...
data abort
pc : [<000085ec>]          lr : [<3ff443c4>]
reloc pc : [<c40c65ec>]    lr : [<040023c4>]
sp : 3eb21d78  ip : c004cf82     fp : 3ff4437c
r10: 00000002  r9 : 3eb21ee8     r8 : 3ffaef30
r7 : 3eb2f820  r6 : 00008000     r5 : 00000002  r4 : c0054f82
r3 : 00008000  r2 : 3eb2f824     r1 : 3eb2f824  r0 : 00001004
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

in the second situation the Loading stucks

Zynq> tftpboot 0x80008000 FreeRTOS_HelloWorld.elf
Using ethernet@e000b000 device
TFTP from server 192.168.xxx.100; our IP address is 192.168.xxx.101
Filename 'FreeRTOS_HelloWorld.elf'.
Load address: 0x80008000
Loading: #

 

 

What i also had tried is to convert the  FreeRTOS_ZC706_HelloWorld.elf to a bin-file with:

arm-xilinx-linux-gnueabi-objcopy -O binary FreeRTOS_ZC706_HelloWorld.elf FreeRTOS_ZC706_HelloWorld.bin

mkimage -A arm -O u-boot -T standalone -C none -a 0x00108000 -e 0x00108000 -n "FreeRTOS_ZC706_HelloWorld" -d FreeRTOS_ZC706_HelloWorld.bin uFreeRTOS_ZC706_HelloWorld.bin
mkimage: Can't map uFreeRTOS_ZC706_HelloWorld.bin: Invalid argument


 

It seem to me that the memory mapping is not consistent:

At which adress the u-boot should load and start the application?

 

Thanks in advance

AN

Tags (2)
0 Kudos
2 Replies
Visitor nunu
Visitor
3,187 Views
Registered: ‎06-08-2017

Re: How using U-boot to start a bare metal application?

After start the u-boot and send the bdinfo cmd it appears thits output:

 

Zynq> bdinfo
arch_number = 0x00000000
boot_params = 0x00000000
DRAM bank   = 0x00000000
-> start    = 0x00000000
-> size     = 0x40000000
baudrate    = 115200 bps
TLB addr    = 0x3FFF0000
relocaddr   = 0x3FF42000
reloc off   = 0x3BF42000
irq_sp      = 0x3EB21ED0
sp start    = 0x3EB21EC0
ARM frequency = 666 MHz
DSP frequency = 0 MHz
DDR frequency = 533 MHz
Early malloc usage: 49c / 600
0 Kudos
Visitor nunu
Visitor
3,160 Views
Registered: ‎06-08-2017

Re: How using U-boot to start a bare metal application?

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 

0 Kudos