Skip to main content
-----????_---- ---??as
Associate II
September 8, 2017
Solved

Next or previous statement

  • September 8, 2017
  • 2 replies
  • 653 views
Posted on September 08, 2017 at 11:38

Simply I want to know when the hardfault occured(code statement)?I cant use debug so If I try to read program counter in hardfault function this returns me hardfault program counter.How can I know where Hardfault occurs by reading its program counter?So I must find previous statement when It is in the hardfault?At least I must know next statement(program counter's) in hardfault in case it is impossible to know previous statement.

#program-counter
    This topic has been closed for replies.
    Best answer by AvaTar
    Posted on September 08, 2017 at 12:24

    This is a pretty good description on how to work 'backwards' on hardfaults, including how to decode the SCB registers:

    https://duckduckgo.com/?q=keil%20hardfault%20pdf+site:www.keil.com&t=hb

    http://www.keil.com/appnotes/files/apnt209.pdf

    PS: Links use to make post go into moderation ...

    2 replies

    AvaTar
    AvaTarBest answer
    Senior III
    September 8, 2017
    Posted on September 08, 2017 at 12:24

    This is a pretty good description on how to work 'backwards' on hardfaults, including how to decode the SCB registers:

    https://duckduckgo.com/?q=keil%20hardfault%20pdf+site:www.keil.com&t=hb

    http://www.keil.com/appnotes/files/apnt209.pdf

    PS: Links use to make post go into moderation ...

    waclawek.jan
    Super User
    September 8, 2017
    Posted on September 08, 2017 at 12:56

    [shameless self-advertisement]... and for those who like one-page cheatsheets,

    http://www.efton.sk/STM32/Cortex_M4_faults.pdf

    ...[/shameless self-advertisement]