title: Trouble returning from functions STM32F051C6 (Hard fault)
body: <p>So I've bee stuck with this problem for a while. Towards the end of my code whenever I call a function it can no longer return to the main function and causes a hard-fault error. I checked that it does reach the end of the function using breakpoints. </p>
  
  <p>If I copy the code from the function into the main function it works with no problem, but makes the code less readable and repetitive.</p>
  
  <p>Any idea why this happens and a way to fix it.</p>
  
  <p>I am using the STM32F051C6 and programming in c in Eclipse.</p>