29 views
in Embedded Wizard Studio by

Hello

We are converting the project from EW9.3 to EW11.0.

The first time load an image (480 x 530) or similar size to the screen that I used as a wallpaper, it appears to have stopped momentarily.

And when loading the image, RAM usage increases momentarily.

There is no problem with small images ( 50 x 50, 32 x 32 etc. ).

It doesn't matter in EW 9.3 project. Hardware drivers (LCD, Touch, etc.) are the same.

 

 

 

Custom-made boards in use

 - STM32F429II

 - External SDRAM (8MB)

 - LTDC, Graphic accelerator, Double buffer used

 - RTOS not used

 

- Background image ( 800 x 480, PNG file size is 2.36Kb, format 'native' )

 

 

- simulator display ( 800 x 480, class name is 'PageHome' )

 

 

- Memory usage the first time load a background image (Rightmost vertical bar)

 

 

Thank you.

1 Answer

0 votes
by
 
Best answer
Hello,

thank you for providing some application details - however, it is not fully clear to me, what the question is.

Do you mean, that loading the image with version 9.30 was faster than with version 11.00? If this is the question, please provide the ewconfig.h files that you are using in both cases.

Concerning the memory peak that you see within the Memory Usage Window: Please note, that images are usually stored compressed in the Flash memory and that they have to be loaded and decompressed into the RAM when they are used. The necessary memory for a bitmap resource with native color format is width x height x 4 bytes (RGBA8888) - this means for your background image with 480x530 pixel 993 KBytes are allocated.

Does this answer your question?

Best regards,

Manfred.
by

Thank you for your quick reply.

Unfortunately, I do not have the ewconfig.h file in Ew9.3.

Required Define entries are scattered across multiple source files.

but, I am attaching the ewconfig.h file from Ew11.0.

 

#define EW_PLATFORM_STRING    "Hantas-MDTC"

#define SDRAM_BASE_ADDR       0xD0000000
#define SDRAM_SIZE_BYTES      0x1000000

#define EW_USE_TERMINAL_INPUT 0
#define EW_CPU_LOAD_MEASURING 0

#define RTC_MINIMUM_TIME      978307200      /* 2001-01-01 0:00 */
#define RTC_DEFAULT_TIME      1619535600     /* 2021-04-27 15:00 */

#define EW_USE_EXTERNAL_FLASH 0

#if EW_USE_EXTERNAL_FLASH == 1

  #define EW_BITMAP_PIXEL_SECTION_NAME .SectionEwResource
  #define EW_FONT_PIXEL_SECTION_NAME   .SectionEwResource
  #define EW_FONT_DATA_SECTION_NAME    .SectionEwResource
  #define EW_CONST_STRING_SECTION_NAME .SectionEwResource

#endif


#define EW_USE_DOUBLE_BUFFER            1

#define EW_DISPLAY_WIDTH                800
#define EW_DISPLAY_HEIGHT               480

#define EW_FRAME_BUFFER_WIDTH           800
#define EW_FRAME_BUFFER_HEIGHT          480
#define EW_FRAME_BUFFER_DEPTH           2

/* calculated addresses for framebuffer(s) */
#define EW_FRAME_BUFFER_ADDR            SDRAM_BASE_ADDR
#define EW_FRAME_BUFFER_SIZE            (EW_FRAME_BUFFER_WIDTH * EW_FRAME_BUFFER_HEIGHT * EW_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 EW_DOUBLE_BUFFER_ADDR         (EW_FRAME_BUFFER_ADDR + EW_FRAME_BUFFER_SIZE)
  #define EW_DOUBLE_BUFFER_SIZE         EW_FRAME_BUFFER_SIZE

#else

  #define EW_DOUBLE_BUFFER_ADDR  0
  #define EW_DOUBLE_BUFFER_SIZE  0
  #define EW_NUMBER_OF_FIELDS    3

#endif

#define EW_USE_GRAPHICS_ACCELERATOR     1



#define EW_TOUCH_AREA_MIN_X                    0
#define EW_TOUCH_AREA_MIN_Y                    0
#define EW_TOUCH_AREA_MAX_X                    480
#define EW_TOUCH_AREA_MAX_Y                    800
#define EW_TOUCH_SWAP_XY                       0

// #define EW_PRINT_TOUCH_DATA
// #define EW_PRINT_TOUCH_EVENTS



#define EW_MEMORY_POOL_ADDR      (EW_DOUBLE_BUFFER_ADDR + EW_DOUBLE_BUFFER_SIZE)
#define EW_MEMORY_POOL_SIZE      (SDRAM_SIZE_BYTES - EW_FRAME_BUFFER_SIZE - EW_DOUBLE_BUFFER_SIZE)

#define EW_EXTRA_POOL_ADDR       0
#define EW_EXTRA_POOL_SIZE       0


// #define EW_PRINT_MEMORY_USAGE
// #define EW_DUMP_HEAP

// #define EW_SUPPORT_GFX_TASK_TRACING
// #define EW_PRINT_GFX_TASKS
// #define EW_PRINT_PERF_COUNTERS
// #define EW_USE_IMMEDIATE_GARBAGE_COLLECTION


#define EW_MAX_STRING_CACHE_SIZE      0x4000
#define EW_MAX_SURFACE_CACHE_SIZE   0x800000
#define EW_MAX_GLYPH_SURFACE_WIDTH       256
#define EW_MAX_GLYPH_SURFACE_HEIGHT      256
#define EW_MAX_ISSUE_TASKS               256


#define EW_LAZY_LOAD_BITMAPS                              1
#define EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY             1
#define EW_DISCARD_BITMAPS                                1
#define EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY               1
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE  0
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES  0
#define EW_CACHE_OFFSCREEN_SURFACES                       0


// #define EW_DONT_USE_WARP_FUNCTIONS
// #define EW_DONT_USE_PATH_FUNCTIONS
// #define EW_DONT_USE_BIDI_FUNCTIONS
// #define EW_DONT_USE_GRADIENTS
// #define EW_DONT_USE_COMPRESSION
// #define EW_DONT_USE_INDEX8_SURFACES
// #define EW_DONT_USE_RGB565_SURFACES
// #define EW_DONT_USE_NATIVE_SURFACES
// #define EW_DONT_USE_NATIVE_SURFACES_AS_DESTINATION

 

Setting the format of the image resource to 'Direct access' does not cause a slowdown, but all large images cannot be set to 'Direct access'.

by
Please let the bitmap resources as 'Compressed' if you used the same setting with version 9.30.

Just to have the same understanding: With version 9.30 the loading of the background image was fast, after updating to version 11.00 there is a noticeable delay time when the background images is loaded the first time. Is this the problem?
by
That's right.

Hardware, drivers are the same, but the first time you load an image after converting to EW11.0, the speed decreases.
by

There must be some difference in the configuration - the implementation of bitmap loading and decompression did not change.

Can you provide the startup messages that will be print via serial connection to a console window in both cases?

Btw: Does your background image contain transparency? If not, you can set the color format of this bitmap resource to RGB565 in order to reduce the necessary memory.

by
- Unfortunately, there are no serial ports on the custom board.

- There is a transparent background. So after removing the transparent background, I tested it and it got faster.

 

previous resource setting

 - format : native

 - mode : default

 - file: PNG with transparent

 

current resource setting

- format : RGB565

- mode : compressed

- file: BMP without transparent

 

Thank you for your help.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...