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
46
47#include <stdint.h>
48
49#include "ra8_attributes.h"
50#include "ra8_exception.h"
51#include "ra8_icu_regs.h"
52
81RA8_INTERNAL [[noreturn, gnu::used]] static void
83RA8_INTERNAL [[noreturn, gnu::used]] static void
85{
86 /* HUM Ch 14.2.13 "NMISR : Non-Maskable Interrupt Status Register" p 536-540 */
87 const uint32_t nmisr = *ra8_icu_nmisr();
88 ra8_exception_report_nmi(frame, nmisr);
89}
90
114void NMI_Handler(void);
115[[gnu::naked, noreturn]] void NMI_Handler(void)
116{
117 __asm__ volatile("tst lr, #4 \n"
118 "ite eq \n"
119 "mrseq r0, msp \n"
120 "mrsne r0, psp \n"
121 "b internal_ra8_board_nmi_report\n");
122}
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_ra8_board_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.