cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
klarsen
Observer
Observer
1,886 Views
Registered: ‎10-13-2011

xsdb incomplete ELF file read

I'm getting the following when trying to "dow" an elf using xsdb:
 
    Failed to download u-boot.elf
    incomplete ELF file read
 
What are the conditions that could generate this message?
 
 
0 Kudos
8 Replies
klarsen
Observer
Observer
1,851 Views
Registered: ‎10-13-2011

So it turns out that as long as my executable is less than around 2.7MB I can load and run it find using xmd and xsdb. However if its greater, xsdb throws that error.

 

Is this hard limit supposed to exist?

0 Kudos
sadanan
Xilinx Employee
Xilinx Employee
1,839 Views
Registered: ‎10-21-2010

Hi,

There is no such limit. We have tested many elfs large than 10 MB.

 

Looking at the sources, xsdb is getting the total size from program headers, and then trying to read data from the elf. In your case, file read is returning a size that is less than the requested size.

 

The elf file is either corrupted, or xsdb is unable to read the size correctly from the elf headers. Can you please send an elf to reproduce this?

0 Kudos
klarsen
Observer
Observer
1,837 Views
Registered: ‎10-13-2011

This one causes the error.

0 Kudos
pmallad
Xilinx Employee
Xilinx Employee
1,768 Views
Registered: ‎01-15-2014

I tried downloading the uboot attached, and didn't see any issues, here is the log:

 

xsdb% connect
tcfchan#0
xsdb% ta
1 APU
2 ARM Cortex-A9 MPCore #0 (Running)
3 xc7z020
xsdb% ta 2
xsdb% dow fsbl.elf
Downloading Program -- fsbl.elf
section, .text: 0x00000000 - 0x0000850f
section, .handoff: 0x00008510 - 0x0000855b
section, .init: 0x0000855c - 0x00008573
section, .fini: 0x00008574 - 0x0000858b
section, .rodata: 0x0000858c - 0x00008657
section, .data: 0x00008658 - 0x0000975b
section, .eh_frame: 0x0000975c - 0x0000975f
section, .bss: 0x00009760 - 0x00009e07
section, .mmu_tbl: 0x0000c000 - 0x0000ffff
section, .init_array: 0x00010000 - 0x00010007
section, .fini_array: 0x00010008 - 0x0001000b
section, .heap: 0x0001000c - 0x0001200f
section, .stack: 0xffff0000 - 0xffffd3ff
100% 0MB 0.4MB/s 00:00
Setting PC to Program Start Address 0x00000000
Successfully downloaded fsbl.elf
xsdb% Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0xfffffe1c (Suspended)
xsdb% con
Info: ARM Cortex-A9 MPCore #0 (target 2) Running
xsdb% stop
Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0x8530 (Suspended)
xsdb% dow u-boot
Downloading Program -- u-boot
section, .text: 0x04000000 - 0x0404ea43
section, efi_runtime_text: 0x0404ea44 - 0x0404ea5b
section, .rodata: 0x0404ea60 - 0x0405d9fe
section, .hash: 0x0405da00 - 0x0405da17
section, .dtb.init.rodata: 0x0405da20 - 0x0405fc9f
section, .data: 0x0405fca0 - 0x040684af
section, .got.plt: 0x040684b0 - 0x040684bb
section, efi_runtime_data: 0x040684c0 - 0x04068587
section, .u_boot_list: 0x04068588 - 0x0406913f
section, .rel.dyn: 0x04069140 - 0x040719af
section, .bss_start: 0x04069140 - 0x0406913f
section, .bss: 0x04069140 - 0x04079da3
section, .bss_end: 0x04079da4 - 0x04079da3
100% 0MB 0.4MB/s 00:01
Setting PC to Program Start Address 0x04000000
Successfully downloaded u-boot

Note: fsbl is downloaded and run first to intialize the DDR. In case DDR is not initialized, then downloading u-boot will throw an error of memory write.


xsct% dow u-boot

Downloading Program -- u-boot

            section, .text: 0x04000000 - 0x0404ea43

            section, efi_runtime_text: 0x0404ea44 - 0x0404ea5b

            section, .rodata: 0x0404ea60 - 0x0405d9fe

            section, .hash: 0x0405da00 - 0x0405da17

            section, .dtb.init.rodata: 0x0405da20 - 0x0405fc9f

            section, .data: 0x0405fca0 - 0x040684af

            section, .got.plt: 0x040684b0 - 0x040684bb

            section, efi_runtime_data: 0x040684c0 - 0x04068587

            section, .u_boot_list: 0x04068588 - 0x0406913f

            section, .rel.dyn: 0x04069140 - 0x040719af

            section, .bss_start: 0x04069140 - 0x0406913f

            section, .bss: 0x04069140 - 0x04079da3

            section, .bss_end: 0x04079da4 - 0x04079da3

aborting, 1 pending requests... 

Failed to download u-boot

Memory write error at 0x4000000. Cannot access DDR: the controller is held in reset

 

Which version of XSDB are you using?

klarsen
Observer
Observer
1,759 Views
Registered: ‎10-13-2011

I've been using 2015.4 but have also tried with 2017.2 Both versions produce the "incomplete ELF file read" error and fail to download the executable.

 

But confirming that it works for you has pointed me to the possibility of an operating system misconfiguration. It could be that I'm missing a system library that xsdb or one of its sub-programs depends upon. I'll start using strace to see what I can find out.

0 Kudos
ibaie
Xilinx Employee
Xilinx Employee
1,700 Views
Registered: ‎10-06-2016

Hi @klarsen,

Did you made any progress on this?

Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
klarsen
Observer
Observer
1,692 Views
Registered: ‎10-13-2011

I did not. It appears that I have all the correct libraries and versions. I still get the error.

0 Kudos
ibaie
Xilinx Employee
Xilinx Employee
1,679 Views
Registered: ‎10-06-2016

Hi @klarsen,

Did you check also loading the FSBL first to ensure your DDR memory is initialized properly, as proposed by @pmallad?

You also might want to post your XSDB log file to have more details about your issue.

Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos