vectors_cortexm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include "cpu_conf.h"
26 
31 #define WEAK_DEFAULT __attribute__((weak,alias("dummy_handler")))
32 
40 #define ISR_VECTOR(x) __attribute__((used,section(".vectors." # x )))
41 
48 #define CPU_NONISR_EXCEPTIONS (15)
49 
53 typedef void (*isr_t)(void);
54 
58 typedef struct {
59  void* _estack;
62 
74 
82 void nmi_handler(void);
83 
91 void hard_fault_default(void);
92 
93 /* The following four exceptions are only present for Cortex-M3 and -M4 CPUs */
94 #if defined(CPU_CORE_CORTEX_M3) || defined(CPU_CORE_CORTEX_M4) || \
95  defined(CPU_CORE_CORTEX_M4F) || defined(CPU_CORE_CORTEX_M7)
102 void mem_manage_default(void);
103 
109 void bus_fault_default(void);
110 
118 void usage_fault_default(void);
119 
126 void debug_mon_default(void);
127 #endif
128 
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
Structure of Cortex-M basic vector table.
void * _estack
exception stack pointer
void hard_fault_default(void)
Hard fault exception handler.
void(* isr_t)(void)
All ISR functions have this type.
void reset_handler_default(void)
This function is the default entry point after a system reset.
void nmi_handler(void)
Non-maskable interrupt handler.
#define CPU_NONISR_EXCEPTIONS
Number of Cortex-M non-ISR exceptions.
void dummy_handler_default(void)
Default handler used as weak alias for not implemented ISR vectors.