DSPRelated.com
Forums

Out of memory in output section 'seg_imu' in processor 'p0'

Started by m_z_...@yahoo.com May 20, 2008
HI
I am using ADSP-21065L and encounter with the following error
/////////////// ERROR DURING COMPILATION /////////////////
24467 bytes eliminated in processor 'p0'

For more details, see 'linker_log.xml' in the output directory.
[Error li1040] ".\INS30.LDF":149 Out of memory in output section 'seg_imu' in processor 'p0'
Total of 0x2a5 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.

Linker finished with 1 error
cc3089: fatal error: Link failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.
/////////////////////////////////////////////

Whereas i have the following setting in my LDF file
//////////////// SETTING IN LDF FILE ////////////////////////////
// the first 512 words are reserved for BIOS code
// the remaining ext. SRAM can be used for data and program code.
// to link data to ext. memory, use the segment directive, e.g.
// static segment ("ext_dmda") int ext_var[..];
// to link a function to ext. memory, use the segment directive, e.g.
// segment ("ext_pmco") int ext_func (int..)
// { ... }
// please note that an external code section cannot exceed 64K
// you may however specify multiple external code sections
// ( this is important only for larger SRAM: 256K x 32 )
//
// each external program word requires two 32 bit memory locations

// the following definitions allocate
// 15872 words external program code
// 16384 words external data
// 16384 words heap

ext_bios { TYPE(PM RAM) START(0x00020000) END(0x000201FF) WIDTH(32) }
ext_pmco { TYPE(PM RAM) START(0x00020200) END(0x00023FFF) WIDTH(32) }
ext_dmda { TYPE(DM RAM) START(0x00028000) END(0x0002BFFF) WIDTH(32) }

seg_imu
{
INPUT_SECTIONS( $LIBRARIES(seg_pmco))
} >imu
////////////////////////////////////////////////////////////////

if any body knows that kindly help me

Rain
Hello Rain (I suppose that is your name, out of your signature)
The messages say that your section IMU was not allocated enough memory for the amount of memory.
It seems to me that the snippet of the LDF that you attacheddoes not have enough information for one to advice what to do next, since you are not showing how big are seg_imu and seg_pmco.
But in any case, you will have to modify the LDF to allocate more memory for those segments, which you can do either on the source code of the LDF itselfor using the ExpertLinker.
You needed 677 words for this kind of memory (0x2A5), which you did not seem to have.
Regards


Jaime Andr Aranguren Cardona
j...@ieee.org
j...@computer.org

----- Original Message ----
From: "m...@yahoo.com"
To: a...
Sent: Tuesday, May 20, 2008 1:08:29 AM
Subject: [adsp] Out of memory in output section 'seg_imu' in processor 'p0'
HI
I am using ADSP-21065L and encounter with the following error
//////////// /// ERROR DURING COMPILATION //////////// /////
24467 bytes eliminated in processor 'p0'

For more details, see 'linker_log. xml' in the output directory.

[Error li1040] ".\INS30.LDF" :149 Out of memory in output section 'seg_imu' in processor 'p0'
Total of 0x2a5 word(s) were not mapped.
For more details, see 'linker_log. xml' in the output directory.

Linker finished with 1 error
cc3089: fatal error: Link failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.
//////////// ///////// ///////// ///////// //////

Whereas i have the following setting in my LDF file
//////////// //// SETTING IN LDF FILE //////////// ///////// ///////
// the first 512 words are reserved for BIOS code
// the remaining ext. SRAM can be used for data and program code.
// to link data to ext. memory, use the segment directive, e.g.
// static segment ("ext_dmda") int ext_var[..];
// to link a function to ext. memory, use the segment directive, e.g.
// segment ("ext_pmco") int ext_func (int..)
// { ... }
// please note that an external code section cannot exceed 64K
// you may however specify multiple external code sections
// ( this is important only for larger SRAM: 256K x 32 )
//
// each external program word requires two 32 bit memory locations

// the following definitions allocate
// 15872 words external program code
// 16384 words external data
// 16384 words heap

ext_bios { TYPE(PM RAM) START(0x00020000) END(0x000201FF) WIDTH(32) }
ext_pmco { TYPE(PM RAM) START(0x00020200) END(0x00023FFF) WIDTH(32) }
ext_dmda { TYPE(DM RAM) START(0x00028000) END(0x0002BFFF) WIDTH(32) }

