2025-03-06 8:22 AM
I have a screen with only 1 line of text and I get a Hard Fault when I try to run it. I get the fault here at the glyph->dataOffset:
const uint8_t* GeneratedFont::getPixelData(const GlyphNode* glyph) const
{
const uint8_t* const* table = (const uint8_t* const*)glyphData;
return &(table[glyph->unicode / 2048][glyph->dataOffset]);
}
I have everything stored in internal flash and it is initialized before TouchGFX
2025-03-07 7:47 AM - edited 2025-03-07 7:47 AM
Hello @beezybee and welcome to the community!
Can you share your project?
Can you hare the stack call please?
Also, what hardware and software are you using?
Regards,
2025-03-07 8:05 AM
I cannot shar my entire project but if there is something specific I should be able to share that. I am using STM32U5A5 with TouchGFX Designer 4.24.1 and CubeMX 6.12.1. Here is my call stack
HardFault_Handler
<Exception frame>
touchgfx::GeneratedFont::getPixelData(touchgfx::GlyphNode const *) const
[??getGlyph_1 + 0xb]
touchgfx::Font::getGlyph(unsigned short) const
[??getNextLigature_0 + 0x23]
[??getStringWidthLTR_0 + 0xb]
touchgfx::Font::getStringWidth(unsigned char, unsigned short const *...) const
[??getTextWidth_5 + 0x1d]
[_ZN8touchgfx8TextArea19resizeToCurrentTextEv + 0x17]
[_ZN8touchgfx8TextArea12setTypedTextERKNS_9TypedTextE + 0x1d]
GasReadingHeadingBase::GasReadingHeadingBase()
GasReadingHeadingBase::subobject GasReadingHeadingBase()
GasReadingHeading::GasReadingHeading()
GasReading4ScreenViewBase::GasReading4ScreenViewBase()
GasReading4ScreenViewBase::subobject GasReading4ScreenViewBase()
GasReading4ScreenView::GasReading4ScreenView()
GasReading4ScreenPresenter * touchgfx::makeTransition<GasReading4ScreenView, GasReading4ScreenPresenter, touchgfx::NoTransition, Model>(touchgfx::Screen * *, touchgfx::Presenter * *, touchgfx::MVPHeap &, touchgfx::Transition * *, Model *)
FrontendApplicationBase::gotoGasReading4ScreenScreenNoTransitionImpl()
touchgfx::Callback<FrontendApplicationBase>::execute()
touchgfx::MVPApplication::evaluatePendingScreenTransition()
touchgfx::MVPApplication::handlePendingScreenTransition()
[??tick_2 + 0x9]
touchgfx::HAL::backPorchExited()
[??taskEntry_0 + 0xb]
touchgfx_taskEntry()
MX_TouchGFX_Process
HMI_thread_entry
_tx_thread_shell_entry
<Exception frame>
[PC = 0xefef'efef]
2025-03-10 2:59 AM
Hello @beezybee ,
Thank you for the stack call.
It seems the issue happens during a transition.
Can you try to remove the transition and still do the screen change and see if the issue still happens?
The stack call show issue at "GeneratedFont::getPixelData(touchgfx::GlyphNode const *) const" but you say the issue happens on line "return &(table[glyph->unicode / 2048][glyph->dataOffset]);" and specifically at "glyph->dataOffset", how do you know that?
If that is indeed accurate, perhaps the glyph do not have a dataOffset, what font are you using?
Can you try to use another font to see if the issue persist?
Regards,
2025-03-10 6:47 AM
2025-03-10 8:02 AM
I tried to run the simulator but I couldn't because you only shared the TouchGFX folder.
I created a new simulator project and imported your GUI, I ran the simulator successfully.
Does the issue only happens on target?
Regards,
2025-03-10 8:08 AM
Yes, I am seeing this while I am running on target.
2025-03-10 10:36 AM
Update, I have upgrade to TouchGFX 4.25.0 and CubeMX 6.14.0 and U5 FW package to 1.70 and I am no longer seeing the HardFault. But I am still having an issue with the display not being correct. I am still only seeing blocks of all white and all black. No text is display and framebuffer confirms this. When I print out the size of the rect I get 303 for width and 14 now for height. My display is 303x230.
2025-03-11 4:42 AM
Hello @beezybee ,
Can you share your .ioc file (STM32CubeMX)?
It looks like your board bring up is not working,
Regards,
2025-03-11 5:28 AM