Skip to main content
Mitesh Bajaria
Associate
January 6, 2018
Question

STM32f030rc AES Encryption

  • January 6, 2018
  • 1 reply
  • 935 views
Posted on January 06, 2018 at 08:21

Hello everyone,

I am using STM32f030rc for my application. In which I want add 128bit AES encryption. For that I am referring STM32_Cryptographic _Examples. I have taken functions from AES128_CTR file. In which I am getting Hard fault after AES_CTR_Encrypt_Append function. All the arguments for this are same as in example. So I don't know why it is not working in my code? Is it with selection of series?

Thanks in Advance.

#stm32f030rc
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
January 6, 2018
Posted on January 06, 2018 at 18:47

The Cortex-M0 is particularly sensitive to data buffer alignment.

You should look at what instructions (assembly) are actually faulting, and the CPU registers at that point. If you understand why it is faulting you might be able to solve the problem.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Mitesh Bajaria
Associate
January 7, 2018
Posted on January 07, 2018 at 09:40

0690X00000609IUQAY.png

Here is screenshot of Dis

assembly

. Hard fault is coming after execution of add instruction.
Tesla DeLorean
Guru
January 7, 2018
Posted on January 07, 2018 at 15:13

'...

and the CPU registers...'

You need to review the code within the context it is executing. Is the stack pointer properly aligned? Is the stack deep enough?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..