Skip to main content
Visitor II
September 29, 2004
Question

Long addressing RAM

  • September 29, 2004
  • 3 replies
  • 861 views
Posted on September 29, 2004 at 06:06

Long addressing RAM

    This topic has been closed for replies.

    3 replies

    denglarAuthor
    Visitor II
    September 28, 2004
    Posted on September 28, 2004 at 09:22

    Hi,

    I'm in trouble with a ST72F521R9: I need to store a large constant array (1024 float elements) in sector2, how can I do?

    I tried using both ''small memory model'' and ''large memory model'' but in any case the array will be allocated in sector0 (addresses 0xF19D and 0xF1F1 depending on memory model). This, declaring the array as ''float const''.

    Moreover, if I try to declare in RAM a float array, It's limited to 26 elements (more elements make the linker return an overflow error involving .data segment).; this because all variables (any type) will be allocated in short addressing RAM in both memory models. I tried forcing them @near, but with no result.

    I'm using STVD7 (simulator) with Cosmic compiler. I made no changes to the default segments settings in the linker options.

    Where I'm wrong?

    Regards

    Dree

    Visitor II
    September 28, 2004
    Posted on September 28, 2004 at 13:46

    If the table is in rom then it needs declaring as const, eg.

    const unsigned char* const pArray[]={

    ....

    };

    Regards

    sjo
    Visitor II
    September 29, 2004
    Posted on September 29, 2004 at 06:06

    in addition to what sjo says, if you want your table to be in a specific sector, you need to tell the compiler to put it at an address within that sector; see

    http://www.cosmicsoftware.com/faq/faq3.php

    how to that.

    Regards,

    Luca (Cosmic)