cancel
Showing results for 
Search instead for 
Did you mean: 

What is the problem with getFont() when I set the TextAreaWithOneWildcard, setTypedText()?

medo7
Associate

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...

2 REPLIES 2
Martin KJELDSEN
Chief III

Hi @medo7​,

Which compiler are you using? How did you create this project? Is this for the STM32H743-EVAL by change? Version two of the application template for that board fixes a hardfault issue with the IAR project for that board related to texts.

Let me know,

Best regards,

Martin

medo7
Associate

Hi Martin,

The compiler I am using now is gcc-arm-none-eabi-7-2018-q2-update-win32. Project was created from scratch (Eclipse based) on stm32f4 target and was based on touchgfx 4.7.0 (standard licence back then) with the help of touchgfx team. Now I have succesfuly migrate on touchgfx 4.10.0 on stm32f4 target. It work's without problem.

Now I have used TouchGFX Designer and create blank project based on STM32H743I-EVAL example. I take the project files (STM32H7HAL,STM32H7DMA,initialization code,...) and port it to existing project. No problem (except this font thing).

I learned a lot about touchgfx over time (back then before TouchGFX Designer).

I have confirmed with debugger that the text in languagesArray and the translations (textsEng,textsSlo) are pointing in FLASH (Texts.cpp). But when the currentLanguagePtr pointer is set, the languagesArray are now pointing on different address. Please see the images.

Is that normal?

Best regards,

Jaka

0690X000006DdqaQAC.png0690X000006DdqQQAS.png0690X000006DdqGQAS.png