Reply by Paul Bosselaers January 8, 20082008-01-08
senor_mike wrote:
> I'm programming the LH75410 (ARM7TDMI core) in C++ using IAR workbench > version 4.42A. > > Startup seems to run correctly. But when I execute the first instruction > in "main" I get an error message "CSTACK pointer is 0000 0000, outside > stack range". Stack range is in our RAM area, 4000 0000 - 401F FFFF, and > I believe I've written the memory descriptor file properly. The SP > register contains a valid address for the stack pointer. > > Questions are, > 1 -- What can I do about this?
In the IAR IDE go to Project Options, Debugger, Plugins, and remove the check next to Stack.
> 2 -- What's causing the problem? > 3 -- Is the CSTACK pointer the SP register? If not, what?
CSTACK is defined in your linker script. It is usually the stack used by USER/SYSTEM mode, but that depends on your startup file. If the SP register contains a valid address then don't worry about it.
> > No doubt this is a case for "rtfm", but I've read and searched all the > fm's I can find and not seen a mention of this. > > >
Reply by larwe January 8, 20082008-01-08
On Jan 8, 1:11 pm, "senor_mike" <mkr...@lumenis.com> wrote:

> in "main" I get an error message "CSTACK pointer is 0000 0000, outside > stack range". Stack range is in our RAM area, 4000 0000 - 401F FFFF, and > I believe I've written the memory descriptor file properly. The SP > register contains a valid address for the stack pointer.
Are you using hand-rolled startup code, or vendor-provided? It sounds like the RTL expects to have an internal variable initialized, separately from the machine's stack pointer. A quick Google suggests that you should have a separate CSTACK section; what does the MAP file say about CSTACK?
Reply by senor_mike January 8, 20082008-01-08
I'm programming the LH75410 (ARM7TDMI core) in C++ using IAR workbench
version 4.42A.

Startup seems to run correctly.  But when I execute the first instruction
in "main" I get an error message "CSTACK pointer is 0000 0000, outside
stack range".  Stack range is in our RAM area, 4000 0000 - 401F FFFF, and
I believe I've written the memory descriptor file properly.  The SP
register contains a valid address for the stack pointer.

Questions are,
1 -- What can I do about this?
2 -- What's causing the problem?
3 -- Is the CSTACK pointer the SP register?  If not, what?

No doubt this is a case for "rtfm", but I've read and searched all the
fm's I can find and not seen a mention of this.