ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
vector_table.c File Reference

Cortex-M85 vector table and default interrupt handlers for RA8D2/RA8P1. More...

#include <stdint.h>
#include "ra8_boot_entry.h"
#include "ra8_exception.h"
#include "ra8_lpm_safe_boot.h"
Include dependency graph for vector_table.c:

Go to the source code of this file.

Macros

#define RA8_IRQ_STUB(n)
 RA8 IRQ STUB.
#define E(n)

Typedefs

typedef void(* exc_handler_t) (void)

Enumerations

enum  : uint16_t { k_ra8_irq_count = 112U }
enum  ra8_vector_exc_t : uint32_t {
  k_ra8_vector_hardfault = 3U ,
  k_ra8_vector_memmanage = 4U ,
  k_ra8_vector_busfault = 5U ,
  k_ra8_vector_usagefault = 6U
}
 Exception numbers matching the Cortex-M vector table slots. More...

Functions

void Reset_Handler (void)
 Enter an RA8P1 firmware image after processor reset.
void HardFault_Handler (void)
 Capture a HardFault and transfer to the common exception reporter.
void MemManage_Handler (void)
 Capture a MemManage fault and transfer to the exception reporter.
void BusFault_Handler (void)
 Capture a BusFault and transfer to the common exception reporter.
void UsageFault_Handler (void)
 Capture a UsageFault and transfer to the common exception reporter.
void NMI_Handler (void)
 Cortex-M85 NMI handler (vector table slot 2).
void SecureFault_Handler (void)
 Cortex-M85 SecureFault handler (vector table slot 7).
void SVC_Handler (void)
void DebugMon_Handler (void)
void PendSV_Handler (void)
void SysTick_Handler (void)
 Service the SysTick exception selected by the linked application.
void IRQ0_Handler (void)
void IRQ1_Handler (void)
void IRQ2_Handler (void)
void IRQ3_Handler (void)
void IRQ4_Handler (void)
void IRQ5_Handler (void)
void IRQ6_Handler (void)
void IRQ7_Handler (void)
void IRQ8_Handler (void)
void IRQ9_Handler (void)
void IRQ10_Handler (void)
void IRQ11_Handler (void)
void IRQ12_Handler (void)
void IRQ13_Handler (void)
void IRQ14_Handler (void)
void IRQ15_Handler (void)
void IRQ16_Handler (void)
void IRQ17_Handler (void)
void IRQ18_Handler (void)
void IRQ19_Handler (void)
void IRQ20_Handler (void)
void IRQ21_Handler (void)
void IRQ22_Handler (void)
void IRQ23_Handler (void)
void IRQ24_Handler (void)
void IRQ25_Handler (void)
void IRQ26_Handler (void)
void IRQ27_Handler (void)
void IRQ28_Handler (void)
void IRQ29_Handler (void)
void IRQ30_Handler (void)
void IRQ31_Handler (void)
void IRQ32_Handler (void)
void IRQ33_Handler (void)
void IRQ34_Handler (void)
void IRQ35_Handler (void)
void IRQ36_Handler (void)
void IRQ37_Handler (void)
void IRQ38_Handler (void)
void IRQ39_Handler (void)
void IRQ40_Handler (void)
void IRQ41_Handler (void)
void IRQ42_Handler (void)
void IRQ43_Handler (void)
void IRQ44_Handler (void)
void IRQ45_Handler (void)
void IRQ46_Handler (void)
void IRQ47_Handler (void)
void IRQ48_Handler (void)
void IRQ49_Handler (void)
void IRQ50_Handler (void)
void IRQ51_Handler (void)
void IRQ52_Handler (void)
void IRQ53_Handler (void)
void IRQ54_Handler (void)
void IRQ55_Handler (void)
void IRQ56_Handler (void)
void IRQ57_Handler (void)
void IRQ58_Handler (void)
void IRQ59_Handler (void)
void IRQ60_Handler (void)
void IRQ61_Handler (void)
void IRQ62_Handler (void)
void IRQ63_Handler (void)
void IRQ64_Handler (void)
void IRQ65_Handler (void)
void IRQ66_Handler (void)
void IRQ67_Handler (void)
void IRQ68_Handler (void)
void IRQ69_Handler (void)
void IRQ70_Handler (void)
void IRQ71_Handler (void)
void IRQ72_Handler (void)
void IRQ73_Handler (void)
void IRQ74_Handler (void)
void IRQ75_Handler (void)
void IRQ76_Handler (void)
void IRQ77_Handler (void)
void IRQ78_Handler (void)
void IRQ79_Handler (void)
void IRQ80_Handler (void)
void IRQ81_Handler (void)
void IRQ82_Handler (void)
void IRQ83_Handler (void)
void IRQ84_Handler (void)
void IRQ85_Handler (void)
void IRQ86_Handler (void)
void IRQ87_Handler (void)
void IRQ88_Handler (void)
void IRQ89_Handler (void)
void IRQ90_Handler (void)
void IRQ91_Handler (void)
void IRQ92_Handler (void)
void IRQ93_Handler (void)
void IRQ94_Handler (void)
void IRQ95_Handler (void)
void IRQ96_Handler (void)
void IRQ97_Handler (void)
void IRQ98_Handler (void)
void IRQ99_Handler (void)
void IRQ100_Handler (void)
void IRQ101_Handler (void)
void IRQ102_Handler (void)
void IRQ103_Handler (void)
void IRQ104_Handler (void)
void IRQ105_Handler (void)
void IRQ106_Handler (void)
void IRQ107_Handler (void)
void IRQ108_Handler (void)
void IRQ109_Handler (void)
void IRQ110_Handler (void)
void IRQ111_Handler (void)
void Default_Handler (void)
 Catch-all handler for every exception slot nothing else claims.

Variables

uint32_t g_ra8_ls_stack_top
 Top of main stack (linker symbol).
uint32_t g_ra8_ls_sdata
 Start of .data in SRAM.
uint32_t g_ra8_ls_edata
 End of .data in SRAM.
uint32_t g_ra8_ls_sidata
 Source of .data in MRAM.
uint32_t g_ra8_ls_sbss
 Start of .bss in SRAM.
uint32_t g_ra8_ls_ebss
 End of .bss in SRAM.
const exc_handler_t g_ra8_vector_table_start [16U+k_ra8_irq_count]

Detailed Description

Cortex-M85 vector table and default interrupt handlers for RA8D2/RA8P1.

Tag
[Ring 1 / Boot] {World: S}
Note
RA8P1 board layer (issue #226): this chip-boot TU is byte-identical to the EK-RA8D2 copy. The RA8P1 (R7KA8P1KFLCAC) shares the RA8D2 Cortex-M85 vector layout and IRQ event numbering (see libs/ra8_core/inc/ra8_device.h), so the vector table is common. The RA8P1 foundation apps (examples/ra8p1_foundation) currently override this with an app-local vector_table.c; this canonical copy serves future RA8P1 apps that do not.

Emits the interrupt vector table that the Cortex-M85 reads at reset from the address in its VTOR register. Slot 0 is the initial main stack pointer, slot 1 is the Reset_Handler, and slots 2..15 are the standard ARM core exceptions. Slots 16+ are peripheral IRQs routed through the ICU's IELSR table.

Every handler is declared weak and aliased to Default_Handler, so application code can override any of them by declaring a non-weak function with the same name.

Linker-provided symbols

  • _stack_top: end of the main stack, set in the linker script.
  • _etext, _sdata, _edata, _sbss, _ebss: section boundaries used by Reset_Handler to copy initialized data from flash/MRAM to SRAM and zero the BSS.

Definition in file vector_table.c.

Macro Definition Documentation

◆ E

#define E ( n)
Value:
IRQ##n##_Handler

◆ RA8_IRQ_STUB

#define RA8_IRQ_STUB ( n)
Value:
[[gnu::weak, gnu::alias("Default_Handler")]] void IRQ##n##_Handler(void)

RA8 IRQ STUB.

Definition at line 136 of file vector_table.c.

Typedef Documentation

◆ exc_handler_t

typedef void(* exc_handler_t) (void)

Definition at line 67 of file vector_table.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint16_t
Enumerator
k_ra8_irq_count 

RA8 IRQ count.

Definition at line 127 of file vector_table.c.

◆ ra8_vector_exc_t

enum ra8_vector_exc_t : uint32_t

Exception numbers matching the Cortex-M vector table slots.

Enumerator
k_ra8_vector_hardfault 

RA8 vector hardfault.

k_ra8_vector_memmanage 

RA8 vector memmanage.

k_ra8_vector_busfault 

RA8 vector busfault.

k_ra8_vector_usagefault 

RA8 vector usagefault.

Definition at line 479 of file vector_table.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

Capture a BusFault and transfer to the common exception reporter.

Selects the faulting MSP or PSP from EXC_RETURN and supplies architectural exception number 5 to ra8_exception_report(). Off-target builds call the same reporter with a null frame.

Precondition
A BusFault was raised, or the off-target test invokes the handler.
The common exception reporter is linked into the image.
Postcondition
The reporter receives exception number 5 and the available frame.
Control does not return to the faulting context.
Note
Runs in fault context and is not thread-callable.
Since
0.1.0

Definition at line 543 of file vector_table.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

◆ Default_Handler()

void Default_Handler ( void )

Catch-all handler for every exception slot nothing else claims.

The core exception vectors are declared weak and aliased here, so an unclaimed exception lands in this function instead of an unmapped address. An application overrides any one of them by defining a non-weak function with the matching handler name.

Precondition
The CPU has taken an exception with no dedicated handler.
The vector table is the one at VTOR.
Postcondition
Control does not return to the interrupted context.
The image is halted or reset, per the board's policy.
Note
Callable from interrupt context; it is an exception handler.
Warning
Reaching this means an exception was not wired up. Treat it as a bug in the image, not as a recovery path.
See also
SystemInit()
Since
0.1.0

Definition at line 606 of file vector_table.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

Capture a HardFault and transfer to the common exception reporter.

Selects the faulting MSP or PSP from EXC_RETURN and supplies architectural exception number 3 to ra8_exception_report(). Off-target builds call the same reporter with a null frame.

Precondition
A HardFault was raised, or the off-target test invokes the handler.
The common exception reporter is linked into the image.
Postcondition
The reporter receives exception number 3 and the available frame.
Control does not return to the faulting context.
Note
Runs in fault context and is not thread-callable.
Since
0.1.0

Definition at line 499 of file vector_table.c.

◆ IRQ0_Handler()

void IRQ0_Handler ( void )

Definition at line 161 of file vector_table.c.

◆ IRQ100_Handler()

void IRQ100_Handler ( void )

Definition at line 261 of file vector_table.c.

◆ IRQ101_Handler()

void IRQ101_Handler ( void )

Definition at line 262 of file vector_table.c.

◆ IRQ102_Handler()

void IRQ102_Handler ( void )

Definition at line 263 of file vector_table.c.

◆ IRQ103_Handler()

void IRQ103_Handler ( void )

Definition at line 264 of file vector_table.c.

◆ IRQ104_Handler()

void IRQ104_Handler ( void )

Definition at line 265 of file vector_table.c.

◆ IRQ105_Handler()

void IRQ105_Handler ( void )

Definition at line 266 of file vector_table.c.

◆ IRQ106_Handler()

void IRQ106_Handler ( void )

Definition at line 267 of file vector_table.c.

◆ IRQ107_Handler()

void IRQ107_Handler ( void )

Definition at line 268 of file vector_table.c.

◆ IRQ108_Handler()

void IRQ108_Handler ( void )

Definition at line 269 of file vector_table.c.

◆ IRQ109_Handler()

void IRQ109_Handler ( void )

Definition at line 270 of file vector_table.c.

◆ IRQ10_Handler()

void IRQ10_Handler ( void )

Definition at line 171 of file vector_table.c.

◆ IRQ110_Handler()

void IRQ110_Handler ( void )

Definition at line 271 of file vector_table.c.

◆ IRQ111_Handler()

void IRQ111_Handler ( void )

Definition at line 272 of file vector_table.c.

◆ IRQ11_Handler()

void IRQ11_Handler ( void )

Definition at line 172 of file vector_table.c.

◆ IRQ12_Handler()

void IRQ12_Handler ( void )

Definition at line 173 of file vector_table.c.

◆ IRQ13_Handler()

void IRQ13_Handler ( void )

Definition at line 174 of file vector_table.c.

◆ IRQ14_Handler()

void IRQ14_Handler ( void )

Definition at line 175 of file vector_table.c.

◆ IRQ15_Handler()

void IRQ15_Handler ( void )

Definition at line 176 of file vector_table.c.

◆ IRQ16_Handler()

void IRQ16_Handler ( void )

Definition at line 177 of file vector_table.c.

◆ IRQ17_Handler()

void IRQ17_Handler ( void )

Definition at line 178 of file vector_table.c.

◆ IRQ18_Handler()

void IRQ18_Handler ( void )

Definition at line 179 of file vector_table.c.

◆ IRQ19_Handler()

void IRQ19_Handler ( void )

Definition at line 180 of file vector_table.c.

◆ IRQ1_Handler()

void IRQ1_Handler ( void )

Definition at line 162 of file vector_table.c.

◆ IRQ20_Handler()

void IRQ20_Handler ( void )

Definition at line 181 of file vector_table.c.

◆ IRQ21_Handler()

void IRQ21_Handler ( void )

Definition at line 182 of file vector_table.c.

◆ IRQ22_Handler()

void IRQ22_Handler ( void )

Definition at line 183 of file vector_table.c.

◆ IRQ23_Handler()

void IRQ23_Handler ( void )

Definition at line 184 of file vector_table.c.

◆ IRQ24_Handler()

void IRQ24_Handler ( void )

Definition at line 185 of file vector_table.c.

◆ IRQ25_Handler()

void IRQ25_Handler ( void )

Definition at line 186 of file vector_table.c.

◆ IRQ26_Handler()

void IRQ26_Handler ( void )

Definition at line 187 of file vector_table.c.

◆ IRQ27_Handler()

void IRQ27_Handler ( void )

Definition at line 188 of file vector_table.c.

◆ IRQ28_Handler()

void IRQ28_Handler ( void )

Definition at line 189 of file vector_table.c.

◆ IRQ29_Handler()

void IRQ29_Handler ( void )

Definition at line 190 of file vector_table.c.

◆ IRQ2_Handler()

void IRQ2_Handler ( void )

Definition at line 163 of file vector_table.c.

◆ IRQ30_Handler()

void IRQ30_Handler ( void )

Definition at line 191 of file vector_table.c.

◆ IRQ31_Handler()

void IRQ31_Handler ( void )

Definition at line 192 of file vector_table.c.

◆ IRQ32_Handler()

void IRQ32_Handler ( void )

Definition at line 193 of file vector_table.c.

◆ IRQ33_Handler()

void IRQ33_Handler ( void )

Definition at line 194 of file vector_table.c.

◆ IRQ34_Handler()

void IRQ34_Handler ( void )

Definition at line 195 of file vector_table.c.

◆ IRQ35_Handler()

void IRQ35_Handler ( void )

Definition at line 196 of file vector_table.c.

◆ IRQ36_Handler()

void IRQ36_Handler ( void )

Definition at line 197 of file vector_table.c.

◆ IRQ37_Handler()

void IRQ37_Handler ( void )

Definition at line 198 of file vector_table.c.

◆ IRQ38_Handler()

void IRQ38_Handler ( void )

Definition at line 199 of file vector_table.c.

◆ IRQ39_Handler()

void IRQ39_Handler ( void )

Definition at line 200 of file vector_table.c.

◆ IRQ3_Handler()

void IRQ3_Handler ( void )

Definition at line 164 of file vector_table.c.

◆ IRQ40_Handler()

void IRQ40_Handler ( void )

Definition at line 201 of file vector_table.c.

◆ IRQ41_Handler()

void IRQ41_Handler ( void )

Definition at line 202 of file vector_table.c.

◆ IRQ42_Handler()

void IRQ42_Handler ( void )

Definition at line 203 of file vector_table.c.

◆ IRQ43_Handler()

void IRQ43_Handler ( void )

Definition at line 204 of file vector_table.c.

◆ IRQ44_Handler()

void IRQ44_Handler ( void )

Definition at line 205 of file vector_table.c.

◆ IRQ45_Handler()

void IRQ45_Handler ( void )

Definition at line 206 of file vector_table.c.

◆ IRQ46_Handler()

void IRQ46_Handler ( void )

Definition at line 207 of file vector_table.c.

◆ IRQ47_Handler()

void IRQ47_Handler ( void )

Definition at line 208 of file vector_table.c.

◆ IRQ48_Handler()

void IRQ48_Handler ( void )

Definition at line 209 of file vector_table.c.

◆ IRQ49_Handler()

void IRQ49_Handler ( void )

Definition at line 210 of file vector_table.c.

◆ IRQ4_Handler()

void IRQ4_Handler ( void )

Definition at line 165 of file vector_table.c.

◆ IRQ50_Handler()

void IRQ50_Handler ( void )

Definition at line 211 of file vector_table.c.

◆ IRQ51_Handler()

void IRQ51_Handler ( void )

Definition at line 212 of file vector_table.c.

◆ IRQ52_Handler()

void IRQ52_Handler ( void )

Definition at line 213 of file vector_table.c.

◆ IRQ53_Handler()

void IRQ53_Handler ( void )

Definition at line 214 of file vector_table.c.

◆ IRQ54_Handler()

void IRQ54_Handler ( void )

Definition at line 215 of file vector_table.c.

◆ IRQ55_Handler()

void IRQ55_Handler ( void )

Definition at line 216 of file vector_table.c.

◆ IRQ56_Handler()

void IRQ56_Handler ( void )

Definition at line 217 of file vector_table.c.

◆ IRQ57_Handler()

void IRQ57_Handler ( void )

Definition at line 218 of file vector_table.c.

◆ IRQ58_Handler()

void IRQ58_Handler ( void )

Definition at line 219 of file vector_table.c.

◆ IRQ59_Handler()

void IRQ59_Handler ( void )

Definition at line 220 of file vector_table.c.

◆ IRQ5_Handler()

void IRQ5_Handler ( void )

Definition at line 166 of file vector_table.c.

◆ IRQ60_Handler()

void IRQ60_Handler ( void )

Definition at line 221 of file vector_table.c.

◆ IRQ61_Handler()

void IRQ61_Handler ( void )

Definition at line 222 of file vector_table.c.

◆ IRQ62_Handler()

void IRQ62_Handler ( void )

Definition at line 223 of file vector_table.c.

◆ IRQ63_Handler()

void IRQ63_Handler ( void )

Definition at line 224 of file vector_table.c.

◆ IRQ64_Handler()

void IRQ64_Handler ( void )

Definition at line 225 of file vector_table.c.

◆ IRQ65_Handler()

void IRQ65_Handler ( void )

Definition at line 226 of file vector_table.c.

◆ IRQ66_Handler()

void IRQ66_Handler ( void )

Definition at line 227 of file vector_table.c.

◆ IRQ67_Handler()

void IRQ67_Handler ( void )

Definition at line 228 of file vector_table.c.

◆ IRQ68_Handler()

void IRQ68_Handler ( void )

Definition at line 229 of file vector_table.c.

◆ IRQ69_Handler()

void IRQ69_Handler ( void )

Definition at line 230 of file vector_table.c.

◆ IRQ6_Handler()

void IRQ6_Handler ( void )

Definition at line 167 of file vector_table.c.

◆ IRQ70_Handler()

void IRQ70_Handler ( void )

Definition at line 231 of file vector_table.c.

◆ IRQ71_Handler()

void IRQ71_Handler ( void )

Definition at line 232 of file vector_table.c.

◆ IRQ72_Handler()

void IRQ72_Handler ( void )

Definition at line 233 of file vector_table.c.

◆ IRQ73_Handler()

void IRQ73_Handler ( void )

Definition at line 234 of file vector_table.c.

◆ IRQ74_Handler()

void IRQ74_Handler ( void )

Definition at line 235 of file vector_table.c.

◆ IRQ75_Handler()

void IRQ75_Handler ( void )

Definition at line 236 of file vector_table.c.

◆ IRQ76_Handler()

void IRQ76_Handler ( void )

Definition at line 237 of file vector_table.c.

◆ IRQ77_Handler()

void IRQ77_Handler ( void )

Definition at line 238 of file vector_table.c.

◆ IRQ78_Handler()

void IRQ78_Handler ( void )

Definition at line 239 of file vector_table.c.

◆ IRQ79_Handler()

void IRQ79_Handler ( void )

Definition at line 240 of file vector_table.c.

◆ IRQ7_Handler()

void IRQ7_Handler ( void )

Definition at line 168 of file vector_table.c.

◆ IRQ80_Handler()

void IRQ80_Handler ( void )

Definition at line 241 of file vector_table.c.

◆ IRQ81_Handler()

void IRQ81_Handler ( void )

Definition at line 242 of file vector_table.c.

◆ IRQ82_Handler()

void IRQ82_Handler ( void )

Definition at line 243 of file vector_table.c.

◆ IRQ83_Handler()

void IRQ83_Handler ( void )

Definition at line 244 of file vector_table.c.

◆ IRQ84_Handler()

void IRQ84_Handler ( void )

Definition at line 245 of file vector_table.c.

◆ IRQ85_Handler()

void IRQ85_Handler ( void )

Definition at line 246 of file vector_table.c.

◆ IRQ86_Handler()

void IRQ86_Handler ( void )

Definition at line 247 of file vector_table.c.

◆ IRQ87_Handler()

void IRQ87_Handler ( void )

Definition at line 248 of file vector_table.c.

◆ IRQ88_Handler()

void IRQ88_Handler ( void )

Definition at line 249 of file vector_table.c.

◆ IRQ89_Handler()

void IRQ89_Handler ( void )

Definition at line 250 of file vector_table.c.

◆ IRQ8_Handler()

void IRQ8_Handler ( void )

Definition at line 169 of file vector_table.c.

◆ IRQ90_Handler()

void IRQ90_Handler ( void )

Definition at line 251 of file vector_table.c.

◆ IRQ91_Handler()

void IRQ91_Handler ( void )

Definition at line 252 of file vector_table.c.

◆ IRQ92_Handler()

void IRQ92_Handler ( void )

Definition at line 253 of file vector_table.c.

◆ IRQ93_Handler()

void IRQ93_Handler ( void )

Definition at line 254 of file vector_table.c.

◆ IRQ94_Handler()

void IRQ94_Handler ( void )

Definition at line 255 of file vector_table.c.

◆ IRQ95_Handler()

void IRQ95_Handler ( void )

Definition at line 256 of file vector_table.c.

◆ IRQ96_Handler()

void IRQ96_Handler ( void )

Definition at line 257 of file vector_table.c.

◆ IRQ97_Handler()

void IRQ97_Handler ( void )

Definition at line 258 of file vector_table.c.

◆ IRQ98_Handler()

void IRQ98_Handler ( void )

Definition at line 259 of file vector_table.c.

◆ IRQ99_Handler()

void IRQ99_Handler ( void )

Definition at line 260 of file vector_table.c.

◆ IRQ9_Handler()

void IRQ9_Handler ( void )

Definition at line 170 of file vector_table.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

Capture a MemManage fault and transfer to the exception reporter.

Selects the faulting MSP or PSP from EXC_RETURN and supplies architectural exception number 4 to ra8_exception_report(). Off-target builds call the same reporter with a null frame.

Precondition
A MemManage fault was raised, or the off-target test invokes the handler.
The common exception reporter is linked into the image.
Postcondition
The reporter receives exception number 4 and the available frame.
Control does not return to the faulting context.
Note
Runs in fault context and is not thread-callable.
Since
0.1.0

Definition at line 521 of file vector_table.c.

◆ NMI_Handler()

void NMI_Handler ( void )

Cortex-M85 NMI handler (vector table slot 2).

Strong definition overriding the weak NMI_Handler alias in every per-app vector_table.c. Naked trampoline in the exact shape of the HardFault/MemManage/BusFault/UsageFault/SecureFault trampolines: tst lr, #4 selects the interrupted stack (MSP when EXC_RETURN[2] = 0, else PSP) into r0 and control tail-branches into internal_nmi_report(), which appends the ICU cause. Naked asm is required: only assembly can read EXC_RETURN and the banked stack pointers before the compiler touches any register.

Precondition
The Cortex-M85 has taken the NMI exception.
The C runtime stack selected by EXC_RETURN[2] holds the frame.
Postcondition
Control transfers to internal_nmi_report() and never returns.
The interrupted context's frame pointer is in r0.
Note
Runs only in NMI context and is not thread-callable.
Since
0.1.0

Strong definition overriding the weak NMI_Handler alias in every per-app vector_table.c. Naked trampoline in the exact shape of the HardFault/MemManage/BusFault/UsageFault/SecureFault trampolines: tst lr, #4 selects the interrupted stack (MSP when EXC_RETURN[2] = 0, else PSP) into r0 and control tail-branches into internal_ra8_board_nmi_report(), which appends the ICU cause. Naked asm is required: only assembly can read EXC_RETURN and the banked stack pointers before the compiler touches any register.

Precondition
The Cortex-M85 has taken the NMI exception.
The C runtime stack selected by EXC_RETURN[2] holds the frame.
Postcondition
Control transfers to internal_ra8_board_nmi_report() and never returns.
The interrupted context's frame pointer is in r0.
Note
Runs only in NMI context and is not thread-callable.
Since
0.1.0

Definition at line 109 of file nmi_exception.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

◆ Reset_Handler()

void Reset_Handler ( void )

Enter an RA8P1 firmware image after processor reset.

Clears stale low-power state, performs the core-only system setup, copies initialised data, clears BSS, and transfers control to the firmware entry point. If control returns, the handler parks the core.

Precondition
The linker-provided data, BSS, and stack boundaries are valid.
The processor entered through vector slot 1 with the initial MSP loaded.
Postcondition
C runtime storage is initialised before main() consumes it.
Control reaches main() or the terminal fallback loop.
Note
Single-core boot entry; not thread-safe and not expected to return.
Since
0.1.0

Definition at line 429 of file vector_table.c.

References g_ra8_ls_ebss, g_ra8_ls_edata, g_ra8_ls_sbss, g_ra8_ls_sdata, g_ra8_ls_sidata, main(), ra8_lpm_safe_boot(), and SystemInit().

◆ SecureFault_Handler()

void SecureFault_Handler ( void )

Cortex-M85 SecureFault handler (vector table slot 7).

Strong definition overriding the weak SecureFault_Handler alias in every per-app vector_table.c. Naked trampoline in the exact shape of the HardFault/MemManage/BusFault/UsageFault trampolines: tst lr, #4 selects the faulting stack (MSP when EXC_RETURN[2] = 0, else PSP), r1 carries the architectural exception number 7, and control tail-branches into ra8_exception_report(), which snapshots the frame

  • SFSR/SFAR and halts. Naked asm is required: only assembly can read EXC_RETURN and the banked stack pointers before the compiler touches any register.
Precondition
The Cortex-M85 has taken a SecureFault (SHCSR.SECUREFAULTENA=1).
The C runtime stack selected by EXC_RETURN[2] holds the frame.
Postcondition
Control transfers to ra8_exception_report() and never returns.
g_ra8_exception_last carries exc_number 7 plus the SFSR/SFAR pair.
Note
Runs only in SecureFault context and is not thread-callable.
TrustZone Safety:
  • Validates: nothing – this is an exception entry point.
  • Trusts: the SFSR/SFAR snapshot belongs to the failing access.
  • Denies: any return path. The handler does not RET.
Since
0.1.0

Cortex-M85 SecureFault handler (vector table slot 7).

Vector_table.c installs this in the SecureFault slot when the firmware is built with RA8_TRUSTZONE_ENABLE. With TZ off the function is dead-stripped because nothing references it.

Precondition
Cortex-M85 has raised a SecureFault.
The Secure exception stack contains the interrupted context.
Postcondition
Logs the SFSR snapshot and spins.
Interrupts remain masked until an external reset.
Note
Runs only in Secure exception context and never returns.
Since
0.1.0
TrustZone Safety:
  • Validates: nothing – this is an exception entry point.
  • Trusts: the SFSR snapshot belongs to the failing access.
  • Denies: any return path. The handler does not RET.

Definition at line 71 of file secure_exception.c.

◆ SVC_Handler()

void SVC_Handler ( void )

◆ SysTick_Handler()

void SysTick_Handler ( void )
extern

Service the SysTick exception selected by the linked application.

Resolves to the weak core timebase handler unless a strong RTOS or application handler overrides it. The vector table references the selected implementation without owning its subsystem policy.

Precondition
Entered for a SysTick exception with a valid exception frame.
The selected handler's timebase or scheduler state is initialised.
Postcondition
The selected implementation has processed one SysTick event.
The vector table itself remains unchanged.
Note
Runs in handler mode; thread-safety follows the selected implementation.
Since
0.1.0

Service the SysTick exception selected by the linked application.

The weak firmware implementation advances the millisecond counter, then services linked ThreadX and USB hooks when their weak symbols and readiness state permit. The host-test implementation advances only the counter. An application may replace either weak definition with a strong handler.

Precondition
The handler is entered for one SysTick event or a host-test equivalent.
On target, ra8_time_init() configured the SysTick period.
Postcondition
s_tick_ms has advanced by exactly one.
Optional subsystem hooks run only when linked and ready.
Note
IRQ-safe; the weak symbol may be overridden by an application handler.
Since
0.1.0

Service the SysTick exception selected by the linked application.

Precondition
Called from exception context (IPSR == 15).
_tx_initialize_low_level has programmed SysTick.
Postcondition
One ThreadX tick elapsed; PendSV may be pending.

Service one SysTick event for the core timebase.

Resolves to the weak core timebase handler unless a strong RTOS or application handler overrides it. The vector table references the selected implementation without owning its subsystem policy.

Precondition
Entered for a SysTick exception with a valid exception frame.
The selected handler's timebase or scheduler state is initialised.
Postcondition
The selected implementation has processed one SysTick event.
The vector table itself remains unchanged.
Note
Runs in handler mode; thread-safety follows the selected implementation.
Since
0.1.0

The weak firmware implementation advances the millisecond counter, then services linked ThreadX and USB hooks when their weak symbols and readiness state permit. The host-test implementation advances only the counter. An application may replace either weak definition with a strong handler.

Precondition
The handler is entered for one SysTick event or a host-test equivalent.
On target, ra8_time_init() configured the SysTick period.
Postcondition
s_tick_ms has advanced by exactly one.
Optional subsystem hooks run only when linked and ready.
Note
IRQ-safe; the weak symbol may be overridden by an application handler.
Since
0.1.0

Service the SysTick exception selected by the linked application.

The weak firmware implementation advances the millisecond counter, then services linked ThreadX and USB hooks when their weak symbols and readiness state permit. The host-test implementation advances only the counter. An application may replace either weak definition with a strong handler.

Precondition
The handler is entered for one SysTick event or a host-test equivalent.
On target, ra8_time_init() configured the SysTick period.
Postcondition
s_tick_ms has advanced by exactly one.
Optional subsystem hooks run only when linked and ready.
Note
IRQ-safe; the weak symbol may be overridden by an application handler.
Since
0.1.0

Service the SysTick exception selected by the linked application.

Precondition
Called from exception context (IPSR == 15).
_tx_initialize_low_level has programmed SysTick.
Postcondition
One ThreadX tick elapsed; PendSV may be pending.

Definition at line 244 of file ra8_time.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

Capture a UsageFault and transfer to the common exception reporter.

Selects the faulting MSP or PSP from EXC_RETURN and supplies architectural exception number 6 to ra8_exception_report(). Off-target builds call the same reporter with a null frame.

Precondition
A UsageFault was raised, or the off-target test invokes the handler.
The common exception reporter is linked into the image.
Postcondition
The reporter receives exception number 6 and the available frame.
Control does not return to the faulting context.
Note
Runs in fault context and is not thread-callable.
Since
0.1.0

Definition at line 565 of file vector_table.c.

Variable Documentation

◆ g_ra8_ls_ebss

uint32_t g_ra8_ls_ebss
extern

End of .bss in SRAM.

◆ g_ra8_ls_edata

uint32_t g_ra8_ls_edata
extern

End of .data in SRAM.

◆ g_ra8_ls_sbss

uint32_t g_ra8_ls_sbss
extern

Start of .bss in SRAM.

◆ g_ra8_ls_sdata

uint32_t g_ra8_ls_sdata
extern

Start of .data in SRAM.

◆ g_ra8_ls_sidata

uint32_t g_ra8_ls_sidata
extern

Source of .data in MRAM.

◆ g_ra8_ls_stack_top

uint32_t g_ra8_ls_stack_top
extern

Top of main stack (linker symbol).

◆ g_ra8_vector_table_start

const exc_handler_t g_ra8_vector_table_start[16U+k_ra8_irq_count]

Definition at line 275 of file vector_table.c.