cancel
Showing results for 
Search instead for 
Did you mean: 

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

Alex K.
Associate II

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?

12 REPLIES 12

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Alex K.
Associate II

@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

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

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
Chief III

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

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

Hi Alex,

Thanks for the information. Are you able to disable these CRC checks in an easy way to verify that the TouchGFX STM32 Lock works?

/Martin

Alex K.
Associate II

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

Hi @AK.12.​,

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

Best regards,

Martin