繁体   English   中英

为arm Cortex-A9实现代码时,DS-5中的内存重叠

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

我已经想尝试在DS-5中实现代码(针对Cortex-A9并使用NEON SIMD内部函数)已经困扰了很多天。 我设法通过调试器执行了一些小程序,但是当我尝试分配大于256KB的内存时,总是收到一条消息

描述资源路径位置类型L6221E:执行范围为[0x80001674,0x800417d0)的执行区域ZI_DATA与执行范围为[0x80040000,0x80080000)的执行区域ARM_LIB_HEAP重叠。 CPUTest2017RE C / C ++问题

内存映射由分散文件调度,如下所示

 ;*******************************************************
 ; 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
{ }
}

在此处输入图片说明 所以我的问题是,当我分配内存以传递512x512(.bdat格式)图像时,这种分配发生在ZI_DATA中,而不是在空闲的SDRAM中。 我在每种配置附近进行了尝试,或者我得到了调试器卡在待处理状态之上的错误……这是什么问题?

PS:相同的代码在Cortex-A8和旧版本的DS-5上运行,但是由于某种原因,Cortex-A8调试器无法与最新版本的DS-5一起使用。

好吧,看来您的bss数据超出范围了,进入了HEAP部分。 您可以尝试一些方法...

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.

相同的代码适用于A8的事实并没有真正的帮助,因为库是不同的,代码段也是如此...我去过那里,感觉并不好:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM