Skip to main content
shark
Associate III
January 1, 2020
Question

Bitmap::cacheAll() crash

  • January 1, 2020
  • 2 replies
  • 647 views

I stored all image content from section ExtFlashSection on my sd card, when loading:

#define CACHE_SIZE 3000000

void touchgfx_init()

{

  uint16_t dispWidth = 800;

  uint16_t dispHeight = 480;

uint16_t *cache = (uint16_t*)malloc(CACHE_SIZE);

  HAL& hal = touchgfx_generic_init<STM32H7HAL>(dma, display, tc, dispWidth, dispHeight, 

cache, CACHE_SIZE, 1000);

Bitmap::cacheAll();

...

}

the program crashes in cacheAll() before calling my overwritten blockCopy().

Is there a demo for Bitmap::cacheAll()?

This topic has been closed for replies.

2 replies

shark
sharkAuthor
Associate III
January 1, 2020

After I checked code, I found that,

In BitmapDatabase.c, bitmap_database[] stores the static bitmap pointers like "_blue_buttons_round_edge_small".

and "_blue_buttons_round_edge_small" has been put into my sd card by me. So dynamic loading image is impossible as describled in touchgfx knowledge base Non-memory mapped external flash.

I am use touchgfx 4.12.3, the document in knowledge is not updated?

shark
sharkAuthor
Associate III
January 1, 2020

It runs ok after I changed address from 0x09000000 to 0x24000000 as document suggested.

however I think, cacheAll() should not access these fake address, the address 0x09000000 will cause hardfault on st mcu.