View Single Post
  #10   Spotlight this post!  
Unread 20-02-2005, 01:21
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Re: Program error - "can not fit the section"

We got this error today after adding several autonomous scripts in commads.h.
The way that code is set up, it creates a large variable command_list in RAM
and also specifies that it be initialize which uses ROM space.

The processor we have has much less RAM space that ROM!

You don't need that data as a read/write variable, it will never change.

So we found that it could be declared like this:

rom struct commands comand_list[]....
^^

The "rom" tells the compiler to just put the data into ROM and not use RAM space. Be sure to change the declaration in robots.h and the defenition in commands.h to match.
__________________
Don Reid