li1040

Hi, 

I am trying to build my project but I get error li1040:

[Error li1040] "..\system\startup_ldf\app.ldf":357 Out of memory in output section 'L1_data_c_bsz_prio2' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":391 Out of memory in output section 'L1_data_c_bsz_prio3' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":510 Out of memory in output section 'L1_data_b_bsz_prio2' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":544 Out of memory in output section 'L1_data_b_bsz_prio3' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":677 Out of memory in output section 'L1_data_a_bsz_prio2' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":711 Out of memory in output section 'L1_data_a_bsz_prio3' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":849 Out of memory in output section 'L2_bsz_prio3' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.


[Error li1040] "..\system\startup_ldf\app.ldf":906 Out of memory in output section 'L2_uncached_bsz' in processor 'P0'
Total of 0xea6008 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.

My buffer is: unsigned char Image_BUFF1[76800];

I suppose I have to do:

#pragma section ("mydata")

unsigned char Image_BUFF1[76800];

What about LDF file? What should I added in LDF?

Using BF706,  ADSP-BF706_EZ-KIT_Mini

Thank you.



What should I added in LDF?
[edited by: SVA at 10:01 AM (GMT -4) on 28 Aug 2020]
Parents
  • 0
    •  Analog Employees 
    on Aug 31, 2020 10:36 AM 2 months ago

    Hi,

    As you are hitting the li1040 error, we would first recommend ensuring two Linker Optimization options are enabled.

    The first is to enable Linker Elimination via  Project->Properties->C/C++ Build->Settings->CrossCore Blackfin Linker->Elimination->Eliminate Unused Objects. When elimination is enabled, the Linker discards any objects (*.doj) within the library that do not contain any relevant code or data (i.e. the application makes no reference to any of the data or code symbols within that object). The linker can then examine the objects that are required for the link, and extract only those symbols required to resolve references from the application code, further stripping out unused data.

    Another option is enabling 'Individually map functions and data items' via 'General' tab of the CrossCore Blackfin Linker options.When enabled, directs the linker to fill in fragmented memory with individual data objects that fit. When this option is selected, the default behavior of the linker (to place data blocks in consecutive memory addresses) is overridden.

    Another cause of the li1040 Out of memory error, you have eventually exhaust all the available memory.

    By enabling the 'Generate symbol Map' option under the 'General' options for the Linker. If you enabled the option to "Generate Symbol Map", the Linker will also generated a project_name.map.xml file which can be viewed in Internet Explorer to view a map of your project. It shows the memory sections declared in the LDF, their start and end bounds and - most importantly - their free/used space. Using this map file you can determine whether there is perhaps a memory section  that is being under-used that you could place more data into.

    For Linker error li1040, please refer CCES help for more information :
    CrossCore® Embedded Studio 2.x.x > Blackfin® Development Tools Documentation > Linker and Utilities Manual > Linker and Archiver Messages > Linker Messages > Errors > li1040

    Furthermore we recommend the EngineerZone as a resource for Linker Errors such as this.We have assisted a number of customers with similar queries which can be found through the EngineerZone Search: http://ez.analog.com/

    Regarding What should I added in LDF:
    Controlling the placement of the function or data is then a case of adding appropriate output section in LDF.

    You can use  #pragma section("section_name") directive to force your data into specific memory. Use this before each function that you want to place in the section.This pragma will only affect the next symbol and if you use this pragma right before a function, that function alone will be placed in the section.

    For example:

    #pragma section("mydata")         //custom_section_name

    unsigned char Image_BUFF1[76800];

    Also, add the appropriate INPUT_SECTIONS commands to your LDF in a suitable place in app.ldf, like below.

    custom_section_name  //Output section
          {
             INPUT_SECTIONS( $OBJS_LIBS(custom_section_name) ) // Input section
          } > > mem_section_name  // Memory section

    For eg:

          L1_data_b
          {
             INPUT_SECTION_ALIGN(4)
             INPUT_SECTIONS( $OBJS_LIBS(mydata) ) // Input section        
          } > MEM_L1_DATA_B
         

    For more information, take a look at the "#pragma section/#pragma default_section" in the CCES help:
    CrossCore® Embedded Studio <version> > Blackfin® Development Tools Documentation > C/C++ Compiler and Library Manual for Blackfin® Processors > Compiler > C/C++ Compiler Language Extensions > Pragmas > Linking Control Pragmas > #pragma section/#pragma default_section

    If you are still facing the same issue, can you please share us the example project along with steps to replicate your issue here. This will help us to assist you further

    Regards,
    Nishanthi.V

  • Hello Nishanthi, 

    Thank you for your fine explanation.

    I did "Eliminate Unused Objects" and "Individually map functions and data items", but none of them worked for me. 

    So, I have tried to make a #pragma as you did, but I get below error:

    [Error li1040] "..\system\startup_ldf\app.ldf":434 Out of memory in output section 'L1_data_b' in processor 'P0'
    Total of 0x1770000 word(s) were not mapped.
    For more details, see 'linker_log.xml' in the output directory.

    The project is:

    #define 	LCD_NO_OF_PIXELS		76800
    #define 	LCD_NO_OF_LINES			320
    #define 	PIXEL_SIZE				1
    
    
    #pragma section ("mydata")
    unsigned char Image_BUFF1[LCD_NO_OF_PIXELS * LCD_NO_OF_LINES * PIXEL_SIZE];
    
    unsigned char Red, Green, Blue, change_color;
    
    void main(void)
    {
    	adi_initComponents();
    	Secure();
    
    	ConfigureDevice();
    
    	while(1)
    	{
    		for(Red=0x0; Red<=0x1; Red++)
    		{
    			for(Green=0x0; Green<=0x1; Green++)
    			{
    				for(Blue=0x0; Blue<=0x100; Blue++)
    				{
    					Fill_color(Image_BUFF1, Red, Green, Blue);
    					Enable_EPPI(Image_BUFF1);
    					Disable_EPPI();
    				}
    			}
    		}
    	}
    }
    
    void Fill_color(unsigned char* pImage_BUFF, unsigned char Red, unsigned char Green, unsigned char Blue)
    {
    	unsigned int row_cnt=0, clmn_cnt=0, count;
    
    	for(count=0; count<(LCD_NO_OF_PIXELS * LCD_NO_OF_LINES * PIXEL_SIZE); count+=3)
    	{
    		*pImage_BUFF = Blue * 0xFF;
    		*pImage_BUFF = Green * 0xFF;
    		*pImage_BUFF = Red * 0xFF;	
    	}
    }
    
    void Enable_EPPI(unsigned int* Image_BUFF)
    {
    	*pREG_DMA14_ADDRSTART =	Image_BUFF; 
    	*pREG_DMA14_CFG	   |=	0x0001;
    	*pREG_EPPI0_CTL	   |=	0x0001;
    }
    

    and I added below to the app.ldf file:

    L1_data_b
    {
    INPUT_SECTION_ALIGN(4)
    INPUT_SECTIONS( $OBJS_LIBS(mydata) ) // Input section
    } > MEM_L1_DATA_B

    The linker_log.xml is:

    <MSG id='062976D0' mid='li1040' type='Error' >
    <FILE><![CDATA[..\system\startup_ldf\app.ldf]]></FILE>
    <FILE_LINE><![CDATA[434]]></FILE_LINE>
    <TEXT><![CDATA[Out of memory in output section 'L1_data_b' in processor 'P0'
    Total of 0x1770000 word(s) were not mapped.]]></TEXT>
    <EXTENDED_INFO><![CDATA[0x1770000 words required for src\EPPI_Txdata.doj(mydata):0x0
    ]]></EXTENDED_INFO>

    I appreciate your response. 

    Thank you.

  • +1
    •  Analog Employees 
    on Sep 3, 2020 4:43 AM 2 months ago in reply to SVA

    Hi,

    From your project, we understand since you are using larger buffer size in code, the "mydata" was place in L1 data internal memory which is capable of only 16 KB memory size.

    You have eventually exhaust the available internal memory.

    The reason why you are seeing this behavior is because the linker will try and map everything from your single source file to one big block in memory, and there is not a block big enough for your data. This causes the linker to fail.  When you split up the code buffer size into two separate source files the linker is able to place the data from each file into separate locations in memory and see if they can be placed individually in different sections.

    If a single source file contains large buffers, the linker will try and place those both in the same section. If no memory section has enough space to house, the linker will fail.

    While you're in the Linker project options, enable the option to "Generate Symbol Map". This will get the Linker to generate an XML file in the output directory, which can be viewed in Internet Explorer to view the memory sections defined in the MEMORY{...} block, so you can see where there is free space, and how much, to try and manually map objects (by adding INPUT_SECTIONS commands) that cannot otherwise be placed.

    You might map all the code/data into L1/L2 memory by changing the whole LDF file for memory sections, but the restriction is that there will only applicable if it is available sufficient memory.

    So, you have to plan according to this memory, otherwise it will throw out of memory error.

    You can refer the Memory map address range for each block(Pg. No.: 7/114) on the below linked in ADSP-BF70x datasheet manual for more details.
    www.analog.com/.../adsp-bf700_bf701_bf702_bf703_bf704_bf705_bf706_bf707.pdf

    Regards,
    Nishanthi.V

