Merge pull request #2597 from haukepetersen/add_stm32f0_corepanic
cpu/stm32f0: included core_panic module
This commit is contained in:
commit
c633c083db
@ -63,6 +63,15 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define CPUID_ID_LEN (12)
|
#define CPUID_ID_LEN (12)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Definition of different panic modes
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
HARD_FAULT, /**< hard fault */
|
||||||
|
NMI_HANDLER, /**< non maskable interrupt */
|
||||||
|
DUMMY_HANDLER /**< dummy interrupt handler */
|
||||||
|
} panic_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -19,7 +19,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "board.h"
|
|
||||||
|
#include "crash.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* memory markers as defined in the linker script
|
* memory markers as defined in the linker script
|
||||||
@ -79,42 +80,17 @@ void reset_handler(void)
|
|||||||
*/
|
*/
|
||||||
void dummy_handler(void)
|
void dummy_handler(void)
|
||||||
{
|
{
|
||||||
while (1) {asm ("nop");}
|
core_panic(DUMMY_HANDLER, "DUMMY HANDLER");
|
||||||
}
|
}
|
||||||
|
|
||||||
void isr_nmi(void)
|
void isr_nmi(void)
|
||||||
{
|
{
|
||||||
while (1) {asm ("nop");}
|
core_panic(NMI_HANDLER, "NMI HANDLER");
|
||||||
}
|
|
||||||
|
|
||||||
void isr_mem_manage(void)
|
|
||||||
{
|
|
||||||
while (1) {asm ("nop");}
|
|
||||||
}
|
|
||||||
|
|
||||||
void isr_debug_mon(void)
|
|
||||||
{
|
|
||||||
while (1) {asm ("nop");}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void isr_hard_fault(void)
|
void isr_hard_fault(void)
|
||||||
{
|
{
|
||||||
while (1) {
|
core_panic(HARD_FAULT, "HARD FAULT");
|
||||||
for (int i = 0; i < 250000; i++) {
|
|
||||||
asm ("nop");
|
|
||||||
}
|
|
||||||
LED_RED_TOGGLE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void isr_bus_fault(void)
|
|
||||||
{
|
|
||||||
while (1) {asm ("nop");}
|
|
||||||
}
|
|
||||||
|
|
||||||
void isr_usage_fault(void)
|
|
||||||
{
|
|
||||||
while (1) {asm ("nop");}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cortex-M specific interrupt vectors */
|
/* Cortex-M specific interrupt vectors */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user