Hello,
I'am using Eclipse with ARM-GCC. For my controller (MAC7111) I have to
implemend a struct at a fixed adres of 0x400 to prevent the FLASH from
beeing secured.
With the code below I get the security at the right adres but not the
start-up code etc at adres 0x0.
What I want is the start-up code at adres 0x0 and the rest of the code
starting at adres 0x500.
Does anyone known how to adjust the linker script to get this done?
Thnx for your help!
Struct looks like :
struct FLash_Configuration_Field
{
unsigned long Backdoor_Comparison_Key 1;
unsigned long Backdoor_Comparison_Key 2;
unsigned long Program_Flash_Protection_Bytes ;
unsigned long Program_Flash_SUPV_Access_Bytes ;
unsigned long Program_Flash_DATA_Access_Bytes ;
unsigned long Flash_Security_Word ;
unsigned char Data_Flash_Protection_Byte ;
unsigned char Data_Flash_SUPV_Access_Byte ;
unsigned char Data_Flash_DATA_Access_Byte ;
} ;
_attribute_ ((section(".security")))
const struct FLash_Configuration_Field MyConfig =
{
0xABABABAB, // Backdoor_Comparison_Key 1
0xABABABAB, // Backdoor_Comparison_Key 2
0x00000000, // Program_Flash_Protection_Bytes
0x00000000, // Program_Flash_SUPV_Access_Bytes
0xFFFFFFFF, // Program_Flash_DATA_Access_Bytes
0x80000002, // Flash_Security_Word
0x00, // Data_Flash_Protection_Byte
0xFF, // Data_Flash_SUPV_Access_Byte
0x00 // Data_Flash_DATA_Access_Byte
} ;
I've created a extra entry in the linker file like:
MEMORY
{
rom : org = 0x00000000, len = 512k
rom_start : org = 0x00000400, len = 2k
}
/*
* Do not change the next code
*/
SECTIONS
{
.text :
{
*(.security);
. = ALIGN(4);
} > rom_start
.text :
{
*(.vectors);
. = ALIGN(4);
*(.init);
. = ALIGN(4);
*(.text);
. = ALIGN(4);
*(.rodata);
. = ALIGN(4);
*(.rodata*);
. = ALIGN(4);
*(.glue_7t);
. = ALIGN(4);
*(.glue_7);
} > rom
.text :
{
. = ALIGN(4);
etext = .;
} > rom_start
.data :
{
PROVIDE (__data_start = .);
*(.data)
. = ALIGN(4);
edata = .;
_edata = .;
PROVIDE (__data_end = .);
} > rom
.bss :
{
PROVIDE (__bss_start = .);
*(.bss)
*(COMMON)
. = ALIGN(4);
PROVIDE (__bss_end = .);
. = ALIGN(256);
PROVIDE (__stack_start = .);
PROVIDE (__stack_fiq_start = .);
. += FIQ_STACK_SIZE;
. = ALIGN(4);
PROVIDE (__stack_fiq_end = .);
PROVIDE (__stack_irq_start = .);
. += IRQ_STACK_SIZE;
. = ALIGN(4);
PROVIDE (__stack_irq_end = .);
PROVIDE (__stack_abt_start = .);
. += ABT_STACK_SIZE;
. = ALIGN(4);
PROVIDE (__stack_abt_end = .);
PROVIDE (__stack_und_start = .);
. += UND_STACK_SIZE;
. = ALIGN(4);
PROVIDE (__stack_und_end = .);
PROVIDE (__stack_svc_start = .);
. += SVC_STACK_SIZE;
. = ALIGN(4);
PROVIDE (__stack_svc_end = .);
PROVIDE (__stack_end = .);
PROVIDE (__heap_start = .);
} > rom
}
/*** EOF ***/