cancel
Showing results for 
Search instead for 
Did you mean: 

Hardfault when call setTypedText

PPres
Associate II

Hi,

I'm developing on a custom hardware, trying to run a simple touchgfx project.

Single screen with an image an a text over.

Following the example and the strusture of a STM32F746G-Disco demo board, I makemy hardware functioning, any image, even big goes on the 800x480 LCD.

But any time I try to put on the screen a text the system faut to Hrdfault handler.

it seem that the function trying to call a protected area ( 0x5xxxxxx) .

I get that problem every time I try to call "setTypedText" funcion.

I don't understand if some memory settings in my app is wrong. I did try to put the text into external or internal memory, using wildcards or not. It's impossible to show any text.

I use freertos, the project is created with CubeMX + Touchgfx Designer.

I did encrease the heap and the stack.

Nothing. several images at the same time pass the test, but no text even if I use a single font and try printing a single word.

Please point me in some direction to search.

Thanks.

Paolo

18 REPLIES 18

Look at whats actually faulting.

Could you be loading an ASCII string content where it actually wants a pointer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PPres
Associate II

Maybe,

I will check​.

The true problem is that all the touchgfx code was generated by touchgfx designer, and on the only screen I have there are a static image a​nd a single text word . So I can't imagine what can be wrong on that simple code.

I thought about stack or heap problem or external memory configuration, but I don't know exactly where to look.

Any idea?

Without the source, do a disassembly listing, walk back from the fault, reconstructing the call chain from the stack so you can be more sure of the failure path inbound.

>>0x5xxxxxx

Too non specific, show the register dump at the fault. Show the exact register content. Is the register resolvable to an ASCII stringlet you can pin down in your own code, or the resources generated by the tools?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PPres
Associate II

0693W000007Cqv6QAC.jpgHi Tesla,

I did find that returning from the function

touchgfx::Unicode::UnicodeChar* touchgfx::Texts::getText(TypedTextId id)

inside Touchgfx/generated/texts/src/Texts.cpp

jump to an odd flash memory address, I don't know if that can be the cause, but before that call all the disassembly steps goes right into pair address.

after that call an instruction "bx lr" jump to an odd address due to the fact that inside the LR register there is an odd address.

The address range is correct and pointing to the right back function .

At the same time the debugger became instable and is more and more difficult to proceed stepping the code.

If left run, the code goes suddenly into an hardfault.

All the function used are from library and/or auto generated code, so it's very strange.

All the text pointer into the external memory seems corrects. I can see the offsett of every string I'm using.

I think to a wrong aligned code but how it can be verifyed ? since the code is precompiled?

thanks.

PPres
Associate II

Finally I did find it.

Was flagged the "A4" flag in the Text Configuration menu of TouchGFX Designer.

The alignement of the strings was obviously wrong.

That stupid flag costs me 2 day of debugging....

Many thanks for your support .

Paolo

Hello @PPres​ ,

I'm glad you found a fix to your problem. Sorry for the trouble.

So you are saying that the A4 flag being ticked created the issue ? I'm sorry for the bother but could you elaborate your setup to understand why A4 had an impact on your project ?

/Alexandre

PPres
Associate II

Sorr​y​, ​I didn't update yesterday.

I was too happy ​because it seems all functioning.

But after some verifying the p​roblem didn't disappear. So I'm again checking and testing.

At this point I don't think that the A4 flag ​is part of the problem.

With all the fonts, images and resources inside the flash all goes well.

If I don't u​se any text (always generated by touchgfx designer) all goes well even if the images are inside or on the quadspi.

When I p​ut some text on the project an hardfault is fired every time.

Doesn't matter if the texts are in flash or outside.

I d​on't knows where to look to solve the problem.

Now I take a look to the quadspi driver and loader because I use an already maded code and I have some doubt about.

I t​ry to write my own external loader and

I'll back ​soon with some update.

PPres
Associate II

Ok, Today I did realized an external loader to speed up the debug and during this activity I learn more about the quadspi.

The problem related to the text was a false problem , because the lcd did shows the last correct image, so I thought that the images did run and the texts fails, but I was wrong.

The problem involve all the graphic rendering when I try to us ean external memory.

So I have:

  • a freeRTOS running with a single task ( the touchgfx task) priority normal, stack = 8192byte,
  • LCD initialization tested with a fixed static (in flash) image and with a fixed static in 0x90000000 (quadspi address)
  • Quadspi running ( after the MemoryMappedMode activation, on debug I can see all the data stored with my external loader)
  • FMC running ( after the SDRAM init I can see the all the data passing from 00000 to garbage )

I create a simple project with touchgfx designer and with all the data on internal flash all goes well, ( gif, text, animation and fade-in process etc..)

When I move something into quadspi memory nothing is showed on the screen, it call all the initialization function into the file ViewBase.cpp and then it became un-debuggable.

I try to change the priority of all the IRQ involved ( ) but nothing.

I tryed to check if the quadspi is readable putting a raw image on it and configuring the framebuffer to pointing to, and it works.

Can You help me to find a way ?

Thank you.

Alexandre RENOUX
Principal

Hello PPres,

What we are relatively sure about is that there's a problem around your QSPI Flash implementation since everything works in internal Flash.

Are you sure your external loader loads correctly data in external Flash ?

"Create a simple GUI" is not very precise. What widgets did you use ? "move something into quadspi memory" is not precise either. What do you move to external Flash ? Bitmaps ? fonts ?

/Alexandre