cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 strange behaviour.

LMehm
Associate II

Hello!

I have some strange behavior with STM32L0 processor.

I get Hard fault error in my function and I can't understand why this happens?!

I have equivalent codes - one of them works and other doesn't work causing Hard fault error.

Also this happens only when function is called with parameter mCopy=2.

I use SystemWorkbench for STM32 IDE.

I have attached these two codes - working and problematic code.

Would you please help me!

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

The trick here is to look at what the processor is complaining about. The Hard Fault points to the faulting instructions and has register content.

The CM0 doesn't like unaligned 32-bit reads, ie (addr & 3) != 0

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

View solution in original post

3 REPLIES 3

The trick here is to look at what the processor is complaining about. The Hard Fault points to the faulting instructions and has register content.

The CM0 doesn't like unaligned 32-bit reads, ie (addr & 3) != 0

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
LMehm
Associate II

Thank you, Clive!

I will check it!

LMehm
Associate II

Problem is solved!

Thank you, Clive!