0

Im using STM32F723 and using the Cryptographic Library (https://wiki.stmicroelectronics.cn/stm32mcu/wiki/Security:Getting_started_with_the_Cryptographic_Library).

When testing basic cmox_aead_encrypt and cmox_aead_decrypt example it works fine.

But with the target of using FreeRTOS on the MCU, I tried to switch to TIM1 for the Timebase Source, because when using FreeRTOS this has to be changed from Systick to TIMx.

But only with changing SysTick to Tim1 and NOT even enabling FreeRTOS, I get a HardFault calling the crypto function like cmox_aead_decrypt():

retval = cmox_aead_decrypt(CMOX_AES_GCM_DEC_ALGO,                  /* Use AES GCM algorithm */
                message_rx.payload.ciphertext, sizeof(msg_tag),     /* Ciphertext + tag to decrypt and verify */
                sizeof(Expected_Tag),                   /* Authentication tag size */
                Key, sizeof(Key),                       /* AES key to use */
                IV, sizeof(IV),                         /* Initialization vector */
                NULL, 0,               /* Additional authenticated data */
                decrypted_msg, &computed_size);    /* Data buffer to receive generated plaintext */

The last debugger steps, before the hardfault, can be seen here:

Debugger steps

Does anyone have an Idea what I have to change to use the Cryptographic Library correct while running FreeRtos?

Best Regards

CoObri
  • 13
  • 5
  • Please read [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/q/285551/238704) – President James K. Polk Jun 12 '23 at 13:49
  • Thx. Understood and noted. First image i'll change asap. Second one should show the last steps of the debugger before the hardfault is thrown. – CoObri Jun 12 '23 at 15:34

0 Answers0