cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault when upgrading TouchGFX 4.9.3 to 4.10.0

L4Y
Associate II

Hi ST Community,

I've ported touchgfx on my custom board, and it runs successfully. The hardware and software configuration is as follows,

HW configuration

CPU -> STM32L4R9 family

SW configuration

IAR 8.30

TouchGFX Designer 4.9.3

Now, I'm trying to upgrade TouchGFX Designer to 4.10.0, I do the following steps,

  1. open the project in TouchGFX Designer 4.10.0, and choose "Yes" to upgrade (TouchGFX Designer 4.10.0 will download something, seems like touchgfx core)
  2. run simulator successfully
  3. generate code in TouchGFX Designer 4.10.0
  4. open the project in IAR, and rebuild the project
  5. download the image to the custom board, and it crash.

I backup the call stack when crashing as follows. It crash when touchgfx_generic_init() -> FrontendHeap::getInstance(); is called.

HardFault_Handler

<Exception frame>

[_ZN8touchgfx6Screen4drawEv + 0x23]

[_ZN8touchgfx11ApplicationC1Ev + 0x61]

touchgfx::MVPApplication::MVPApplication()

touchgfx::MVPApplication::subobject MVPApplication()

FrontendApplicationBase::FrontendApplicationBase(class Model &, class FrontendHeap &)

FrontendApplicationBase::subobject FrontendApplicationBase(class Model &, class FrontendHeap &)

FrontendApplication::FrontendApplication(class Model &, class FrontendHeap &)

FrontendHeap::FrontendHeap()

FrontendHeap::getInstance()

class touchgfx::HAL & touchgfx::touchgfx_generic_init<STM32HAL_SPI>(class touchgfx::DMA_Interface &, class touchgfx::LCD &, class touchgfx::TouchController &, signed short, signed short, unsigned short *, unsigned int, unsigned int)

touchgfx::touchgfx_init()

GRAPHICS_Init()

I have no idea so far, can anyone help to look into the issue? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
cameronf
Senior

When the library became exclusive to ST chips, they added a check to make sure it's running on ST hardware which uses ST's CRC peripheral. This means you need to enable the clock for the CRC peripheral before it tries to use it. I don't know when exactly touchgfx checks for this so can't tell if this is your issue based on the call stack but try adding

__HAL_RCC_CRC_CLK_ENABLE();

sometime before initializing touchgfx to see if that fixes it.

View solution in original post

5 REPLIES 5
cameronf
Senior

When the library became exclusive to ST chips, they added a check to make sure it's running on ST hardware which uses ST's CRC peripheral. This means you need to enable the clock for the CRC peripheral before it tries to use it. I don't know when exactly touchgfx checks for this so can't tell if this is your issue based on the call stack but try adding

__HAL_RCC_CRC_CLK_ENABLE();

sometime before initializing touchgfx to see if that fixes it.

L4Y
Associate II

@Community member​ 

Thanks for your quick response.

Yes, Indeed. As you said, the crash is due to CRC peripheral not enabled. I've verified it works. Thank you!

Hope ST can provide a upgrade guide with TouchGFX Designer release.

Hi @L4Y​,

The fact that you couldn't find this information is good input to us in some way. Sorry for the trouble. And thanks to @Community member​ for stepping in!

https://touchgfx.zendesk.com/hc/en-us/articles/207507415-Known-Issues

Best regards,

Martin

Still true and working solution in 2022 ! Many thanks.

Sorry, but now in 2024 this solution doesn't work for me.

I'm trying to develop a custom board touchgfx project with TouchGfx 4.23.0, STM32CubeIDE 1.14.1, STM32CubeMX 6.10.0. MCU is STM32WL5MOCH (Cortex M4).

I've generated the project with CubeMX itself.

MX_CRC_Init() (with __HAL_RCC_CRC_CLK_ENABLE();) is called before MX_TouchGFX_Init().

I have a systematic Hard Fault here:

 

LorVec81_0-1711810475723.png

In _ZN8touchgfx6Screen4drawEV, during instruction str r1, [sp, #0]:

LorVec81_0-1711810755259.png

Here are the registers:

LorVec81_1-1711810807634.png

 

What could be the problem?

 

Thank you