I changed it to x80000000 but it behaved the same way. (Corrupts flash each time it runs, no activity on the flexbus)
The flexbus and mem_extend are setup with the following calls in bsp_init.c
_bsp_flexbus_setup();
_bsp_flexbus_mram_setup((uint_32)BSP_EXTERNAL_MRAM_BASE);
_mem_extend((pointer)BSP_EXTERNAL_MRAM_BASE, (uint_32)BSP_EXTERNAL_MRAM_SIZE);
static void _bsp_flexbus_setup (void)
{
VMCF5225_STRUCT_PTR reg_ptr = (VMCF5225_STRUCT_PTR)BSP_IPSBAR;
/* Enable Mini FlexBUS signals (used by external MRAM and CPLD) */
reg_ptr->GPIO.PASPAR = 0x20; /* enable CS1 operation for CPLD */
reg_ptr->GPIO.PTEPAR = 0xff;
reg_ptr->GPIO.PTFPAR = 0xff;
reg_ptr->GPIO.PTGPAR = 0xff; /* enable CS0 operation for MRAM */
reg_ptr->GPIO.PTHPAR = 0x5555;
}
static void _bsp_flexbus_mram_setup (const uint_32 base_address)
{
VMCF5XXX_MINIFB_STRUCT_PTR fb_ptr = &((VMCF5225_STRUCT_PTR)BSP_IPSBAR)->FB;
/* Enable external MRAM mapped on CS0 */
fb_ptr->CSAR0 = MCF5XXX_FBCS_CSAR_BA(base_address); /* CS0 base address */
fb_ptr->CSCR0 = 0x00000540; /* CS0 control (8bit data, 1 waitstate) */
fb_ptr->CSMR0 = 0x00070001; /* CS0 address mask and enable */
}
In the linker file there are these lines under 'SECTIONS':
___EXTERNAL_MRAM_BASE = 0x80000000;
___EXTERNAL_MRAM_SIZE = 0x00080000;
I have the external RAM tied to CS0. I didn't see anything that needed to change in the code, only the linker file was changed. Is that correct? Of course when you do this and go to recompile the BSP and application, it says there is nothing to be done because the code itself didn't change, so I made a dummy edit to force it to recompile. I'm not sure if this is normal, or I missed some definition somewhere.