Skip to main content
Denys1
Visitor II
April 19, 2019
Question

HardFault_Handler, array initialization (STM32f103CBTx)

  • April 19, 2019
  • 1 reply
  • 1067 views

Hello everyone,

MCU - STM32f103CBTx, Flash - 128Kbytes, RAM - 20kBytes. 

I use MDK-ARM V5 (Keil uVision 5) and compiler is - default compiler version 5.

In my program I try to initialize float array with length of 240, ( float array[240] = {0}; ) and that's it.

But, during the execution of HAL_Init(), program goes to HardFault_Handler and stay there in an infinite loop. And Keil uVision 5 command console says - "Cannot access Memory". I don't understand why it is happening because a day ago I was able to create float array with a length of 1000 and everything was working.0690X000008AkQhQAK.png0690X000008AkQcQAK.png0690X000008AkQXQA0.png

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
April 20, 2019

Local/auto variables will need an adequate stack. Define size is startup_stm32f10x.s

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