cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Non memory mapped External SPI flash with touchgfx.

Mnema.2055
Associate

I am using STM32F429VG controller. In custom board we have used serial SPI flash to store all images. We have followed all steps mention in below link

https://touchgfx.zendesk.com/hc/en-us/articles/205886201-Placing-Assets-in-Flash-Memory

https://touchgfx.zendesk.com/hc/en-us/articles/203564102

But not able to understand

How to cache all image data from flash?

I have added Bitmap::cacheAll(); in touchgfx_init function but Blockcopy function is not getting called.

Thanks

7 REPLIES 7
Martin KJELDSEN
Chief III

Since your flash is not memory mapped the first article is of no use to you.

You may not have specified a bitmap cache that is large enough (e.g. size 0 since not configured). Then Bitmap::cacheAll() will never call Bitmap::cache() which calls blockCopy()

You define the bitmap cache in your touchgfx initialization which is outlined in the start of the second article.

/Martin

Hi,Martin

​I'm doing the same thing, badly without success.

I use STM32F429+SDRAM+SPI-Flash with the intention of putting the assets in spi-flash and using the asset data for touchgfx by caching it.

I am referring to the official documentation <Using Non-Memory Mapped Flash for storing images> and <Caching Bitmaps>.But it didn't work out.

The current situation is to enter hardfault while executing the "void touchgfx::Texts::setLanguage(touchgfx::LanguageId id)" method in the file <texts.cpp>.It happens specifically at the "currentLanguageTypedText = typedTextDatabaseArray[id];" code.The specific code implementation is as follows:

A linked description file for putting assets into SPI-FLASH:

0693W000001pnM2QAI.png

The cache in file <TouchGFXConfiguration.cpp> is configured as follows:

0693W000001pnNZQAY.png

The location where the hardfault occurred is as follows:

0693W000001pnO3QAI.png

I have been in hardfault without entering the "TouchGFXHAL::blockCopy" method before, because I am new to touchgfx, I don't know where the problem occurs,  <Using Non-Memory Mapped Flash for storing images> and <Caching Bitmaps> two official documents I don't understand very well, I hope you can help me out, thanks.

That's because TouchGFX does not contain the addresses for the glyphs in the program, so it cannot call blockCopy() with something that makes sense to be translated into something on the SPI flash. You need to take a look at binary fonts and font caching on the support site.

Let me know when you've read those articles. Thanks!

skullboyer
Associate II

Thank you very much. I'll check the appropriate documentation. I'll be the first to tell you the good news.

Hi,Martin。

​I comment the fonts and text in the linked file, leaving only the image in the external flash. But the blockCopy() method is not called and the LCD displays a flower screen.

0693W000001q4ReQAI.png

I read <Binary Fonts> and <Font Caching> two documents, probably know the font text also need to do some work like the image, but still do not understand the specific operation, the text of the sample code I do not know where to put, tried several times without success, whether the font text also need to call the blockCopy() method like the image, which goes back to the problem of the method is not called, I hope there is a simple example, so that learning will be very easy, will be easy to understand, thanks.

Oh, forgot to mention, the linked file only retains the image after it is placed in external flash and does not go into hardfault anymore.

Have you solved this problem? I have the same problem