Skip to main content
-----????_---- ---??as
Associate II
Sep 8, 2017 9:38 AM UTC
Solved

Next or previous statement

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.
    AvaTar
    AvaTarBest answer
    Senior III
    Sep 8, 2017 10:24 AM UTC
    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
    Sep 8, 2017 10:24 AM UTC
    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
    Sep 8, 2017 12:56 PM UTC
    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]