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

Re Help Required: How to use onchip flash to store variables?

Hi devlopers,

I am usign LPC 2138 ARM controller right now. It has only 32 Kb of SRAM, I have one array say
" char Table[300][300] " of approx. 100 Kb.

I want to store this table in on chip flash memory which is 512 Kb, can anyone guide me how to accomplish this task.

I am using Keil u vision3 compioler and MCB 2138 board [having LPC2138 controller], and using flash programming with LPC flash utility [COM].

Thanks in advance,
Saurabh Pandya

Parents
  • Andy wrote:
    the C51 compiler certainly can [generate flash programming sequences for assignment statements]

    Can you give me a pointer to the right manual and section? "Flash" only occurs a couple of times in the C51 manual, nor did anything in the library manual jump out at me. I'd expect some sample code in the lib directory as well, so you could customize the hooks to an unusual flash type if necessary.

Reply
  • Andy wrote:
    the C51 compiler certainly can [generate flash programming sequences for assignment statements]

    Can you give me a pointer to the right manual and section? "Flash" only occurs a couple of times in the C51 manual, nor did anything in the library manual jump out at me. I'd expect some sample code in the lib directory as well, so you could customize the hooks to an unusual flash type if necessary.

Children
  • "Can you give me a pointer to the right manual and section? "Flash" only occurs a couple of times in the C51 manual,"

    It would be done via the XDATA banking support.

    There are examples for working with EEPROM such that 'C' variables can be located in EEPROM (including serial EEPROM) and accessed "apparently" just like any other 'C' variable.

    I'm sure you should be be able to adopt the same techniques for flash...


    Note: this is C51 - I don't know if any or all of the ARM compilers has anything similar.

  • Dear Devlopers.

    I have checked IAP capabilities in Phlips LPC 2138. Seems it allows devloper to write
    whole 512/1024/.../4xxx bytes in to flash
    memory using various IAP commands. as per
    give in LPC_2132_2138 User mannual.

    But How can I read those data/ part of data written in to flash - back to RAM array.

    Regards & Thanks
    Saurabh Pandya

  • How did u read back from Flash location in IAP, because I didn't get any command for it in the manual.
    One more thing about IAP, whether IAP is only used for run-time programming? Means when program is running in device and without stopping that program we want to load new program then only IAP is used? Is it so? Please clear this doubt...I am confused about this..

    to store variables in flash in runtime, isn't it possible in ISP?

  • ISP means In-System Programming (or "Programmable")
    This means that the chip can be programmed in-situ, without having to be removed and placed into a special programming tool.

    IAP means In-Application Programming (or "Programmable")
    This means that the chip can be programmed while it is still running its Application.

    Clearly, IAP requires ISP.

    However, ISP does not imply IAP

    In many cases where IAP facilities are provided, they are intended for code storage - they not well suited to data storage.

  • "How to read back from flash"

    ARM processors generally have continous memory map, Review the memory map of your controller. You can directly read data from flash locations [using some mean of pointers]

    Yes, IAP is real time. Its allows to read and write flash during program execution. And offcourse you can update your program ,using IAP that is firmware update. But I dont have much information about this.