95 views
in Getting started by

I am using the STM32F746G-DISCO with a different display from Newhaven Display. It is a 320 x 240 TTF. I am using RGB565. Is the SectionEwResource for the frame buffer. If so, why is EW wizard using so little memory, 81,500 bytes? What is the .rodata used for?

 

EmbeddedWizard-STM32F746-Discovery.elf  :
section                 size         addr
.isr_vector              456    134217728
.SectionEwResource     81500   2415919104
.text                 252564    134218192
.rodata                39536    134470760
.ARM                       8    134510296
.init_array                8    134510304
.fini_array                4    134510312
.data                   2548    536870912
.bss                    2976    536873460
._user_heap_stack       8704    536876436
.ARM.attributes           48            0
.debug_info           512325            0
.debug_abbrev          35849            0
.debug_loc            216428            0
.debug_aranges         11224            0
.debug_ranges          22816            0
.debug_macro          195739            0
.debug_line           169312            0
.debug_str           1159408            0
.comment                 241            0
.debug_frame           45580            0
.stab                    132            0
.stabstr                 279            0
Total                2757685

 

1 Answer

0 votes
by

Hi there,

technically the section “SectionEwResource” is only used for font and bitmaps resources and can be placed in the external flash with this section define. The framebuffer is located within the SDRAM and its memory address isn't depended to “SectionEwResource”. By the way, the framebuffer memory use is defined in "Application/Source/ewconfig.h" and basically includes following lines of code:

#define SDRAM_BASE_ADDR       0xC0000000
#define SDRAM_SIZE_BYTES      0x800000

#define EW_USE_DOUBLE_BUFFER            1

#define FRAME_BUFFER_WIDTH              480
#define FRAME_BUFFER_HEIGHT             272

/* calculated addresses for framebuffer(s) */
#define FRAME_BUFFER_ADDR     SDRAM_BASE_ADDR
#define FRAME_BUFFER_SIZE     FRAME_BUFFER_WIDTH * FRAME_BUFFER_HEIGHT * FRAME_BUFFER_DEPTH

#if EW_USE_DOUBLE_BUFFER == 1

  /* locate double-buffer at the end of the last SDRAM bank - this ensures
     that front/back-buffer are located within different banks of the SDRAM */
  #define DOUBLE_BUFFER_ADDR  (SDRAM_BASE_ADDR + SDRAM_SIZE_BYTES - FRAME_BUFFER_SIZE)
  #define DOUBLE_BUFFER_SIZE  FRAME_BUFFER_SIZE

#else

  #define DOUBLE_BUFFER_ADDR  0
  #define DOUBLE_BUFFER_SIZE  0
  #define NUMBER_OF_FIELDS    3

#endif

 

However, the needed RAM memory isn't just the .rodata, it is also the .bss part. Embedded Wizard has a dynamically memory management included, which means it not possible to estimate all needed RAM during the compilation time. This memory manager allocates and frees memory dynamically during the runtime and you can let print the sum of usage into the console by using the define “EW_PRINT_MEMORY_USAGE” within "Application/Source/ewconfig.h".

 

EW_PRINT_MEMORY_USAGE - If this macro is defined, a statistic information is
   printed reporting the amount of memory allocated by Chora objects, strings and
   resources. Additionally, the current total memory allocation and the maximum
   peak value is printed.

 

With this information you can calculate the the average and peak RAM usage of you Embedded Wizard GUI like in following table:

 

Best regards,

Tim

Embedded Wizard Website | Privacy Policy | Imprint

...