seg_imu
{
INPUT_SECTIONS( $LIBRARIES(seg_ pmco))
} >imu
//////////// ///////// ///////// ///////// ///////// ///////// ///////

if any body knows that kindly help me

Rain
On Wed, 21 May 2008, Muhammad Farooqui wrote:

>
> First of all I would like to say thank to you that you show interest in that problem.
>
> Basically DSP code was developed by another person who is not accessible now. And now my task is to
> add some more functionality in previous developed code. So I developed some code (which is working
> fine) and when I add my new code in previous developed cod so I face the following problems.
>
> I paste the whole LDF file here.
> MEMORY
> {
> seg_rth { TYPE(PM RAM) START(0x00008000) END(0x000080ff) WIDTH(48) }
> int_bios { TYPE(PM RAM) START(0x00008100) END(0x000081af) WIDTH(48) }
> seg_init { TYPE(PM RAM) START(0x000081b0) END(0x000081bf) WIDTH(48) }
> seg_int_code { TYPE(PM RAM) START(0x000081c0) END(0x00008297) WIDTH(48) }
> bdf { TYPE(PM RAM) START(0x000082c0) END(0x000097ff) WIDTH(48) }

> imu { TYPE(PM RAM) START(0x0000C000) END(0x0000Cce5) WIDTH(48) }
this is important----------------^^^

> filter { TYPE(PM RAM) START(0x0000d4e6) END(0x0000d537) WIDTH(32) }
> seg_dmda { TYPE(DM RAM) START(0x0000d538) END(0x0000Dd4f) WIDTH(32) }
> seg_stak { TYPE(DM RAM) START(0x0000Dd50) END(0x0000Dffd) WIDTH(32) }
> seg_heap { TYPE(DM RAM) START(0x0000Dffe) END(0x0000Dfff) WIDTH(32) }

Your error said you needed 2a5 more. So CCe5 + 2A5 = cf8a. Since the
next ram space looks like it starts at d4e6, you have plenty of room.

Definitly read up on the ldf. It gives you a lot of power on how to set
up your memory spaces.

Patience, persistence, truth,
Dr. mike
Hello, Rain.
Thanks for the comment. The greatest thing with newsgroups / mailing lists is to have collaborative work from people around the world.
I am replying with copy to the list, since it might be useful for other readers, too.
The key to your problem is this piece of code:
imu { TYPE(PM RAM) START(0x0000C000) END(0x0000Cce5)
WIDTH(48) }
On it, youare declaring / reserving 0xCE5 = 3301 words of 48 bits of width, for the section "imu", which you get mappedlater on, in:
seg_imu
{
INPUT_SECTIONS( $LIBRARIES(seg_pmco))
} >imu

This is the section that the liker complainsabout not being able tofit the code from libraries which is supposed to map.
So, you have to increase the memory reservation for imu, modifying
imu { TYPE(PM RAM) START(0x0000C000) END(0x0000Cce5)
WIDTH(48) }

Basically, increase the end address. But beware of blocks of memory, and the alignment issues.... Given the mixed 48/32/16 datasizes possible in SHARC memory, the addressing is not linear across them. Expert Linker is your friend here, since will allow you to drag and drop, and ittakes care of alignment, etc. Or if you want to do by hand, read the documentation on the ADSP-21065L Processor Reference aka Hardware Reference Manual.
I hope thishelps you a bit.
Regards,

Jaime Andr Aranguren Cardona
j...@ieee.org
j...@computer.org
----- Original Message ----
From: m_z_farooqui
To: Jaime Andres Aranguren Cardona
Sent: Wednesday, May 21, 2008 3:19:52 AM
Subject: Re: Out of memory in output section 'seg_imu' in processor 'p0'

First of all I would like to say thank to you that you show interest
in that problem.
Basically DSP code was developed by another person who is not
accessible now. And now my task is to add some more functionality in
previous developed code. So I developed some code (which is working
fine) and when I add my new code in previous developed cod so I face
the following problems.
I paste the whole LDF file here.

ARCHITECTURE(ADSP-21065L)

//
// ADSP-21065L Memory Map:
// ------------
// Internal memory 0x0000 0000 to 0x0007 ffff
// ------------
// 0x0000 0000 to 0x0000 00ff IOP Regs
// 0x0000 0100 to 0x0000 01ff IOP Regs of
Processor ID 001
// 0x0000 0200 to 0x0000 02ff IOP Regs of
Processor ID 002
// 0x0000 0300 to 0x0000 07ff Reserved
// Block 0 0x0000 8000 to 0x0000 9fff Normal Word (32/48)
Addresses
// (0x0000 8000 to 0x0000 97ff) 48-bit words
// (0x0000 8000 to 0x0000 9fff) 32-bit words
// 0x0000 A000 to 0x0000 Bfff
Reserved
// Block 1 0x0000 C000 to 0x0000 Dfff Normal Word (32/48)
Addresses
// (0x0000 C000 to 0x0000 Cfff) 48-bit words
// (0x0000 C000 to 0x0000 Dfff) 32-bit words
// 0x0000 E000 to 0x0000 ffff
Reserved
// Block 0 0x0001 0000 to 0x0001 3fff Short Word (16)
Addresses
// 0x0001 4000 to 0x0001 7fff
Reserved
// Block 1 0x0001 8000 to 0x0001 Bfff Short Word (16)
Addresses
// 0x0001 C000 to 0x0001 ffff
Reserved
// ------------
// External memory 0x0002 0000 to 0x03ff ffff
// ------------
// External Bank 0 0x0002 0000 to 0x00ff ffff
// External Bank 1 0x0100 0000 to 0x01ff ffff
// External Bank 2 0x0200 0000 to 0x02ff ffff
// External Bank 3 0x0300 0000 to 0x03ff ffff
//
// This architecture file allocates:
// Internal 256 words of run-time header in memory block 0
// 16 words of initialization code in memory block 0
// 3.8K words of C code space in memory block 0
// 2K words of C PM data space in memory block 0
// 4K words of C DM data space in memory block 1
// 1.25K words of C heap space in memory block 1
// 2.75K words of C stack space in memory block 1

SEARCH_DIR( $ADI_DSP\21k\lib )

#ifdef _ADI_THREADS
#ifdef __ADI_LIBEH__
$LIBRARIES = libehmt.dlb, libcmt.dlb, libdsp.dlb, libiomt.dlb;
#else
$LIBRARIES = libcmt.dlb, libdsp.dlb, libiomt.dlb;
#endif
#else
#ifdef __ADI_LIBEH__
$LIBRARIES = libeh.dlb, libc.dlb, libdsp.dlb, libio.dlb;
#else
$LIBRARIES = libc.dlb, libdsp.dlb, libio.dlb;
#endif
#endif

// Libraries from the command line are included in
COMMAND_LINE_OBJECTS.
#ifndef EZKIT_MONITOR
#ifdef __ADI_LIBEH__
#define CRT_HDR 065L_hdr_adamagic.doj
#else
#define CRT_HDR 065L_hdr.doj
#endif
#else
#define CRT_HDR 065L_hdr_ezkit.doj
#endif
$OBJECTS = CRT_HDR, $COMMAND_LINE_OBJECTS;

MEMORY
{

seg_rth { TYPE(PM RAM) START(0x00008000) END(0x000080ff) WIDTH
(48) }
int_bios { TYPE(PM RAM) START(0x00008100) END(0x000081af) WIDTH
(48) }
seg_init { TYPE(PM RAM) START(0x000081b0) END(0x000081bf) WIDTH
(48) }
seg_int_code { TYPE(PM RAM) START(0x000081c0) END(0x00008297)
WIDTH(48) }
bdf { TYPE(PM RAM) START(0x000082c0) END(0x000097ff) WIDTH
(48) }
imu { TYPE(PM RAM) START(0x0000C000) END(0x0000Cce5)
WIDTH(48) }
filter { TYPE(PM RAM) START(0x0000d4e6) END(0x0000d537)
WIDTH(32) }
// seg_dmda { TYPE(DM RAM) START(0x0000d538) END(0x0000Ddff)
WIDTH(32) }
seg_dmda { TYPE(DM RAM) START(0x0000d538) END(0x0000Dd4f)
WIDTH(32) }
// seg_stak { TYPE(DM RAM) START(0x0000De00) END(0x0000Dffd)
WIDTH(32) }
seg_stak { TYPE(DM RAM) START(0x0000Dd50) END(0x0000Dffd)
WIDTH(32) }
seg_heap { TYPE(DM RAM) START(0x0000Dffe) END(0x0000Dfff)
WIDTH(32) }

