2.14. Coping with Low Amounts of RAM

If your target only has a small amount of RAM then you may find it difficult to fit the flash algorithm within it and for the Eclipse Flash Programmer plug-in or the test harness to allocate enough RAM for a buffer.

To cope with low amounts of RAM, you should first attempt to reduce the size of your flash algorithm. Switching to the microlib C library can save a lot of memory relative to the standard C library (see Stack and Heap and C Libraries). On processors that support both the ARM and Thumb instruction sets, you may see a reduction in code size by changing the compiler settings to use the Thumb instruction set (ARM is the default). You can also increase the compiler optimization level for the Debug configuration (defaults to ‑O0), at the expense of debug visibility; the optimization level for the Release configuration is already ‑O2.

Many of the methods in the flash algorithm are optional, for example, you do not typically need to implement the flashReadBlocks() method for NOR flash devices because the Eclipse Flash Programmer plug-in can read the contents of flash directly. You should review the flash methods you have implemented in your flash algorithm and remove any that are not absolutely necessary. All the flash methods are defined as weak, so that you can remove them completely without generating linker errors.

Assuming the flash algorithm fits into RAM, there still may not be enough RAM available to allocate a buffer big enough to hold an entire flash block. In this case, the Eclipse Flash Programmer plug-in and the test harness attempt to allocate a smaller buffer and use sub-block accesses (see Buffering).

Copyright © 2007. All rights reserved.DAI0190A