cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f030rc AES Encryption

Mitesh Bajaria
Associate
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
3 REPLIES 3
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 Venmo
Up vote any posts that you find helpful, it shows what's working..
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.
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 Venmo
Up vote any posts that you find helpful, it shows what's working..