//
**********************************************************************
****
// EXTERNAL SRAM (64K x 32 bits)
//
**********************************************************************
****

// the first 512 words are reserved for BIOS code
// the remaining ext. SRAM can be used for data and program code.
// to link data to ext. memory, use the segment directive, e.g.
// static segment ("ext_dmda") int ext_var[..];
// to link a function to ext. memory, use the segment directive,
e.g.
// segment ("ext_pmco") int ext_func (int..)
// { ... }
// please note that an external code section cannot exceed 64K
// you may however specify multiple external code sections
// ( this is important only for larger SRAM: 256K x 32 )
//
// each external program word requires two 32 bit memory
locations

// the following definitions allocate
// 15872 words external program code
// 16384 words external data
// 16384 words heap

ext_bios { TYPE(PM RAM) START(0x00020000) END(0x000201FF) WIDTH
(32) }
ext_pmco { TYPE(PM RAM) START(0x00020200) END(0x00023FFF) WIDTH
(32) }
ext_dmda { TYPE(DM RAM) START(0x00028000) END(0x0002BFFF) WIDTH
(32) }
// seg_heap { TYPE(DM RAM) START(0x0002C000) END(0x0002FFFF) WIDTH
(32) }

}

PROCESSOR p0
{
// KEEP(
_main,___ctor_NULL_marker,___lib_end_of_heap_descriptions )
LINK_AGAINST( $COMMAND_LINE_LINK_AGAINST)
OUTPUT( $COMMAND_LINE_OUTPUT_FILE )