Reply
  • +1
    •  Analog Employees 
    on Sep 3, 2020 4:43 AM 2 months ago in reply to SVA

    Hi,

    From your project, we understand since you are using larger buffer size in code, the "mydata" was place in L1 data internal memory which is capable of only 16 KB memory size.

    You have eventually exhaust the available internal memory.

    The reason why you are seeing this behavior is because the linker will try and map everything from your single source file to one big block in memory, and there is not a block big enough for your data. This causes the linker to fail.  When you split up the code buffer size into two separate source files the linker is able to place the data from each file into separate locations in memory and see if they can be placed individually in different sections.

    If a single source file contains large buffers, the linker will try and place those both in the same section. If no memory section has enough space to house, the linker will fail.

    While you're in the Linker project options, enable the option to "Generate Symbol Map". This will get the Linker to generate an XML file in the output directory, which can be viewed in Internet Explorer to view the memory sections defined in the MEMORY{...} block, so you can see where there is free space, and how much, to try and manually map objects (by adding INPUT_SECTIONS commands) that cannot otherwise be placed.

    You might map all the code/data into L1/L2 memory by changing the whole LDF file for memory sections, but the restriction is that there will only applicable if it is available sufficient memory.

    So, you have to plan according to this memory, otherwise it will throw out of memory error.

    You can refer the Memory map address range for each block(Pg. No.: 7/114) on the below linked in ADSP-BF70x datasheet manual for more details.
    www.analog.com/.../adsp-bf700_bf701_bf702_bf703_bf704_bf705_bf706_bf707.pdf

    Regards,
    Nishanthi.V

Children
No Data