Skip to main content
Alex K.
Associate II
February 21, 2019
Question

We need details about TouchGFX`s use of the crc module

  • February 21, 2019
  • 5 replies
  • 6586 views

Since version 4.10 TouchGFX needs the crc clock enabled to check if it runs on a STM32 MCU.

This worked fine for us so far.

Now we are adding other functionality to the application that require the use of the HW-CRC module.

Depending on how we configure the CRC module, we seem to run into some hardfault from within the TouchGFX initialization.0690X000006DlHdQAK.jpg

Please give us some information what TouchGFX will need to run.

Will TouchGFX do its checks only once or repeatedly?

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
February 21, 2019

It will expect the CRC to be in the STM32's standard/default 32-bit mode.

Like the one in the STM32F4, which is NOT programmable or configurable.

uint32_t Crc32(uint32_t Crc, uint32_t Data)
{
 int i;
 
 Crc = Crc ^ Data;
 
 for(i=0; i<32; i++)
 if (Crc & 0x80000000)
 Crc = (Crc << 1) ^ 0x04C11DB7; // Polynomial used in STM32
 else
 Crc = (Crc << 1);
 
 return(Crc);
}
 
 
 printf("%08X (B5E8B5CD) Slow\n",Crc32(0xFFFFFFFF, 0xF407A5C2)); // 0xB5E8B5CD

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Alex K.
Alex K.Author
Associate II
April 26, 2019

@Martin KJELDSEN​ 

I have to come back to this issue, since we are getting some unexpected behaviour in our CRC calculations.

We calculate the CRC on the same region four times and we get different results each time.

However, if we disable the GUI Task our CRC calculations run well.

It would help us to know what TouchGFX is doing with the CRC Module and when does it use it.

P.S.: our programm crashes again (but now sporadically) as described above.

Thanks in advance

Tesla DeLorean
Guru
April 26, 2019

It is using it to authenticate the hardware, I'd just patch the library to fix that..​

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Alex K.
Alex K.Author
Associate II
April 29, 2019

Hi @Community member​ ,

i read about the HW lock, but thanks.

Could you be a little more precise on how to fix what.

Martin KJELDSEN
Principal III
April 29, 2019

Hi Alex!

Sorry, i'm not sure how i missed this. The trace you presented seems to be during startup of the application.

What exactly are you doing with the CRC engine that caused the lock to stop functioning? Are you using the CRC before or after TouchGFX starts? etc. Thanks!

Best regards,

Martin

Alex K.
Alex K.Author
Associate II
April 29, 2019

Hi @Martin KJELDSEN​ ,

yes, the screenshot was taken when the app crased on startup. We are not sure what causes this crashes.

We are doing crc checks on chunks of Firmware updates before they are stored in flash.

We have secured our message queues with crc, which will use the CRC quite often as well.

And of course TouchGFX which we don´t know too much about...

We are using the crc also before the Touchgfx starts and also after. Of course, we use it more often after the touchgfx starts.

Thank you in advance!

Best wishes,

Alex

Alex K.
Alex K.Author
Associate II
May 2, 2019

Hi Martin,

we disabled the other tasks using CRC and the system runs fine, so i gues the Lock works.

Next we are going to dig in the CRC and maybe FreeRTOS once more.

Best regards,

Alex

Martin KJELDSEN
Principal III
May 3, 2019

Hi @AK.12.​,

Okay, that's good to know. Let me know what you find or if i can help.

Best regards,

Martin

Alex K.
Alex K.Author
Associate II
May 22, 2019

Hi @Martin KJELDSEN​ ,

i think we are through this at least for the moment.

There was a problem with our FreeRTOS Stack Sizes.

Can´t check often enough that Task size is in words and the FreeRTOS config is in bytes....

Some of our other tasks were growing fast, not instatiating the GUI Task helped, because it already had a big size.

So, issue solved.

Thanks again.

Martin KJELDSEN
Principal III
May 22, 2019

Haha, i hear you about the words vs bytes size "issue" :)

Glad you've moved on.

/Martin