SECTIONS
{

// .text output section
seg_rth
{
INPUT_SECTIONS( $OBJECTS(seg_rth) $LIBRARIES
(seg_rth))
} >seg_rth

seg_init
{
INPUT_SECTIONS( $OBJECTS(seg_init) $LIBRARIES
(seg_init))
} >seg_init

seg_int_code
{
INPUT_SECTIONS( $OBJECTS(seg_int_code)
$LIBRARIES(seg_int_code))
} >seg_int_code

seg_bdf
{
INPUT_SECTIONS( bdf.doj(seg_pmco))
} >bdf

seg_imu
{
INPUT_SECTIONS( $LIBRARIES(seg_pmco))
} >imu

seg_dmda
{
INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES
(seg_dmda))
} > seg_dmda

seg_filter
{
INPUT_SECTIONS( $OBJECTS(filter) $LIBRARIES
(filter))
} >filter

ext_code
{
INPUT_SECTIONS( $OBJECTS(ext_pmco) $LIBRARIES(ext_pmco))
} > ext_pmco

ext_data
{
INPUT_SECTIONS( $OBJECTS(ext_dmda) $LIBRARIES(ext_dmda))
} > ext_dmda

stackseg
{

// allocate a stack for the application
ldf_stack_space = .;
ldf_stack_length = MEMORY_SIZEOF(seg_stak);
} > seg_stak

heap
{
// allocate a heap for the application
ldf_heap_space = .;
ldf_heap_length = MEMORY_SIZEOF(seg_heap);
ldf_heap_end = ldf_heap_space +
ldf_heap_length - 1;
} > seg_heap

}
}
If you have any helpful tutorial or material or link about LDF file
setting so kindly tell me.
Warm regards
Rain

