This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

memory class definitions.

Hi
i'm having a program for ST10 which has lots of variables defined. It works fine when I run it using MOnitor program i.e. through an external RAM. But when i change the settings to run it from flash, it is giving a warning after linking as follows:
"L5: section located outside class area."
I have changed my memory model to the largest option available, but stil the same problem.
Pls help
Regards
Sonali

Parents
  • If you are restricted to internal RAM (8KB for ST10F168, 12KB for ST10F269), you may easily run out of RAM. Check the linker listing file to see how much RAM each module consumes. There are ways to improve efficiency of use of RAM. Use as many const variables (especially arrays) as possible, reduce stack size (both system and user stack). Choosing larger memory model than you need will cause the compiler to generate less efficient code. Small memory model is fine for many applications and it is very efficient.
    Regards,
    Mike

Reply
  • If you are restricted to internal RAM (8KB for ST10F168, 12KB for ST10F269), you may easily run out of RAM. Check the linker listing file to see how much RAM each module consumes. There are ways to improve efficiency of use of RAM. Use as many const variables (especially arrays) as possible, reduce stack size (both system and user stack). Choosing larger memory model than you need will cause the compiler to generate less efficient code. Small memory model is fine for many applications and it is very efficient.
    Regards,
    Mike

Children
  • Hi Mike,
    thanks for the help.
    I have used arrays wherever possible. Can you give me more hints on memory management in internal as well as external RAM?

  • Sorry for the delay.
    I cannot give much advice since I don't know your application's memory layout. The warning message 'section located outside class area' means that you've run out of memory (provided you had allocated all the memory intended for the class). Make sure you have enough RAM to store all your non-const variables as well as the two stacks. To find out how the compiler allocates sections and classes, read the compiler manual (advanced programming techniques/section, group and class names). Check your project's target settings to make sure that you've specified correct memory layout.
    Regards,
    Mike.