Skip to main content
L4Y
Associate II
March 28, 2019
Solved

HardFault when upgrading TouchGFX 4.9.3 to 4.10.0

  • March 28, 2019
  • 2 replies
  • 2181 views

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!

This topic has been closed for replies.
Best answer by cameronf

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.

2 replies

cameronf
cameronfBest answer
Associate
March 28, 2019

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.

BDELI.2
Associate II
March 3, 2022

Still true and working solution in 2022 ! Many thanks.

L4Y
L4YAuthor
Associate II
March 28, 2019

@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.

Martin KJELDSEN
Principal III
April 2, 2019

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