|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
CPU1 (Cortex-M33) image: blink LED1 through the HAL PCNTR primitive. More...
Go to the source code of this file.
Enumerations | |
| enum | m33_blink_const_t : uint32_t { k_blink_spins = 3000000U } |
| Blink-loop delay bound. More... | |
Functions | |
| void | cpu1_reset_handler (void) |
| CPU1 reset handler: minimal C-runtime init, then enter cpu1_main. | |
| static void | cpu1_main (void) |
| CPU1 application loop: blink LED1 (BLUE, P600) via the HAL primitive. | |
| static void | cpu1_fault_handler (void) |
| CPU1 default fault handler: park the core. | |
Variables | |
| uint32_t | g_ra8_ls_cpu1_stack_top |
| CPU1 stack top (slot 0 of the M33 vector table). | |
| uint32_t | g_ra8_ls_cpu1_data_start |
| CPU1 .data run-region start (in SRAM_CPU1). | |
| uint32_t | g_ra8_ls_cpu1_data_end |
| CPU1 .data run-region end. | |
| uint32_t | g_ra8_ls_cpu1_data_load |
| CPU1 .data load image (in MRAM_CPU1). | |
| uint32_t | g_ra8_ls_cpu1_bss_start |
| CPU1 .bss start (in SRAM_CPU1). | |
| uint32_t | g_ra8_ls_cpu1_bss_end |
| CPU1 .bss end. | |
| const uintptr_t | g_cpu1_vector_table [] |
CPU1 (Cortex-M33) image: blink LED1 through the HAL PCNTR primitive.
This is the HAL-based twin of hw_validated/hil/blink_m33/cpu1_main.c. It runs on the RA8D2's secondary Cortex-M33, is compiled as a wholly separate -ffreestanding ELF and embedded into the M85 ELF as a .cpu1_image blob, and the M85 releases it via ra8_cpu1_release (HUM Ch 2.9.1) before sleeping.
The ONE difference from the raw twin is the register access: instead of casting 0x404000C0 to a volatile uint32_t* and hand-rolling the combined {PODR,PDR} PCNTR1 store, it drives board LED1 (BLUE, P600 = PORT6 pin 0) through ra8_pcntr_set_output() – the CPU1-safe, header-only HAL primitive (issue #580). No ra8_hal object is linked; only the freestanding-clean inline accessor is included, so the image stays exactly as freestanding as before. This app exists ALONGSIDE the raw blink_m33 (which is kept as the deliberate raw-MMIO reference), demonstrating that the primitive substitutes at the M33 call site.
Definition in file cpu1_main.c.
| enum m33_blink_const_t : uint32_t |
Blink-loop delay bound.
The pin masks and PCNTR field layout now live inside ra8_pcntr_set_output(); the CPU1 image only owns the visible cadence.
| Enumerator | |
|---|---|
| k_blink_spins | Bounded busy-delay spins per LED half-cycle. |
Definition at line 62 of file cpu1_main.c.
|
static |
CPU1 default fault handler: park the core.
Every M33 exception slot routes here. The core stops making forward progress; on hardware a watchdog (if enabled) eventually resets.
Definition at line 156 of file cpu1_main.c.
|
static |
CPU1 application loop: blink LED1 (BLUE, P600) via the HAL primitive.
Each pass calls blink_m33_hal_step() – the shared one-iteration step (blink_m33_hal.h) that toggles the level and drives LED1 to it through ra8_pcntr_set_output() (the register access + HUM citation live in the primitive). A bounded busy-delay paces the blink. The same step is exercised by the host app-level test, so the tested logic is exactly this loop's. The M85 never writes this pin, so the transitions prove the M33 is running. See the file header.
Definition at line 88 of file cpu1_main.c.
References blink_m33_hal_step(), k_blink_spins, and k_ra8_level_low.
Referenced by cpu1_reset_handler().
| void cpu1_reset_handler | ( | void | ) |
CPU1 reset handler: minimal C-runtime init, then enter cpu1_main.
Copies .data from its MRAM_CPU1 load image into SRAM_CPU1 and zeroes .bss before any C code runs; the linker exports the region bounds as g_ra8_ls_cpu1_* symbols.
Definition at line 120 of file cpu1_main.c.
References cpu1_main(), g_ra8_ls_cpu1_bss_end, g_ra8_ls_cpu1_bss_start, g_ra8_ls_cpu1_data_end, g_ra8_ls_cpu1_data_load, and g_ra8_ls_cpu1_data_start.
| const uintptr_t g_cpu1_vector_table[] |
Definition at line 177 of file cpu1_main.c.
|
extern |
CPU1 .bss end.
|
extern |
CPU1 .bss start (in SRAM_CPU1).
|
extern |
CPU1 .data run-region end.
|
extern |
CPU1 .data load image (in MRAM_CPU1).
|
extern |
CPU1 .data run-region start (in SRAM_CPU1).
|
extern |
CPU1 stack top (slot 0 of the M33 vector table).