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.