Skip to main content
Mnema.2055
Visitor II
December 6, 2019
Question

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

  • December 6, 2019
  • 7 replies
  • 2194 views

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

This topic has been closed for replies.

7 replies

Martin KJELDSEN
Principal III
December 11, 2019

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

skullboyer
Associate III
June 1, 2020

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.

Martin KJELDSEN
Principal III
June 2, 2020

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 III
June 2, 2020

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