Other method I use to use external MRAM is declare the location of same variables using the linker command file.
MEMORY
{
......
ram (RW): ORIGIN = 0x20000000, LENGTH = 0x00010000 # SRAM - RW data
ram2 (RW): ORIGIN = 0x10000000, LENGTH = 0x00010000 # MRAM - RW data
.......
}
SECTIONS
{
................
___EXTERNAL_MRAM_BASE = 0x10000000;
___EXTERNAL_MRAM_SIZE = 0x00080000;
___EXTERNAL_MRAM_ROM_BASE = 0x10010000;
___EXTERNAL_MRAM_ROM_SIZE = 0x00000000;
___EXTERNAL_MRAM_RAM_BASE = 0x10010000;
___EXTERNAL_MRAM_RAM_SIZE = 0x00070000;
..........
.main_application_bss2 :
{
data_c.obj (.bss)
} > ram2
.main_application_bss :
{
__START_SBSS = .;
*(.sbss)
*(SCOMMON)
__END_SBSS = .;
__START_BSS = .;
*(.bss)
*(COMMON)
__END_BSS = .;
} >> ram
..........
}
in data.c file:
/* * data.c * * Created on: 15-abr-2011 * Author: Marcos Di Fazio * * Todas las variables globales definidas en este modulo de * compilación van a ir a parar al espacio de memoria de MRAM * Esto se define desde el linker command file. */// Buffer para textos de registros.char scrRegistros_txtBxTextMRAM[1000];
Hardware:
TWR-KIT-MCF5225X
TWR-MEM
TWR-LCD
Software
eGUI 2.07
MQX 3.7
CW10.1