2020-05-26 02:09 AM
I'm working on a STM32H7B3I-DK with a 565 format frame buffer.
In my design, the Serial Flash that contents the ExtFlashSection in a standard project will not be memory mapped because I need part of it to record other data.
I followed the topics about caching bitmaps (https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/caching-bitmaps and https://support.touchgfx.com/docs/development/ui-development/scenarios/using-non-memory-mapped-flash )
In TouchGFX Designer, if I put the ’section’ part of the image to ExtFlashSection and the ‘Extra Section’ (e.g. the CLUT) in IntFlashSection everything is fine.
But if I try to put the ‘Extra Section’ in the ExtFlashSection the engine crashes on a HardFault because the library code tries to access directly the extra section in a memory mapped fashion.
Here is the state when hitting the HardFault exception
EXEC_RETURN (LR):
lr 0xffffffed -19
xPSR 0x21000000
ReturnAddress 0x8026bbe
LR (R14) 0x8026edb
R12 0x0
R3 0x1fe00
R2 0x14
R1 0x9001fe00
R0 0x80363d8
Return instruction:
0x8026bbe <_ZN8touchgfx6Bitmap15getSizeOfBitmapEt+198>: ldrb r0, [r1, #3]
LR instruction:
0x8026edb <_ZN8touchgfx6Bitmap5cacheEt+62>: mov r9, r0
I keep the linker file to have the ExtFlashSection mapped to 0x90000000 addresses so the data is loaded on debugger start but these addresses are not directly available at run time because the OSPI flash is not memory mapped as in a default TouchGfx project.
I put in bold the offending intsr/data in cpu trace. As you see, the R1 register holds the address of where is linked the _black_extra_data[] array (the CLUT of an image called ‘black’).
This fault happens before my overloaded blockCopy function is called.
Using the working linker map (with extra_ data section in internal flash), I verified that all images were copied to the cache by tracking the calls to my overloaded blockCopy function after a call to Bitmap::cacheAll() (both pixels and clut's are effectively copied to cache but this happen after the offending code !! )
Solved! Go to Solution.
2020-06-02 03:10 PM
This library calls blockCopy() before reading the CLUT for L8 images.
2020-05-27 05:45 AM
Hi,
This is actually a bug and we're working on a fix. Can you put the CLUTs in internal flash as a temporary fix? Otherwise i can probably provide you with a new Bitmap.o file once we fix it but before we can make a new release.
/Martin
2020-05-27 06:49 AM
2020-05-28 01:20 AM
Okay, Pierre.
Just to be sure, your goal is to not have the CLUT in internal flash, right?
/Martin
2020-05-28 04:48 AM
Hi,
Yes, I find it cleaner to have all image related stuff in the external memory but CLUT's are not so big so I could keep them in Internal Flash if there is no other way.
BR,
Pierre
2020-05-29 01:47 AM
Okay, i've got a fix for it and i want to ask you to use Bitmap.o that i'm sending you in a private message soon :)
2020-05-29 02:26 AM
2020-05-29 02:44 AM
Which compiler are you using? Forgot to ask.
2020-05-29 04:00 AM
2020-05-31 06:45 PM
Hi,PJEN
I'm using STM32F429 to put touchgfx image resources in external unmapped serial flash, debugging found into Hardfault, I also refer to the official <Caching Bitmaps> and <Using Non-Memory Mapped Flash for storing images>, also just started to use touchgfx, hope you can describe what modifications to make to put touchgfx image resources in external unmapped serial flash.
Execute the code as follows to the red line 66, and you will enter hardfault: