cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,863 Views
Registered: ‎12-19-2016

Zynq board - downloaded program data in the board's DDR is wrong

I did a simple hello world project on a new zybo to test the functionality, but it didn't work. Here's what I've done:

 

After exporting hardware and creating sdk projects, I downloaded the bitstream & program into zybo as usual. But the board wouldn't run the program normally(It didn't terminate and print helloworld). So I debugged the board using xsdb, and found out that disassembly result is not the same as elf file displayed in SDK.

 

Data at start point 0x100000 is 0xea020049; however, sdk shows that the data should be 0xea000049, as shown in the second picture. If I keep on stpi, since it goto the wrong place, CPU would finally goto infinite loop. xsdb commands:

 

xsdb% connect
tcfchan#0
xsdb% targets
  1  APU
     2  ARM Cortex-A9 MPCore #0 (Running)
     3  ARM Cortex-A9 MPCore #1 (Running)
  4  xc7z010
xsdb% fpga -f "design_1_wrapper_hw_platform_0/design_1_wrapper.bit"
100%    1MB   1.8MB/s  00:01
xsdb% targets 2
xsdb% source "design_1_wrapper_hw_platform_0/ps7_init.tcl"
xsdb% rst; ps7_init; ps7_post_config;
Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0xffffff28 (Suspended)
Info: ARM Cortex-A9 MPCore #1 (target 3) Stopped at 0xffffff34 (Suspended)
xsdb% dow "hello_world/Debug/hello_world.elf"
Downloading Program -- C:/Xilinx/Zybo/project_2/project_2.sdk/hello_world/Debug/hello_world.elf
        section, .text: 0x00100000 - 0x001016eb
        section, .init: 0x001016ec - 0x00101703
        section, .fini: 0x00101704 - 0x0010171b
        section, .rodata: 0x0010171c - 0x00101733
        section, .data: 0x00101738 - 0x00101bab
        section, .eh_frame: 0x00101bac - 0x00101baf
        section, .mmu_tbl: 0x00104000 - 0x00107fff
        section, .init_array: 0x00108000 - 0x00108003
        section, .fini_array: 0x00108004 - 0x00108007
        section, .bss: 0x00108008 - 0x0010802f
        section, .heap: 0x00108030 - 0x0010a02f
        section, .stack: 0x0010a030 - 0x0010d82f
100%    0MB   0.4MB/s  00:00
Setting PC to Program Start Address 0x00100000
Successfully downloaded C:/Xilinx/Zybo/project_2/project_2.sdk/hello_world/Debug/hello_world.elf
xsdb% mrd 0x100000 16
  100000:   EA020049
  100004:   EA040025
  100008:   EA00002B
  10000C:   EA00003B
  100010:   EA000032
  100014:   E320F000
  100018:   EA000000
  10001C:   EA00000F
  100020:   F92DD91F
  100024:   ED3F1FBB
  100028:   ED6D0B20
  10002C:   EEF11A10
  100030:   00001004
  100034:   00001A10
  100038:   FFFF1004
  10003C:   EFF1019E

hello_world.elf contents:

Disassembly of section .text:

00100000 <_vector_table>:
  100000:   ea000049    b   10012c <_boot>
  100004:   ea000025    b   1000a0 <Undefined>
  100008:   ea00002b    b   1000bc <SVCHandler>
  10000c:   ea00003b    b   100100 <PrefetchAbortHandler>
  100010:   ea000032    b   1000e0 <DataAbortHandler>
  100014:   e320f000    nop {0}
  100018:   ea000000    b   100020 <IRQHandler>
  10001c:   ea00000f    b   100060 <FIQHandler>

00100020 <IRQHandler>:
  100020:   e92d500f    push    {r0, r1, r2, r3, ip, lr}
  100024:   ed2d0b10    vpush   {d0-d7}
  100028:   ed6d0b20    vpush   {d16-d31}
  10002c:   eef11a10    vmrs    r1, fpscr
  100030:   e52d1004    push    {r1}        ; (str r1, [sp, #-4]!)
  100034:   eef81a10    vmrs    r1, fpexc
  100038:   e52d1004    push    {r1}        ; (str r1, [sp, #-4]!)
  10003c:   eb00019e    bl  1006bc <IRQInterrupt>

 

So, the problem is, WHY is the DRAM data not consistent with downloaded elf file??? I almost doubt DRAM works normally. Any ideas?

Tags (2)
0 Kudos