Cortex M4 Fault Handler

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Cortex M4 Fault Handler

2,545件の閲覧回数
mr_s
Contributor I

I have a build system that makes use of LPCScrypt on a linux machine.  Everything works really well, except that without the ability to set breakpoints (no debugger nor IDE), I'm unable to debug as effectively as I'm used to.

cr_startup_lpc43xx.c describes a lot of great fault handlers I can implement, namely, HardFault_Handler.  But I don't have a good way to print out the call stack/all the function calls that led me to this terrible, terrible point.

Is there a template I can use to paste into one of these fault handlers to be able to printf() some basic state of the world before just dying silently?

Thank you,

//*****************************************************************************

// Default exception handlers. Override the ones here by defining your own

// handler routines in your application code.

//*****************************************************************************

__attribute__ ((section(".after_vectors")))

void NMI_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void HardFault_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void MemManage_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void BusFault_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void UsageFault_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void SVC_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void DebugMon_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void PendSV_Handler(void) {

    while (1) {

    }

}

__attribute__ ((section(".after_vectors")))

void SysTick_Handler(void) {

    while (1) {

    }

}

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,607件の閲覧回数
massimomanca
Contributor III
0 件の賞賛
返信

1,607件の閲覧回数
lpcxpresso_supp
NXP Employee
NXP Employee

The free version of the LPCXpresso.IDE is available for download here:

LPCXpresso IDE v8.2.0 NXP

Here's a FAQ for debugging a hard fault:

Debugging a Hard Fault

Thanks and regards,

LPCXpresso Support

0 件の賞賛
返信