Author Topic: IAR; different code debug & release size; queries  (Read 3047 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
IAR; different code debug & release size; queries
« on: December 08, 2014, 08:23:38 am »
1. I have made code in IAR which I have attached.
2. I have made same debug & release optimization setting i.e High, Speed, No size constraint.
Surprisingly code generated in both are different even if optimization settings are same even if there is no additional code in debug or release.
3. Code is just:

Code: [Select]
#include "stm8s.h"

int main( void )
{
  return 0;
}


4. Size in debug :
read only code memory = 106 bytes
read only data memory = 128 byte
read write data memory = 256 bytes

5. Size in release:
read only code memory = 63 bytes
read only data memory = 128 byte
read write data memory = 256 bytes


Questions:
1. Why different code size?
2. I didn't find any map file generated?
3. Is there not any zero initialized data in memory?
All vars declared go to read write memory?
e.g if I decalre uint8_t var; it goes to read write memory.
Even if I don't assign any value to it.

4. Is flash & ram size are below:

flash size = read only code memory+ read only data memory+read write data memory
ram size = read write data memory

 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8637
  • Country: gb
Re: IAR; different code debug & release size; queries
« Reply #1 on: December 08, 2014, 08:44:57 am »
Is that size difference because different libraries are being linked in? It depends on the particular MCU, but for many IAR has to link in a library with a couple of debug related routines when you build for debugging.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13736
  • Country: gb
    • Mike's Electric Stuff
Re: IAR; different code debug & release size; queries
« Reply #2 on: December 08, 2014, 09:51:59 am »
Look at the disassembly output to see what it's doing.
If it's not generating a map file, there will be a linker option to enable it.
Somewhere there will be all the settings for the debug & release configs - looking at what these settings are will probably tell you what the differences are.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf