Skip to main content
MMenz.1
Associate II
October 26, 2021
Solved

HardFault when initializing TouchGFX with proprietary RTOS

  • October 26, 2021
  • 2 replies
  • 2718 views

 

I am trying to port a Project using TouchGFX (Designer 4.17) and FreeRTOS to our own RTOS using IAR 8.40 Toolchain and th STM32F769I-Disco Board (Same controller will be used in the final product).

 

When calling MX_TouchGFX_Init() the System runs into an a HardFault

 

The HardFault occurs in the Library code (touchgfx::Screen::draw accroding to disassemly PC: 0x3ade9e, calles from touchgfx::Application)

 

_ZN8touchgfx6Screen4drawEv:

 0x3a'de7e: 0xb53e PUSH {R1-R5, LR}

 0x3a'de80: 0x2200 MOVS R2, #0

 0x3a'de82: 0xf8df 0x4264 LDR.W R4, [PC, #0x264] ; _ZN8touchgfx3HAL13DISPLAY_WIDTHE

 touchgfx::HAL::DISPLAY_WIDTH

 0x3a'de86: 0x9200 STR R2, [SP]

 0x3a'de88: 0xf8df 0x3258 LDR.W R3, [PC, #0x258] ; _ZN8touchgfx3HAL14DISPLAY_HEIGHTE

 touchgfx::HAL::DISPLAY_HEIGHT

 0x3a'de8c: 0x5ea2 LDRSH R2, [R4, R2]

 0x3a'de8e: 0xf9b3 0x5000 LDRSH.W R5, [R3]

 0x3a'de92: 0xf8ad 0x2004 STRH.W R2, [SP, #0x4]

 0x3a'de96: 0x4669 MOV R1, SP

 0x3a'de98: 0xf8ad 0x5006 STRH.W R5, [SP, #0x6]

 0x3a'de9c: 0x6802 LDR R2, [R0]

 0x3a'de9e: 0x6893 LDR R3, [R2, #0x8]

 0x3a'dea0: 0x4798 BLX R3

 0x3a'dea2: 0xb003 ADD SP, SP, #0xc

 0x3a'dea4: 0xbd30 POP {R4, R5, PC}

 

As far as I see this i do not have much options to break the

This topic has been closed for replies.
Best answer by Romain DIELEMAN

Hi,

CRC is necessary to work with TouchGFX Designer and other ST packs. You get a warning message in the X-CUBE-TOUCHGFX.4.18.0 settings within STM32CubeMX when it is not enabled.

/Romain

2 replies

MM..1
Chief III
October 26, 2021

Is your screen empty ? Try start with one screen one box empty project.

MMenz.1
MMenz.1Author
Associate II
October 27, 2021

I do have a version with empty screen. Unfortunately the HardFault does occur also with the empty app

Romain DIELEMAN
ST Employee
October 27, 2021

What version of TouchGFX are you using ? Could you share your FreeRTOS tasks just to check ? May be completely unrelated but i just want to see if you have named it properly and if the stack size is big enough.

/Romain

MMenz.1
MMenz.1Author
Associate II
November 3, 2021

Meanwhile. I have found the error. I have not initialized the CRC module but it is used within the library. Maybe it would be worth it to point out that this module is used in a future version of the lib? Thank you for your support

Romain DIELEMAN
Romain DIELEMANBest answer
ST Employee
November 3, 2021

Hi,

CRC is necessary to work with TouchGFX Designer and other ST packs. You get a warning message in the X-CUBE-TOUCHGFX.4.18.0 settings within STM32CubeMX when it is not enabled.

/Romain

Lead II
March 1, 2024

You get a warning when it's not enabled, but not a warning when "Do Not Generate Function Call" is checked. And I assume also no error if it is initialized after TouchGFX. In our code we had hardfaults and got no warnings because of this. Thank you MMenz.1  for giving your solution!

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."