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

code flash

hi

i am using P89V51RD2FN device and it has 64KB code flash memory.and use MIKROC compiler. my program is of 30KB when i compile it gives error of not enough RAM so i want to move my whole program in code flash memory but problem is that i don't no how address flash memory? if any one have solution please help me

Parents
  • As far as I know, your program should already be in flash memory. If you don't have enough RAM, maybe you use some big data structures which are in RAM, but which can be in flash.
    If you have local variable

    int array[128];
    

    it needs 512bytes RAM.
    You can move it in flash using the 'const' qualifier.

    const int array[128] = {...};
    

    Of course, if it is const, you should initialize it and you cannot modify array's values at runtime.

Reply
  • As far as I know, your program should already be in flash memory. If you don't have enough RAM, maybe you use some big data structures which are in RAM, but which can be in flash.
    If you have local variable

    int array[128];
    

    it needs 512bytes RAM.
    You can move it in flash using the 'const' qualifier.

    const int array[128] = {...};
    

    Of course, if it is const, you should initialize it and you cannot modify array's values at runtime.

Children