Skip to main content
ys1
Associate
February 4, 2016
Question

Usage Flash and SRAM

  • February 4, 2016
  • 0 replies
  • 461 views
Posted on February 04, 2016 at 01:24

Hello

I'm using the IAR compiler.

As you know, I can get the usage of Flash and SRAM inside of ST32f429 from ''Map'' file.

But I need to get those value on the my source code.

Is there any solution to get usage when compile time.

Here is my code but it didn't get right usage value.

#pragma segment=''.text''

#pragma segment=''.rodata''

#pragma segment=''HEAP''

VOID MakeFreeInfo(VOID)

{

unsigned int end_of_prog_text;

unsigned int end_of_prog_rodata;

unsigned int end_of_data;

/* Get end of program address */

end_of_prog_rodata = ((U32) __sfe(''.rodata'') + 4) & 0xFFFFFFFC;       

end_of_prog_text = ((U32) __sfe(''.text'') + 4) & 0xFFFFFFFC;

if (end_of_prog_rodata > end_of_prog_text)

 {

USAGE_FLASH = end_of_prog_rodata - Addr_ROM;

 }

else

 {

USAGE_FLASH  = end_of_prog_text - Addr_ROM;

 }

.

.

.

}

Thank you,

Young
    This topic has been closed for replies.