This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to set memory in IAR, including How to set ram size in IAR

I know the Project options can be configured in the iar_nRF5x.icf file, but there is no option for ram size. If the RAM start and end is given, I guess that is the ram size.

Also, it is not clear why to specify the Ram size. As long as the MAP file indicates a lower RAM size needed than the total, it is OK?

Then how does one figure out the stack and heap?

define symbol ICFEDIT_intvec_start = 0x1f000;

/-Memory Regions-/ define symbol ICFEDIT_region_ROM_start = 0x1f000;

define symbol ICFEDIT_region_ROM_end = 0x7ffff;

define symbol ICFEDIT_region_RAM_start = 0x20002fff;

define symbol ICFEDIT_region_RAM_end = 0x2000ffff;

export symbol ICFEDIT_region_RAM_start;

export symbol ICFEDIT_region_RAM_end;

/-Sizes-/

define symbol ICFEDIT_size_cstack = 0x800;

define symbol ICFEDIT_size_heap = 0x200;

/**** End of ICF editor section. ###ICF###*/

Any help appreciated

Parents
  • You should set the IAR IDE RAM Start to what app_ram_base displays, i.e. it should be set to 0x20001ff0 when it prints 0x20001ff0.

    The reset indicates that you are running into the error handler, the default behavior is then to reset. You should then debug in order to find the reason for the reset. Here is a post about that for Keil.

    For IAR you should do this:

    • Build without optimization and make sure that debug info is included in output (enable checkbox in project options -> C/C++ Compiler -> Output tab.

    • Add "DEBUG" to the list of pre-processor symbols in project options -> C/C++ Compiler -> preprocessor tab, see "defined symbols" field

    • Start a debug session, place a breakpoint at line ~113 in app_error.c and see if it gets reached. You can read out the error code and line number if it does.

  • Sigurd,

    Thanks for the information.

    See also my comment here.

Reply Children
No Data
Related