2024-02-29 06:43 AM
I'm working on a custom STM32U5 board with TouchGFX. The board features an external NOR flash memory used for storing the ExtFlashSection (as documented here).
In my project testing, I aim to display a simple black and white image with a transparent area. Initially, I configured TouchGFX Designer to place both the "Section" and "Extra Section" within the internal flash (IntFlashSection), and everything functioned as expected. However, my application necessitates storing media files in the external memory.
To achieve this, I successfully linked the ExtFlashSection to the external NOR flash. Subsequently, I modified the positions of both the "Section" and "Extra Section" from IntFlashSection to ExtFlashSection.
after compilation this my external memory:
When running the code, a hard fault occurs. This is likely due to TouchGFX attempting to directly fetch data from external memory during the loading of the "Extra Section" data, instead of using the BlockCopy function.
This is the Trace:
And these are the registers:
I came across this post and suspected it might be related to a known TouchGFX bug. I decided to move only the extra data to the IntFlashSection, which initially resolved the issue. However, when I tried changing the background image from bg_1.png to bg_2.png, a hard fault occurred again....here there are trace and registers
This time r1 is contains the base address for Extra Section of bg_2 in internal flash. So memory access should be ok....
What is the difference between bg_1.png and bg_2.png that could be causing this problem?
I would appreciate any suggestions or hints to resolve my problem.
2024-05-27 01:19 AM
Hello @Dadigno ,
I was running out of ideas so I sent this thread to @LouisB .
Have you tried to cache your bitmaps like JTP1 proposed?
Here is another user who had an issue with caching bitmaps so he shared his code to cache bitmaps, you could use it as a starting point : cache-memory-seems-to-crash/td-p/665540
Regards,
2024-05-27 01:55 AM
Hi @GaetanGodart,
The documentation say "In order to use the bitmap caching feature, you need to first provide a bitmap cache configuration to TouchGFX, and secondly (in some cases) to provide a hardware specific implementation of the BlockCopy function for reading data from your external storage."
Therefore, I think the problem remains since blockcopy must still be called to load media from external storage.
Regards
2024-05-27 02:53 AM
I asked the team in charge of the framework (who know better about this kind of issues).
The copyBitmapToCache function calls blockcopy so caching your bitmaps could solve the issue. I think it is worth the try as we don't have other lead so far.
Regards,
2024-05-27 06:17 AM
Ofcourse, but designer generator dont support this type images.
2024-05-28 05:37 AM
Hi @GaetanGodart,
Finally, we've achieved some results! Caching bitmaps seems to be the only way to load and show image with transparency from not mapped external memory. Now, blockcopy is called once at caching time, and images with transparency are displayed correctly.
This again proves that the setup is correct, but the core has a problem loading images with transparencies when the cache is not used.
Unfortunately I don’t want to use the cache ( not always ). So this is not the final solution for me.
Regards
2024-05-28 07:55 AM
Part of docu
as i write now unsupported.
2024-05-28 08:12 AM
2024-05-28 08:17 AM - edited 2024-05-28 08:35 AM
OK and i and docu say you cant. Because all lib code is optimized to load images from addressable memory.
Nothink more. Then for non mapped is required precache image to addressable arrea.
Maybe you can create special widget external image and draw your way...
Actual latest version support only this LCD16bppSerialFlash | TouchGFX Documentation
2024-05-31 01:14 AM
Hi @MM..1 ,
So, you're saying that the fact that blockCopy is called even when I'm not using the cache is a behavior not foreseen by the documentation? This would explain the strange behavior in my setup...
If I don't want to use the cache, do I have to use the External Data Reader interface? Correct?
Regards
2024-07-02 01:07 AM