1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Not enough memory to declare global variable.

Discussion in 'Embedded' started by bokiteam, Jan 13, 2006.

  1. bokiteam

    bokiteam Guest

    Hi All,

    My MCU can't support me to declare large enough memory to store my byte
    arrary data, what can I do?

    Could you please advice?

    Thank you very much!

    Best regards,
    Boki.
     
    bokiteam, Jan 13, 2006
    #1
    1. Advertisements

  2. bokiteam

    Richard Guest


    Stating the obvious, use a different processor, add more memory, or optimise
    your program.

    + Can you analyse your code to see if any variables can use smaller data
    types (bits for Booleans rather than bytes, etc), or
    + Share a memory location (i.e. are variables used in a mutually exclusive
    way so can be overwritten), or
    + Does all the global data really need to be global? or
    + Can you work with a smaller stack allocating more RAM to global data?

    If you get down to this then i would suggest your application is not
    supportable on your current hardware, and you are on a hiding to nothing
    anyway.

    Good luck!

    Richard.

    http://www.FreeRTOS.org
     
    Richard, Jan 13, 2006
    #2
    1. Advertisements

  3. bokiteam

    Ico Guest

    I think we need some more details on your problem; what memory are you
    short on, RAM, ROM ? What kind of data do you need to store, and how do
    you want to access it ? Apart from adding memory (which might or might
    not be possible on your platform) you could try some tricks with
    compression or storing your data in another way.
     
    Ico, Jan 13, 2006
    #3
  4. With lots of unused cpu power, you could consider
    compressing the memory contents.

    Rene
     
    Rene Tschaggelar, Jan 13, 2006
    #4
  5. bokiteam

    Pete Fenelon Guest

    Buy a bigger one.


    HTH
    HAND.

    pete
     
    Pete Fenelon, Jan 13, 2006
    #5
  6. Ah, the ever-cryptic Boki strikes again. Details?


    Best regards,
    Spehro Pefhany
     
    Spehro Pefhany, Jan 13, 2006
    #6
  7. Hire somebody with a clue.
     
    Grant Edwards, Jan 13, 2006
    #7
  8. Figure out how much memory you need before choosing the micro.
     
    Mike Harrison, Jan 13, 2006
    #8
  9. Always a challenge.......


    martin
     
    martin griffith, Jan 13, 2006
    #9
  10. bokiteam

    rTrenado Guest

    Well, you could use brute force!

     
    rTrenado, Jan 14, 2006
    #10
  11. That's always the problem with arrary data. It's too much and it
    don't fit.
     
    Frank Bemelman, Jan 14, 2006
    #11
  12. bokiteam

    bokiteam Guest

    Clear procedure to improve problem.

    Thanks a lot.

    Best regards,
    Boki.
     
    bokiteam, Jan 16, 2006
    #12
  13. bokiteam

    bokiteam Guest

    but, there are no too many similar data ...

    and I have to program the algorithm first, and it also occupy memory,
    am I right? :)

    Best regards,
    Boki.
     
    bokiteam, Jan 16, 2006
    #13
  14. bokiteam

    bokiteam Guest

    In fact, it is not a MCU.

    it is a RF CHIP, and can run C language.

    Best regards,
    Boki.
     
    bokiteam, Jan 16, 2006
    #14
  15. bokiteam

    bokiteam Guest

    Hi All,

    I foudn the chip provides programmer to use a function to allocate a
    memory block and return a pointer, when I got a pointer, I don't know
    how to assign variable continually,

    /* GetPointer(T) is a function that allocate memory size (T) and return
    the pointer(byte) */
    ex:
    Now, I have to assign data as:

    unsigned char *A = 0;
    A = (unsigned char *)GetPointer(255);

    A[0]=123;
    A[1]=312;
    ....
    ....
    A[255]=xxx;

    Is that the only way?
    Thank you very much for your kindly advice!

    Best regards,
    Boki.
     
    bokiteam, Jan 16, 2006
    #15
  16. bokiteam

    Ico Guest

    Hello Boki,

    Please, *please* quote the appropriate part of the message you are
    replying to. Read http://cfaj.freeshell.org/google/ why you should
    be doing this.

    We might be able to help you with this, but you still have to provide
    some details for that. What kind of project are you working on, what
    processor are you using, how much RAM/ROM/FLAST/etc is available there,
    what data are you trying to store, etc etc
    Ofcourse, but there's different kinds of memory; since we do not know
    anything about your platform, we can not give you any hints on
    decreasing code or data size. If you want help, tell us more.
     
    Ico, Jan 16, 2006
    #16
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.