ARM Technical Support Knowledge Articles

VARIABLES IN LARGE AND COMPACT MEMORY MODEL DON'T WORK

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOMS

I have a project using an 8051 with 32KB external RAM. If I use SMALL memory model with some variable explicitly defined to use external data memory like:

int xdata aaa[100];

everything complies OK and works fine. But, if I use compact or large memory model, my program complies ok but the board just won't work.

CAUSE

All the memory model option controls is the default location of variables declared without a memory specifier. Small memory model will put unspecified variables in DATA, Compact uses PDATA, and Large uses XDATA. If your hardware is having trouble with builds under other memory models, chances are the board is not set up properly to handle the accesses you're now performing.

Article last edited on: 2000-09-10 00:00:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential