2022-05-11 06:24 AM
Hi, I have nucleo-h753ZI and I want to use CRYP in a project that also uses FREERTOS. I set Timer 6 as Timebase Source (recommended due to FREERTOS) and as a result, program goes to HardFault every time I use HAL_CRYP_Encrypt function.
HAL_CRYP_Decrypt(&hcryp, (uint32_t *)AES_input, 48, (uint32_t *)encrypted, 100);
I configured CRYP to AES CBC with 256bit key and 8bit data and my array size is 48.
When I change Timebase Source to systick, it works without any issues.
Does anyone know what is the issue here?
Thanks.
2022-06-11 04:01 PM
Hello MattCZ,
I will check to reproduce the issue once I got the board, could you give me more details about your settings.
Best Regards,
Younes
2022-06-12 03:59 AM
Hi,
Attached a main.c file running STM32H7B3I-DK as the nucleo-h753ZI is not available for me. It is easy to migrate it to nucleo-h753ZI.
The freeRTOS project contains 2 Tasks, one for encrypt and the second for Decrypt. The default settings of FreeRTOS are used.
To reuse the project, you can generate a new one for nucleo-h753ZI by CubeMx enabling the TIM6 as source of Tick. Then use this main.c file instead of the generated one.
Best Regards,
Younes
2022-06-13 12:24 AM
Hi Younes,
thank you for your reply. I found out that there is some relation to data width you use for crypto. When I was trying 8bit data, it was not working. When I switched to 32bit, it is working fine with Timer 6 as timebase source. I have no idea why.
My original test was with default Cube MX project for H753ZI, no MPU, CMSIS V2, 1 task in freertos and 1msec period.
I was able to continue with 32 bit data, so it is not stop condition. Since you used 16bit, maybe the problem is only with 8bit data width.
Martin
2022-06-13 01:22 AM
Hi Martin,
I will check also the 8bits data size :)
Younes