What is the problem with getFont() when I set the TextAreaWithOneWildcard, setTypedText()?
I have some success when I ported the my working application based on touchgfx 4.10.0 from STM32F4 to STM32H7. The fonts and texts are stored in FLASH and the images are cached in external SDRAM.
The graphics itself is working, I can display shapes, images,make animations, but when I try to display text I have a crash (HardFault) in getFont method (TypedText) more specific, on the line --> return fonts[typedTexts[typedTextId].fontIdx].
With the debugger I have stopped on that line before the execution and checked the addresses of the variables and pointers on both targets F4 ahd H7.
The variable typedTextId look's ok (678). The NUMBER_OF_TEXT_KEYS in my case is 722, so the text exist.
The pointer fonts points on address 0x24007000 (ok, somewhere in ram, according to .map this is TypedTextDatabase). Similar as F4 target.
The pointer typedTexts points on address 0x610020 (wierd, this pointer should point on the text in TextFlashSection located somewhere in FLASH). At least on the F4 target it points specific text stored in FLASH TextFlashSection. @Martin KJELDSEN
So I am little lost here. I was able to succesfuly run my application on F4 just fine but on H7 target I was able to run application just once (with debugger step by step that one time worked OK without crash, I could not reproduce this anymore).
Does the H7 cache the TextFlashSection at some point?
The code (it crashes in first line in setTypedText when getFont is called):
.cpp
m_txtVer.setTypedText(TypedText(T_FLARMWARNING_VALUE));
m_txtVer.setWildcard(m_acVer);
m_txtVer.setColor(touchgfx::Color::getColorFrom24BitRGB(0xFF, 0x00, 0x00));
add(m_txtVer);
.hpp
touchgfx::Unicode::UnicodeChar m_acVer[FLARM_WARNING_VER_LEN + 1];
touchgfx::TextAreaWithOneWildcard m_txtVer;
I'm really not sure what is the source of the problem here...