Why do I receive an error when building using Embedded Target for the Motorola MPC555 1.1 (R13SP1) when I change the "Target memory model" parameter to Flash?

1 view (last 30 days)
I am trying to build a model using Embedded Target for Motorola MPC555. I open the Simulink Parameters dialog box and select the Real-Time Workshop tab. I change the "System Target fie" parameter to mpc555rt.tlc. I change the Category to MPC555-DK (real-time) options. Here I change the "Target memory model" parameter from RAM to Flash? I receive the following error when I build:
dld: Cannot allocate 0x00000db8 bytes of memory for 'group
.application_bios,.data,.sdata,.sdata2,.sbss,.bss'
dld: Memory area 'iram' is full
gmake: *** [Target_IO_flash.s19] Error 0x1

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Jul 2010
During execution of an Internal Flash application, various data sections and the stack are located in Internal RAM. This constrains the RAM usage of the application and can lead to the error above.
To work around this issue, try the following:
A. Reducing the RAM requirements of the model:
This is the recommended solution, and will result in a more efficient application. The following is a list of suggestions that reduce RAM.
a. Use integer datatypes instead of floating point datatypes where possible.
b. Use single precision floating point datatypes instead of double precision where possible.
c. Review the model design, and attempt to optimise inefficient areas
d. Ensure that optimizations such as parameter in-lining are switched on.
B. Modifying the Internal Flash memory model configuration to use External RAM:
The location of the stack can be moved from Internal RAM into External RAM. This allows all of the Internal RAM memory to be used for storage of the data sections of the application, and avoids the possibility of a stack overflow into application data during execution.
As an example for the WindRiver Diab toolchain, the required modifications are:
1. Replace your versions of the following files with the ones provided with this solution.
a. Rename the following DLD-file and S-file:
$MATLABROOT\toolbox\rtw\targets\mpc555dk\drivers\make_plugins\internal_flash\internal_flash.dld
$MATLABROOT\toolbox\rtw\targets\mpc555dk\drivers\src\applications\bootcode\bootcode_init.s
(where $MATLABROOT = the MATLAB root directory on your machine)
Rename the file to internal_flash.dld.old and bootcode_init.s.old.
b. Download the files linked at the bottom of the page and place them in the same directory mentioned in step 2.
2. Choose MATLAB Start Menu->Simulink->Embedded Target for Motorola MPC555->Build MPC555 Driver Library-> CLEAN to clean the old bootcode.
3. Choose MATLAB Start Menu->Simulink->Embedded Target for Motorola MPC555->Build MPC555 Driver Library-> SPEED | SIZE | DEBUG to build the new bootcode with optimizations of your choice (default == SPEED)
4. Download the new bootcode to the MPC555 using the mechanism described in the documentation.
5. Rebuild your Flash application and download it.
6. The stack should now be located in External RAM.

More Answers (0)

Products


Release

R13SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!