Mbed OS Reference
Loading...
Searching...
No Matches
mbed_crash_data_offsets.h
1/* mbed Microcontroller Library
2 * Copyright (c) 2006-2019 ARM Limited
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef MBED_CRASH_DATA_INFO_H
18#define MBED_CRASH_DATA_INFO_H
19
20#include "platform/internal/mbed_fault_handler.h"
21#include "platform/mbed_error.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED
28/** \ingroup mbed-os-internal */
29/** \addtogroup platform-internal-api */
30/** @{*/
31// Any changes here must be reflected in except.S if they affect the fault handler.
32// The fault context is first to keep it simple for the assembler.
33typedef struct mbed_crash_data {
34 union {
36 int pad[32];
37 } fault;
38 union {
39 mbed_error_ctx context;
40 int pad[32];
41 } error;
42} mbed_crash_data_t;
43
44#if defined(__ARMCC_VERSION)
45#define MBED_CRASH_DATA Image$$RW_m_crash_data$$ZI$$Base
46#elif defined(__ICCARM__)
47#define MBED_CRASH_DATA __CRASH_DATA_RAM_START__
48#elif defined(__GNUC__)
49#define MBED_CRASH_DATA __CRASH_DATA_RAM_START__
50#endif
51
52extern mbed_crash_data_t MBED_CRASH_DATA;
53/**@}*/
54#endif
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif
MBED_NORETURN void error(const char *format,...) MBED_PRINTF(1
To generate a fatal compile-time error, you can use the pre-processor error directive.
mbed_error_ctx struct
Definition: mbed_error.h:834