Skip to main content
Zek_De
Senior
September 14, 2017
Question

HardFault and working reverse GPIO Pins

  • September 14, 2017
  • 12 replies
  • 2488 views
Posted on September 14, 2017 at 15:12

Hi friends,

I've got problems with STM32F0 series also same F1 now my real problem is getting a HardFault ,when I try to work with Nrf24lWhen process arrive this line 'TM_NRF24L01_SetTxAddress(&hspi1, TxAddress);' getting HardFault ,I see it with debug.Also extra matter is HAL_GPIO_WritePin(...); working reverse ,why is it ? Everything seems good under the codes.I'm thinking about Hardfault related with stack maybe I dont know.I've sent project.I havent sloved it for a long time but now again I need it.Stm32f4 is Ok .No HardFault error.Same code ,same process with stm32f4

Note: this post was migrated and contained many threaded conversations, some content may be missing.
    This topic has been closed for replies.

    12 replies

    Tesla DeLorean
    Guru
    September 14, 2017
    Posted on September 14, 2017 at 16:55

    Use a debugger, and a half decent Hard Fault handler and look explicitly at the assembler instructions causing the fault, it's NOT complicated.

    The CM0 is going to be intolerant of memory alignment issues, compared to CM3/4 processors.

    If you think its the stack, then look at that, determine if it is big enough and how much you're using of it.

     
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Zek_De
    Zek_DeAuthor
    Senior
    September 14, 2017
    Posted on September 14, 2017 at 17:36

    Thank you answer ,

    First I didnt understand this sentence what I need to do ,and I send my project .rar file .I'm gonna look forum you sent me.İf you control project ,I will be so glad.
    Tesla DeLorean
    Guru
    September 14, 2017
    Posted on September 14, 2017 at 18:02

    I'm busy with my own work, I can't be digging into yours.

    Stack size is in startup_stm32f030x6.s, you have 1024 bytes, is that adequate?

    Look at the code that is faulting, what is it doing, it will give you a clear perspective of what the CPU dislikes. I don't have hardware to replicate, you'll need to own the detective work. The Cortex-M0 has a smaller instruction set and doesn't like misaligned data, ie 16 or 32-bit read/write to ODD addresses. Hard Faults will also occur if you stray outside defined memory regions with RAM or registers behind it.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Zek_De
    Zek_DeAuthor
    Senior
    September 16, 2017
    Posted on September 16, 2017 at 13:07

    I said about working pin reverse actually it had been related stm32 kit ,I hadn't reliased it.I'm correcting this.
    Zek_De
    Zek_DeAuthor
    Senior
    September 16, 2017
    Posted on September 16, 2017 at 13:09

    I said about working pin reverse actually it had been related stm32 kit ,I hadn't reliased it.I'm correcting this.