(I shouldn't of named the file "mac_address.c". It isn't a mac address I am storing.)
I am using CW 10.2.
My lcf file and design was working fine. However I would like to be able to initialize a location in flash to a particular value.
I am using the MCF52233 and want to initialize location 0x3F010 to 0xff just for starters so I can understand how to do it.
Here is what I did:
I modified the working lcf file in the following fashion:
from
MEMORY {
vectorrom (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000020
code (RX) : ORIGIN = 0x00000500, LENGTH = 0x0003FB00
vectorram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
userram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00007C00
}
to
MEMORY {
vectorrom (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000020
code (RX) : ORIGIN = 0x00000500, LENGTH = 0x0003F000
flashtest (RX) : ORIGIN = 0x0003F010, LENGTH = 0x00000001
vectorram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
userram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00007C00
}
Then I added the following
From:
.bss :
{
___BSS_START = .;
__START_SBSS = .;
*(.sbss)
. = ALIGN (0x4);
*(SCOMMON)
__END_SBSS = .;
__START_BSS = .;
*(.bss)
. = ALIGN (0x4);
*(COMMON)
__END_BSS = .;
___BSS_END = .;
. = ALIGN(0x4);
} >> userram
.custom :
{
___HEAP_START = .;
___heap_addr = ___HEAP_START;
___HEAP_END = ___HEAP_START + ___heap_size;
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + ___stack_size;
. = ALIGN (0x4);
} >> userram
TO:
.bss :
{
___BSS_START = .;
__START_SBSS = .;
*(.sbss)
. = ALIGN (0x4);
*(SCOMMON)
__END_SBSS = .;
__START_BSS = .;
*(.bss)
. = ALIGN (0x4);
*(COMMON)
__END_BSS = .;
___BSS_END = .;
. = ALIGN(0x4);
} >> userram
.flashtest :
{
mac_address.c(.text)
. = ALIGN(0x10);
} >flashtest
.custom :
{
___HEAP_START = .;
___heap_addr = ___HEAP_START;
___HEAP_END = ___HEAP_START + ___heap_size;
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + ___stack_size;
. = ALIGN (0x4);
} >> userram
Then I created a "c" file named mac_address.c and within that file I have the following line:
const uint8 bob = 0xff;
Then I went to project-properties-settings-coldfire linker- Input and added to the"library search paths" the path to the mac_address.c file.
However, Codewarrior still says it cannot file mac_address.c