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: 
Highlighted
393 Views
Registered: ‎11-26-2018

Write to DDR issue (can't push registers to the stack)

Jump to solution

Hi everyone,

I'm working with xc7z100 SoC in baremetal mode with single core (Cortex-A9). And got issue with data abort, with the error code 0x8F1. In the ARM resource this code means that the CPU can't write to the memory.

xsdb% bt
    0  0x16d200 strlen(): strlen-armv7.S, line 78
    1  0x16c664 _puts_r()+24: puts.c, line 83
    2  0x119bc0 breakPoint()+20: ../src/ctrl.cpp, line 20
    3  0x11a2b4 Ctrl()+204: ../src/ctrl.cpp, line 193
    4  0x119c0c createChannel()+68: ../src/ctrl.cpp, line 27
    5  0x119cc4 createChannels()+80: ../src/ctrl.cpp, line 52

When CPU steps out from the function createChannel() subj error appears.

Disassembly of the "stepout" moment:

xsct% dis pc 5
00119bc8: push    {r4,r11,lr}
00119bcc: add     r11, sp, #8
00119bd0: sub     sp, sp, #92
00119bd4: str     r0, [r11, #-80]
00119bd8: str     r1, [r11, #-84]

And every command "stpi" doesn't affect to "dis pc" output until CPU jumped to the data abort handler. But the program counter ("pc") is encreasing with each step. And in the backtrace("bt") output changing only:

0x119c0c createChannel()+68
0x119c10 createChannel()+72:
0x119c14 createChannel()+76

etc.

The assembler step where issues appears is:

00119bc8: push {r4,r11,lr}

Here, as far as I understand, is attempt to write three registers to the stack. But unfortunately it cannot be done. The stack is placed in the DDR, as described in the linker script provided by XSDK (lscript.ld)

Does anyone faced with the such kind of issue? May be there are some documentation where decsribed solutions for such issue or the similar?

Thanks in advance!

Regards,

Dmitry

0 Kudos
1 Solution

Accepted Solutions
283 Views
Registered: ‎11-26-2018

Re: Write to DDR issue (can't push registers to the stack)

Jump to solution

Hi ibaie,

 

App is run in DDR. FW loaded by JTAG. DDR is working fine, it checked with few tests.

And I found the solution. In the code which I working on defined own memory allocator (overloaded "new" and "delete"). And this allocator allocates unaligned memory portions. With fixing alignment- issue dissapeared.

 

Regards,

Dmitry

View solution in original post

0 Kudos
2 Replies
Moderator
Moderator
308 Views
Registered: ‎10-06-2016

Re: Write to DDR issue (can't push registers to the stack)

Jump to solution

Hi @dmitry_karyugin 

Could you provide more information about the use case? I mean, is the application being run in OCM/DDR? are you loading through the debugger? If so, how are you selecting the different checkboxed? Did you try to read/write to DDR from XSDB using mrd to ensure DDR is working fine?

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
284 Views
Registered: ‎11-26-2018

Re: Write to DDR issue (can't push registers to the stack)

Jump to solution

Hi ibaie,

 

App is run in DDR. FW loaded by JTAG. DDR is working fine, it checked with few tests.

And I found the solution. In the code which I working on defined own memory allocator (overloaded "new" and "delete"). And this allocator allocates unaligned memory portions. With fixing alignment- issue dissapeared.

 

Regards,

Dmitry

View solution in original post

0 Kudos