AnsweredAssumed Answered

(MPC5674F) How to normally allocate all program variable data to external memory?

Question asked by Chung Ho Hwang on Aug 27, 2017
Latest reply on Aug 29, 2017 by David Tosenovjan

Development environment:
- Code Warrior IDE version 5.9.0

 

I am developing using the MPC5674F. The target board is equipped with external memory (SRAM).

In order to allocate all program variable data to external memory (SRAM), I modified the code in the LCF file as follows:


* File name : MPC5674F_MVx264.lcf

 

MEMORY
{
......
// Add External Memory area
EXSRAM : org = 0x20000000, len = 0x001FFFFF
}

SECTIONS
{
......
// Delete program data allocation default code
/*
GROUP : {

.__uninitialized_intc_handlertable ALIGN(20) : {}

.data : {}
.sdata : {}
.sbss : {}
.sdata2 : {}
.sbss2 : {}
.bss : {}
} > internal_ram
*/

// Add program data allocation code

GROUP : {

.__uninitialized_intc_handlertable ALIGN(20) : {}

.data : {}
.sdata : {}
.sbss : {}
.sdata2 : {}
.sbss2 : {}
.bss : {}
} > EXSRAM

.......
......

}


And then, I modified the code to do setting EBI (External BUS Interface) as follows.


* File name : __PPC_eabi_init.c

 

asm void __init_user(void)
{
.....
.....
// Call SetExternalBusInterface() function for External Bus Interface initialization
bl SetExternalBusInterface

 

frfree
blr

}


After, The build was done well and I confirmed that variables are allocated in the external memory (SRAM) using the debugger and map file.

 

However, the variable values was not initialized and the garbage value was stored.
I want to know what's wrong.

 

How to normally allocate all program variable data to external memory?

Outcomes