EmbeddedRelated.com
Forums
Memfault Beyond the Launch

IAR projects for AT91SAM7S

Started by Thomas Gal October 5, 2005
Can anyone enumerate what the basic differences between a flash and
ram based project are? Fundamentally why do some of the demo projects
from the at91.com site work in the ram_debug configuration but not
under the flash_debug configuration. I would have expected those demo
projects to work correctly.

Thanks,

Tom


--- In AT91SAM7@AT91..., "Thomas Gal" <tgal1@t...> wrote:
> Can anyone enumerate what the basic differences between a flash and
> ram based project are? Fundamentally why do some of the demo
projects
> from the at91.com site work in the ram_debug configuration but not
> under the flash_debug configuration. I would have expected those
demo
> projects to work correctly.

I can tell you the basic differences, but I have not explored the
examples to tell you why specific ones work or not.

The main reason for having flash and ram projects is to use flash for
standalone (ie self-booting) configurations and the ram-based oned for
debugging (ie. loaded by an external agent). It is easier to use RAM
for debugging than flash because:
1) Download is faster and simpler. No flash erase/programming
required.
2) The ARM ICEBreaker debug cell has only limited support for flash
debugging. In particular the number of hard breakpoints that can be
supported is limited to two, of which one is typically swallowed up by
single stepping etc. Soft breakpoints use a pattern written into RAM
and are thus unlimited. Sure, you **could** reprogram flash whenever a
breakpoint is inserted etc, but this is slow and chews up your flash
lifetime.

A secondary reason is that flash programming code cannot run from
flash. The flash is busy while it is being programmed/erased which
means that the code needs to be placed in RAM to be executable during
the flash erase/programming.

Why could the flash and ram projects behave differently?
1) There are performance differences between RAM and flash. RAM is
faster. THis should however not be causing any problems in most
situations.
2) The startup code for flash builds needs to initialise RAM by
copying initialisation data into RAM.
3) The projects don't just differ in a single switch setting. They
need different initialisation code etc. Things you might try:
1) Get an update of the IAR tools (free download).
2) Step through the code analysing where it is breaking.

Sorry I could not be more helpful.



Memfault Beyond the Launch