cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault with TouchGFX ?

bully
Senior

Hello,

I have a project with custom stm32f769 oard and TouchGFX as GUI. I've done a lot of testing on simpler GUI (showing background and one button).

I've also prepared additional task that will do communication with other boards.

Everything seems to be working normal. I've chosen same Normal prioritiy also for this additional task.

Now I have imported more complex GUI i(approx. 26MB in external flash) nto the project by using TouchGFX Designer (opened existing, imported new one and generated code & recbuilt whole project) and now I get Hard Fault error.

Although not experienced debugger, I've single stepped problematic part and it seems that the first non-GUI task is started and then when it switches to another task, hardfault happens. By using HardFault analyzer in my CubeIDE, PC points to this line in code :

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]);
}
 

PC in HArdFault points to last line - but it seems weird to me.

But 'd like to learn, how to debug TouchGFX part of the application.

Where is entry point, main loop? Where can I stop safely ?

On the other side, I have a question, how to properly debug, check and supervise the ecxecution of TouchGFX also from other tasks, from FreeRTOS supervising features ?

It somehow seems to be not so easy to debug after startup (at least for me).

Thanks in advance,

regards,

B.

Update: went into disassembly on PC's address and it makes sense :

0800e0d6:  ldr   r3, [r3, #0]

and Registers view shows value of R3 to be

r3	0x91b8d822 (Hex)

that is not a multiple of 4....

 Update2: Breakpoint in that position is reached.

For information, glyph->DataOffset has value of 12522., glyph->unicode 76...

Hmm, it seems that it doesn't hard fault at these values, but it gets into hardfault

next time... I cannot retriev the actual values...

20 REPLIES 20
RMolins
Associate III

I know it is an old thread but where you able to determine the cause? I have had similar issues and cleaning the .o from Debug/TouchGFX/generated/fints/src fixed the issue in my scenario and would like to know if you have any additional information regarding the root cause.