Memory overlap in DS-5 when implementing code for arm Cortex-A9

0

I am already stuck for many days trying to implement a code in DS-5, targeting Cortex-A9 and using NEON SIMD intrinsics. I managed to execute some small programs through the debugger, but when I am trying to allocate memory bigger than 256KB I always get a message

Description Resource Path Location Type L6221E: Execution region ZI_DATA with Execution range [0x80001674,0x800417d0) overlaps with Execution region ARM_LIB_HEAP with Execution range [0x80040000,0x80080000). CPUTest2017RE C/C++ Problem

The memory map is scheduled by a scatter file as follows

 ;*******************************************************
 ; Copyright (c) 2011-2014 ARM Ltd.  All rights reserved.
 ;*******************************************************

 ; Scatter-file for Cortex-A9 bare-metal example on Versatile Express

 ; This scatter-file places application code, data, stack and heap at      suitable addresses in the memory map.
 ; Using a scatter-file with ARM_LIB_STACKHEAP eliminates the need to set stack-limit or heap-base in the debugger.

 ; Versatile Express with Cortex-A9 has 1GB SDRAM at 0x60000000 to      0x9FFFFFFF, which this scatter-file uses.


SDRAM 0x80000000 0x10000000
{
VECTORS +0
{
    * (VECTORS, +FIRST)     ; Vector table and other (assembler) startup code
    * (InRoot$$Sections)    ; All (library) code that must be in a root region
}

RO_CODE +0
{ * (+RO-CODE) }            ; Application RO code (.text)

RO_DATA +0
{ * (+RO-DATA) }            ; Application RO data (.constdata)

RW_DATA +0
{ * (+RW) }                 ; Application RW data (.data)

ZI_DATA +0
{ * (+ZI) }                 ; Application ZI data (.bss)

ARM_LIB_HEAP  0x80040000 EMPTY  0x00040000 ; Application heap
{ }

ARM_LIB_STACK 0x80090000 EMPTY -0x00010000 ; Application (SVC mode) stack
{ }

IRQ_STACK     0x800A0000 EMPTY -0x00010000 ; IRQ mode stack
{ }

TTB           0x80100000 EMPTY 0x4000      ; Level-1 Translation Table for      MMU
{ }
}

enter image description here So my problem is that when I allocate memory to pass a 512x512 (.bdat format) Image this allocation happens in ZI_DATA and not in SDRAM that is free. I tried near every configuration and either I get the error above either the debugger stuck on pending... What is the problem here??

PS: the same code was running on Cortex-A8 and older version of DS-5 but for some reason the Cortex-A8 debugger is not working with the newest version of DS-5.

c
arm
neon
ds-5

1 Answer

0

Well it seems that your bss data is going out of range and into the HEAP section. You can try a few things ...

1) Limit the maximum bss section so the error will be more clear
2) Move Heap section on a higher address 
3) generate a map file which has all the section sizes. to see what is taking so much space in the bss section and maybe moving that to some other section.

The fact that the same code works for A8 is not really helpful because the libraries are different and so are the code sections... I have been there and it does'nt feels good :)

answered on Stack Overflow Jan 24, 2017 by theadnangondal

User contributions licensed under CC BY-SA 3.0