cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault when initializing TouchGFX with proprietary RTOS

MMenz.1
Associate III

 

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

9 REPLIES 9
MM..1
Chief II

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

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

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

Add something to screen

I have added a green screen. Still the same hardFault

I am using version 4.17 of the designer. Is this automatically the version of the lib? or where do I find it?

I do not use FreeRTOS. When I do, the application runs fine.

I have now doubled both stack an heap size (since TouchGFX und Control application on there own are happy with the initial 0x2000), no change

MMenz.1
Associate III

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

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

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.