Quantcast
Channel: EngineerZone: Message List
Viewing all articles
Browse latest Browse all 28044

Re: ADSP-21489 link error

$
0
0

Hi Ji,

 

Having taken a closer look at your project, you can ignore my initial comments about the MEMORY{...} block - your LDF already has the DDR definitions. (Do a search for "MEMORY" - case sensitive - then look at the seg_ext_* sections declared in this block).

 

Take a look at your linker_log.xml file and you will see the following report:

 

[Error li1040] .\phase_sharc.ldf:290 Out of memory in output section 'seg_dmda' in processor 'P0'

        Total of 0x10c919 word(s) were not mapped.

0x10c919 words required for .\Debug\arithmetic.doj(seg_dmda):0x0

 

[Error li1040] .\phase_sharc.ldf:298 Out of memory in output section 'seg_dmda2' in processor 'P0'

        Total of 0x10c919 word(s) were not mapped.

0x10c919 words required for .\Debug\arithmetic.doj(seg_dmda):0x0

 

I have highlighted a couple of parts - the red is the 'section name' of the data that is not being mapped. The blue part is the 'output section' in the LDF. If you check the "SECTIONS{...}" block you will see the following:

seg_dmda

{

    INPUT_SECTIONS( $OBJECTS(seg_int_data) $LIBRARIES(seg_int_data))

    INPUT_SECTIONS( $OBJS_LIBS_INTERNAL(seg_dmda))

    INPUT_SECTIONS( $OBJS_LIBS_NOT_EXTERNAL(seg_dmda))

    INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))

} > seg_dmda

 

seg_dmda2

{

    // use unused space in seg_pmda for dmda

    INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))

} > seg_pmda

 

Again I have highlighted the 'section names' in red, the 'output section' in blue, and introduced a third color, green, that denotes the memory location - from the MEMORY{...} block - to which the 'output section' should map any data tagged with specific 'section names'.

 

So, as you can see, seg_dmda and seg_dmda2 make attempts to map data tagged as "seg_dmda". The first attempts to find space in seg_dmda memory location, while the second tries to find space in the seg_pmda location.

 

As I mentioned earlier, the data the linker is failing to place is over 1 million words. This means the Linker will need to use SDRAM. So, if you search the LDF again, this time for "seg_dmda" you will eventually see this output section, "seg_sdram_data", which not only maps "seg_dmda" data, but places it in the "seg_ext_dmda" memory block:

 

seg_sdram_data

{

    INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))

    INPUT_SECTIONS( $OBJECTS(seg_ext_data) $LIBRARIES(seg_ext_data))

    INPUT_SECTIONS( $OBJECTS(seg_sdram) $LIBRARIES(seg_sdram))

} > seg_ext_dmda

 

This should be perfect! But it's not mapping your code... if you take a look at the surrounding code you will see that this is wrapped in "#if defined(USE_SDRAM) ... #endif". You can make this 'true' by going to Project: Project Options: Link: LDF Preprocessing' and adding "USE_SDRAM" to the Preprocessor macro definitions.

 

 

This will actually spit out a whole bunch of other error messages, for fairly similar reasons. In your code you are using the 'section' keyword to place code/data in sections such as "sdram0_bank0" and "sdram0_bank1". As above, if there is a 'section name' used for code or data, it needs to have an 'INPUT_SECTIONS' command in the LDF that corresponds, and maps the code/data to an appropriate location in memory.

 

Hope that's enough for you to get on with.

 

Regards,

Craig.

 

[[Message was edited by: Craig Gilchrist - Text color formatting did not apply correctly in the first draft]]


Viewing all articles
Browse latest Browse all 28044

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>