AS 6.1 always reports ram full after build

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Freaks,

since the recent update to AS 6.1 it does display memory usage for flash and ram automatically at the end of the build. This is nice, but it does not work as i would think it should, at least on UC3. It does report for even the smallest project that the ram is nearly full or even exhausted:
text data bss dec hex filename
9796 0 65532 75328 12640 CLOCK_EXAMPLE11_ASF313.elf
(This is the report for a small ASF demo program with only a few lines...)

Code size extension shows 99% ram usage for this example.

Toolchain settings should be pretty standard.
If you need more information let me know.

Any ideas?

Thanks Holger

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe it's related to the "*default*" section, whatever this is??

From the map file:

Memory Configuration

Name Origin Length Attributes
FLASH 0x80000000 0x00080000 axrl !w
INTRAM 0x00000004 0x0000fffc axw !rl
HRAM0 0xa0000000 0x00001000 axw !rl
USERPAGE_RESERVED 0x80800000 0x00000004 r
USERPAGE 0x80800004 0x000001fc
*default* 0x00000000 0xffffffff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
text data bss   dec   hex   filename
9796   0  65532 75328 12640 CLOCK_EXAMPLE11_ASF313.elf 

Well clearly there's only 9,796 bytes in flash so the figure for code is wrong but that .bss figure of ~64K looks HUGE for a 9K program. Are you really using a few bytes short of 64K for .bss? If not I imagine that's what's actually causing the Atmel post processing of the size to behave "oddly".

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's exacty what i mean - i can't see that this amount of memory is actually used and if i understand the map file correctly it really isn't. So the question is, why does avr32-size reports this huge usage?

Here's the code:

    #include #include
    #include
    #include
    #include

    int main(void)
    {
    sysclk_init();
    board_init();

    while (1) {
    gpio_toggle_pin(LED0_GPIO);
    delay_ms(500);
    }
    }

Pretty simple (short of the ASF part...)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

btw. i get these huge ram usage reports for all uc3 projects i currently work on.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could you try the Data Size Viewer extension and see if anything stands out? (it's just a pretty gui on avr-nm)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

btw, nice extension!

No, it doesn't show anything large. Biggest Data segment is the _int_handler_table with 376 bytes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look inside the linker file. The current setting is that the heap will consume all remaining space. When you e.g. set the heap to zero, the output will tell you the used ram + configured stack.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi PeteAVR,

thank you very much, that's it!

I changed heap size to 0 for a test and i get:

text data bss dec hex filename
9796 0 4556 14352 3810 CLOCK_EXAMPLE11_ASF313.elf

Do you know if it's possible to set the __heap_size__ variable in the project linker options in AS 6.1? That would allow for an easier checking during development without editing the file.