µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
exception-handlers.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2015-2025 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software
6 * for any purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can
9 * be obtained from https://opensource.org/licenses/mit.
10 */
11
12#ifndef CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_
13#define CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_
14
15#include <stdint.h>
16
17#if defined(DEBUG)
18#define __DEBUG_BKPT() __asm__ volatile ("bkpt 0")
19#endif
20
21// ----------------------------------------------------------------------------
22
23#if defined(__cplusplus)
24extern "C"
25{
26#endif
27
28 extern void
29 Reset_Handler (void);
30
31 extern void
32 NMI_Handler (void);
33
34 extern void
36
37#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
38
39 extern void
40 MemManage_Handler (void);
41
42 extern void
43 BusFault_Handler (void);
44
45 extern void
46 UsageFault_Handler (void);
47
48 extern void
49 DebugMon_Handler (void);
50
51#endif
52
53 extern void
54 SVC_Handler (void);
55
56 extern void
57 PendSV_Handler (void);
58
59 extern void
60 SysTick_Handler (void);
61
62 // Exception Stack Frame for the Cortex-M3 and Cortex-M4 processor.
64 {
65 uint32_t r0;
66 uint32_t r1;
67 uint32_t r2;
68 uint32_t r3;
69 uint32_t r12;
70 uint32_t lr;
71 uint32_t pc;
72 uint32_t psr;
73#if defined(__ARM_ARCH_7EM__)
74 uint32_t s[16];
75#endif
77
78#if defined(TRACE)
79#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
80 void
81 dump_exception_stack (exception_stack_frame_t* frame, uint32_t cfsr,
82 uint32_t mmfar, uint32_t bfar, uint32_t lr);
83#endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
84#if defined(__ARM_ARCH_6M__)
85 void
86 dump_exception_stack (exception_stack_frame_t* frame, uint32_t lr);
87#endif // defined(__ARM_ARCH_6M__)
88#endif // defined(TRACE)
89
90 void
92
93#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
94
95 void
96 UsageFault_Handler_C (exception_stack_frame_t* frame, uint32_t lr);
97
98 void
99 BusFault_Handler_C (exception_stack_frame_t* frame, uint32_t lr);
100
101#endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
102
103#if defined(__cplusplus)
104}
105#endif
106
107// ----------------------------------------------------------------------------
108
109#endif /* CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_ */
void HardFault_Handler(void)
void SVC_Handler(void)
void HardFault_Handler_C(exception_stack_frame_t *frame, uint32_t lr)
void PendSV_Handler(void)
void NMI_Handler(void)
void SysTick_Handler(void)
void Reset_Handler(void)
struct exception_stack_frame_s exception_stack_frame_t