2019-02-21 06:31 AM
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.
Please give us some information what TouchGFX will need to run.
Will TouchGFX do its checks only once or repeatedly?
2019-02-21 07:54 AM
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
2019-04-26 02:36 AM
@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
2019-04-26 04:40 AM
It is using it to authenticate the hardware, I'd just patch the library to fix that..
2019-04-28 11:35 PM
Hi @Community member ,
i read about the HW lock, but thanks.
Could you be a little more precise on how to fix what.
2019-04-29 12:50 AM
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
2019-04-29 01:56 AM
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
2019-04-29 02:08 AM
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
2019-05-02 01:06 AM
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
2019-05-03 01:35 AM
Hi @AK.12.,
Okay, that's good to know. Let me know what you find or if i can help.
Best regards,
Martin