ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
nmi_exception.c
Go to the documentation of this file.
1
40
41#include <stdint.h>
42
43#include "ra8_attributes.h"
44#include "ra8_exception.h"
45#include "ra8_icu_regs.h"
46
75RA8_INTERNAL [[noreturn, gnu::used]] static void
77RA8_INTERNAL [[noreturn, gnu::used]] static void
79{
80 /* HUM Ch 14.2.13 "NMISR : Non-Maskable Interrupt Status Register" p 536-540 */
81 const uint32_t nmisr = *ra8_icu_nmisr();
82 ra8_exception_report_nmi(frame, nmisr);
83}
84
108void NMI_Handler(void);
109[[gnu::naked, noreturn]] void NMI_Handler(void)
110{
111 __asm__ volatile("tst lr, #4 \n"
112 "ite eq \n"
113 "mrseq r0, msp \n"
114 "mrsne r0, psp \n"
115 "b internal_nmi_report\n");
116}
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
void NMI_Handler(void)
Cortex-M85 NMI handler (vector table slot 2).
static void internal_nmi_report(const ra8_exception_frame_t *frame)
Read the ICU NMI cause and hand off to the common fault record.
Cortex-M85 CPU exception diagnostic helpers.
void ra8_exception_report_nmi(const ra8_exception_frame_t *frame, uint32_t nmisr)
Report an NMI with its ICU cause register, then halt.
Interrupt Control Unit (ICU) register layout for the Renesas RA8D2.
static volatile uint32_t * ra8_icu_nmisr(void)
Get pointer to the 32-bit NMISR register.
Stacked registers pushed by the Cortex-M exception entry.