cancel
Showing results for 
Search instead for 
Did you mean: 

getPixelData() Hardfault

beezybee
Associate II

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

15 REPLIES 15
GaetanGodart
ST Employee

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,

Gaetan Godart
Software engineer at ST (TouchGFX)
beezybee
Associate II

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]

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,

Gaetan Godart
Software engineer at ST (TouchGFX)

I have removed the transition and changed the font but no luck. I have done some testing with dataOffset and it doesn't hardfault when I set it to 0 (also doesn't work) but when the value is greater it throws the hard fault. I have attached my TouchGFX project for your reference. 

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,

Gaetan Godart
Software engineer at ST (TouchGFX)

Yes, I am seeing this while I am running on target.

beezybee
Associate II

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.

Hello @beezybee ,

 

Can you share your .ioc file (STM32CubeMX)?

It looks like your board bring up is not working,

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Please see the attached file.