--- In a..., Jaime Andres Aranguren Cardona
wrote:
>
> Hello Rain (I suppose that is your name, out of your signature)
> The messages say that your section IMU was not allocated enough
memory for the amount of memory.
> It seems to me that the snippet of the LDF that you attacheddoes
not have enough information for one to advice what to do next, since
you are not showing how big are seg_imu and seg_pmco.
> But in any case, you will have to modify the LDF to allocate more
memory for those segments, which you can do either on the source code
of the LDF itselfor using the ExpertLinker.
> You needed 677 words for this kind of memory (0x2A5), which you did
not seem to have.
> Regards
>
>
> Jaime Andr Aranguren Cardona
> jaime.aranguren@...
> jaime.aranguren@...
>
> ----- Original Message ----
> From: "m_z_farooqui@..."
> To: a...
> Sent: Tuesday, May 20, 2008 1:08:29 AM
> Subject: [adsp] Out of memory in output section 'seg_imu' in
processor 'p0'
> HI
> I am using ADSP-21065L and encounter with the following error
> //////////// /// ERROR DURING COMPILATION //////////// /////
> 24467 bytes eliminated in processor 'p0'
>
> For more details, see 'linker_log. xml' in the output directory.
>
> [Error li1040] ".\INS30.LDF" :149 Out of memory in output
section 'seg_imu' in processor 'p0'
> Total of 0x2a5 word(s) were not mapped.
> For more details, see 'linker_log. xml' in the output directory.
>
> Linker finished with 1 error
> cc3089: fatal error: Link failed
> Tool failed with exit/exception code: 1.
> Build was unsuccessful.
> //////////// ///////// ///////// ///////// //////
>
> Whereas i have the following setting in my LDF file
> //////////// //// SETTING IN LDF FILE //////////// ///////// ///////
> // the first 512 words are reserved for BIOS code
> // the remaining ext. SRAM can be used for data and program code.
> // to link data to ext. memory, use the segment directive, e.g.
> // static segment ("ext_dmda") int ext_var[..];
> // to link a function to ext. memory, use the segment directive,
e.g.
> // segment ("ext_pmco") int ext_func (int..)
> // { ... }
> // please note that an external code section cannot exceed 64K
> // you may however specify multiple external code sections
> // ( this is important only for larger SRAM: 256K x 32 )
> //
> // each external program word requires two 32 bit memory locations
>
> // the following definitions allocate
> // 15872 words external program code
> // 16384 words external data
> // 16384 words heap
>
> ext_bios { TYPE(PM RAM) START(0x00020000) END(0x000201FF) WIDTH
(32) }
> ext_pmco { TYPE(PM RAM) START(0x00020200) END(0x00023FFF) WIDTH
(32) }
> ext_dmda { TYPE(DM RAM) START(0x00028000) END(0x0002BFFF) WIDTH
(32) }
>
> seg_imu
> {
> INPUT_SECTIONS( $LIBRARIES(seg_ pmco))
> } >imu
> //////////// ///////// ///////// ///////// ///////// ///////// /////
//
>
> if any body knows that kindly help me
>
> Rain
>
Helloeverybody,
Well, actually I replied to the OP by private mail, with copy to the list. My comment was on the same lines as Mikes'
Indeed, Mike actually said what is actually the minimum size that you needed, and seemed to check that you can actuallyset that size... No overlapping and (it seems) no mixed size (48/32/16) problems.
So, go ahead!
Regards,

Jaime Andr Aranguren Cardona
j...@ieee.org
j...@computer.org
----- Original Message ----
From: Mike Rosing
To: Muhammad Farooqui
Cc: Jaime Andres Aranguren Cardona ; adsp
Sent: Wednesday, May 21, 2008 7:43:40 AM
Subject: Re: [adsp] Out of memory in output section 'seg_imu' in processor 'p0'

On Wed, 21 May 2008, Muhammad Farooqui wrote:

>
> First of all I would like to say thank to you that you show interest in that problem.
>
> Basically DSP code was developed by another person who is not accessible now. And now my task is to
> add some more functionality in previous developed code. So I developed some code (which is working
> fine) and when I add my new code in previous developed cod so I face the following problems.
>
> I paste the whole LDF file here.
> MEMORY
> {
> seg_rth { TYPE(PM RAM) START(0x00008000) END(0x000080ff) WIDTH(48) }
> int_bios { TYPE(PM RAM) START(0x00008100) END(0x000081af) WIDTH(48) }
> seg_init { TYPE(PM RAM) START(0x000081b0) END(0x000081bf) WIDTH(48) }
> seg_int_code { TYPE(PM RAM) START(0x000081c0) END(0x00008297) WIDTH(48) }
> bdf { TYPE(PM RAM) START(0x000082c0) END(0x000097ff) WIDTH(48) }

> imu { TYPE(PM RAM) START(0x0000C000) END(0x0000Cce5) WIDTH(48) }
this is important----------------^^^

> filter { TYPE(PM RAM) START(0x0000d4e6) END(0x0000d537) WIDTH(32) }
> seg_dmda { TYPE(DM RAM) START(0x0000d538) END(0x0000Dd4f) WIDTH(32) }
> seg_stak { TYPE(DM RAM) START(0x0000Dd50) END(0x0000Dffd) WIDTH(32) }
> seg_heap { TYPE(DM RAM) START(0x0000Dffe) END(0x0000Dfff) WIDTH(32) }

Your error said you needed 2a5 more. So CCe5 + 2A5 = cf8a. Since the
next ram space looks like it starts at d4e6, you have plenty of room.

Definitly read up on the ldf. It gives you a lot of power on how to set
up your memory spaces.

Patience, persistence, truth,
Dr. mike