[an error occurred while processing this directive]
|
мото56ф627. CodeWarrior.
Вот командный файл линкера:
-------------------------------------------------------------------
MEMORY {
# I/O registers area for on-chip peripherals
.x_Peripherals (RW) : ORIGIN = 0x1000, LENGTH = 0
.x_CoreRegs (RW) : ORIGIN = 0xFF80, LENGTH = 0
# List of all sections specified in the "Build options" tab
.p_Interrupts (RWX) : ORIGIN = 0x00000000, LENGTH = 0x00000080
.p_Code (RWX) : ORIGIN = 0x00000080, LENGTH = 0x00007B80 #память программ
.x_Data (RW) : ORIGIN = 0x00000040, LENGTH = 0x00000FC0 #внутр ОЗУ
.x_CWRegisters (RW) : ORIGIN = 0x00000030, LENGTH = 0x00000010
#внешняя ОЗУ
.ExtData (RW) : ORIGIN = 0x00004000, LENGTH = 0x0000BF80
#Other memory segments
.x_internal_ROM (RW) : ORIGIN = 0x00002000, LENGTH = 0x1000 #xFlash
.p_internal_RAM (RWX) : ORIGIN = 0x00007C00, LENGTH = 0x0400
}
KEEP_SECTION { interrupt_vectors.text }
SECTIONS {
.interrupt_vectors :
{
F_vector_addr = .;
# interrupt vectors
* (interrupt_vectors.text)
} > .p_Interrupts
.Data_xROM :
{
* (.rodata)
} > .ExtData # куда пишем массив
.ApplicationCode :
{
F_Pcode_start_addr = .;
# .text sections
OBJECT (F_EntryPoint, Cpu.c) # The function _EntryPoint have to be placed at the beginning of the code
# section for proper functionality of the serial bootloader.
* (.text)
* (rtlib.text)
* (startup.text)
* (fp_engine.text)
* (user.text)
F_Pcode_end_addr = .;
} > .p_Code
.ApplicationData :
{
* (fp_state.data)
* (rtlib.data)
* (.data.char) # used if "Emit Separate Char Data Section" enabled
* (.data)
# .bss sections
* (rtlib.bss.lo)
* (rtlib.bss)
. = ALIGN(4);
F_Xbss_start_addr = .;
_START_BSS = .;
* (.bss.char) # used if "Emit Separate Char Data Section" enabled
* (.bss)
_END_BSS = .;
F_Xbss_length = _END_BSS - _START_BSS;
/* Setup the HEAP address */
. = ALIGN(4);
_HEAP_ADDR = .;
_HEAP_SIZE = 0x00000100;
_HEAP_END = _HEAP_ADDR + _HEAP_SIZE;
. = _HEAP_END;
/* SETUP the STACK address */
_min_stack_size = 0x00000200;
_stack_addr = _HEAP_END;
_stack_end = _stack_addr + _min_stack_size;
. = _stack_end;
/* EXPORT HEAP and STACK runtime to libraries */
F_heap_addr = _HEAP_ADDR;
F_heap_end = _HEAP_END;
F_Lstack_addr = _HEAP_END;
F_StackAddr = _HEAP_END;
F_StackEndAddr = _stack_end - 1;
# runtime code __init_sections uses these globals:
F_Ldata_size = 0x0000;
F_Ldata_RAM_addr = 0x0000;
F_Ldata_ROM_addr = 0x0000;
F_xROM_to_xRAM = 0x0000;
F_pROM_to_xRAM = 0x0000;
F_start_bss = _START_BSS;
F_end_bss = _END_BSS;
__DATA_END=.;
} > .x_Data
# peripheral registers
FCoreIO = ADDR(.x_CoreRegs); /* Core registers */
}
------------------------------------------------------------------
определяю массив так:
-----------------------------------------------
#pragma use_rodata on
const unsigned int data[1000] = {1,2,3,...};
#pragma use_rodata off
-----------------------------------------------
Во внешнюю ОЗУ пишет хорошо. Когда линкеру говорю, что надо писать в p_Code или x_internal_ROM, туда не записывает, то что надо.
Вродь понятно объяснил :-)
Где косяк может быть?
E-mail: info@telesys.ru