cancel
Showing results for 
Search instead for 
Did you mean: 

STM32_Crypto on STM32L431

skuma.21
Associate II

Hello,

I am trying to use "STM32CubeExpansion_Crypto_V3.1.0" library for generating HMAC_SHA1 on STM32L431 processor. We are using FreeRTOS.

Issue description: When we make a function call to the HMAC_SHA1 functions contained in the above library, it returns successfully with the HASH, but the code hangs immediately after that. Sometimes it gives "Hard Fault" and hangs and at other times it just hangs without giving any error message.

Interesting thing to note is that, when we call the same functions from outside of any Task (from timer interrupt for example) it works just fine. But when we call these set of functions from within a task (say application task) the code hangs after executing the HMAC_SHA1 functions.

Could anyone please point out what could be going wrong? Thanks.

A few points to note:

  1. I am using the __CRC_CLK that is needed for running the crypto library.
  2. Have tried using critical sections - enable critical section before the HASH function calls and disable after returning from them. But this doesn't help.

Thanks.

Best regards

satish

1 ACCEPTED SOLUTION

Accepted Solutions

Could be stack overflow. Try to increase the task's stack size.

View solution in original post

2 REPLIES 2

Could be stack overflow. Try to increase the task's stack size.

HI After Forever,

Thanks this worked.

In fact I suspected this and tried increasing the stack size but in reality the #define for stack size was not being used in my code to allocate stack for each task. Hence there was no impact of this change.

after your response, I double checked and resolved that Issue.

Thanks again!

regards

satish