Can't link bmp file

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't link bmp file

196 Views
michaelhuslig
Contributor IV

I used the following ld code successfully on an earlier K22 project to link in the binary of a bootloader.

 

/********************************************/

MEMORY
{
  m_boot                (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00008000
  m_interrupts          (RX)  : ORIGIN = 0x00008000, LENGTH = 0x00000400
  m_text                (RX)  : ORIGIN = 0x00008400, LENGTH = 0x00077C00
  m_flash_nvm            (RX)  : ORIGIN = 0x10000000, LENGTH = 0x00020000
  m_flex_ram            (RX)  : ORIGIN = 0x14000000, LENGTH = 0x00001000
  m_data                (RW)  : ORIGIN = 0x1FFF0000, LENGTH = 0x0000FC00
  m_stack                (RW)  : ORIGIN = 0x1FFFFC00, LENGTH = 0x400
  m_data_2              (RW)  : ORIGIN = 0x20000000, LENGTH = 0x00010000
  m_bbram                (RW)  : ORIGIN = 0xA0000000, LENGTH = 0x00080000
}

 

HEAP_SIZE  = 0xFC00;
STACK_SIZE = 0x0400;
M_VECTOR_RAM_SIZE = 0x0;

 

TARGET(binary)
INPUT(bootloader.bin)
OUTPUT_FORMAT(default)

 

/* Define output sections */
SECTIONS
{
  .boot :
  {
    bootloader.bin (.data)
    . = ALIGN(4);
  } >m_boot
    
  /* The startup code goes first into internal flash */
  .interrupts :

 

etc.

/********************************************/

 

But now I am trying to link a .bmp file in a KL33 project with no luck using the following link script:

 

/********************************************/

TARGET(binary)
INPUT(Icon.bmp)
OUTPUT_FORMAT(default)


/* Define output sections */
SECTIONS
{

 

  /* The startup code goes first into internal flash */
  .interrupts :
  {
    __VECTOR_TABLE = .;
    . = ALIGN(4);
    KEEP(*(.isr_vector))     /* Startup code */
    . = ALIGN(4);
  } > m_interrupts

 

  .flash_config :
  {
    . = ALIGN(4);
    KEEP(*(.FlashConfig))    /* Flash Configuration Field (FCF) */
    . = ALIGN(4);
  } > m_flash_config

 

  .bitmaps :
  {
    . = ALIGN(4);
   Icon.bmp (.data)
  } >m_text

/********************************************/

 

 

The first error of several I get is:

ZS.elf section `.data' will not fit in region `m_data'

 

I have commented out the .bitmaps section, and even commented out the INPUT(Icon.bmp) line and still get the error.  So it must have something to do with the TARGET() and/or OUTPUT_FORMAT() commands?  Any help would be appreciated.

Labels (1)
0 Kudos
6 Replies

25 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Michael,

- The error message "`.data' will not fit in region `m_data'" , it shows the .data  overflow m_data section,

i think in your linker file , there is a section like :

.data:

{

...

}>m_data 

So please send your linker file and .map file to me , or you can check the .map file by yourself to find

which data overflow , or too large .

- Please pay attention to that, the memory map is difference between K22 and KL33 .

-And i have a question , does these function out put to console or UART in your project ?

INPUT(Icon.bmp)
OUTPUT_FORMAT(default)

Hope it helps

Alice


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

25 Views
michaelhuslig
Contributor IV

Alice,

Please see

https://community.nxp.com/servlet/JiveServlet/download/328202-1-362661/Merging%20applications%20usin...

to see where I originally learned how to merge a bootloader with my K22

application.

I thought it would carry over, but it didn't.

TARGET, INPUT, and OUTPUT_FORMAT are ld script commands controlling

files that can be input to the gcc linker. I got them from the "Merging

applications using Kinetis Design Studio.pdf" document.

Through trial and error, I was able to get the linker to work for the

KL33 project by changing the OUTPUT_FORMAT(default) command to

TARGET(default). I don't know why.

Mike

0 Kudos

25 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Mike,

Thanks for your sharing, i have not test this tutorial.

For size of KL33 RAM is smaller than K22, so maybe the "OUTPUT_FORMAT(default)"

need more RAM usage,  so it overflow . In the error message, does it show what the size overflowed?

BR

Alice

0 Kudos

25 Views
michaelhuslig
Contributor IV

Alice,

I sent you the wrong console file. Please do not publish it. This is

the correct on.

Mike H.

0 Kudos

25 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Michael,

OK, any way , it work well now , congratulation !

BR

Alice

0 Kudos

25 Views
michaelhuslig
Contributor IV

Alice,

The console log is attached for when I changed TARGET(default) back to

OUTPUT_FORMAT(default) in the .ld file.

There is no mention of "overflow" now, nor is there a .map file

generated. But I do remember getting a .map file before, maybe in some

other trial and error attempt. The .map file then showed m_data overflow.

I don't remember all the details anymore, only that it is now working

with TARGET(default).

Mike

0 Kudos