|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
CPU1 (Cortex-M33 secondary core) autonomous counter image. More...
Go to the source code of this file.
Functions | |
| void | cpu1_reset_handler (void) |
| CPU1 reset handler: minimal C-runtime init, then enter cpu1_main. | |
| static void | cpu1_main (void) |
| CPU1 application: stamp signature, count autonomously, signal done. | |
| 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 secondary core) autonomous counter image.
This is the firmware that runs on the RA8D2's secondary core, the Cortex-M33. It is compiled as a wholly separate ELF (-mcpu=cortex-m33) and embedded into the M85 ELF as a .cpu1_image blob; the M85 releases this core at runtime via ra8_cpu1_release (HUM Ch 2.9.1 "CPU control registers").
Its job is intentionally tiny so the autonomous co-processor pattern is what stands out:
Definition in 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 161 of file cpu1_main.c.
|
static |
CPU1 application: stamp signature, count autonomously, signal done.
Writes the boot signature so the M85 can confirm the M33 left reset, then increments the shared counter k_bg_target_count times independently of the M85. Once counting is complete it sets done = 1 and spins. The M85 does nothing during the count except poll done – the key teaching point of this example.
Definition at line 77 of file cpu1_main.c.
References dualcore_bg_t::counter, dualcore_bg_t::done, dualcore_bg(), k_bg_m33_signature, k_bg_target_count, dualcore_bg_t::m33_sig, and RA8_LOOP_BOUND.
| void cpu1_reset_handler | ( | void | ) |
CPU1 reset handler: minimal C-runtime init, then enter cpu1_main.
The M33 boots with uninitialised RAM. Before any C code runs this copies .data from its MRAM_CPU1 load image into SRAM_CPU1 and zeroes .bss. The linker exports the region bounds as g_ra8_ls_cpu1_* symbols.
Definition at line 123 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, g_ra8_ls_cpu1_data_start, and RA8_LOOP_BOUND_RUNTIME.
| const uintptr_t g_cpu1_vector_table[] |
Definition at line 182 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).