|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
CPU0 (Cortex-M85 primary core) launcher for the M33 blink template. More...
#include <stddef.h>#include <stdint.h>#include "ra8_attributes.h"#include "ra8_board_ek_ra8d2_peripherals.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_dual_core.h"#include "ra8_err.h"#include "ra8_log.h"Go to the source code of this file.
Enumerations | |
| enum | blink_m33_hil_t : uint32_t { k_blink_m33_hil_baud = 115200U } |
| VCOM-console line rate for the deterministic HIL success banner. More... | |
Functions | |
| static bool | internal_console_init (void) |
| Bring up the SCI8 / J-Link OB VCOM console for the HIL success banner. | |
| static void | internal_emit_pass (void) |
| Emit the deterministic HIL success banner over the VCOM console. | |
| static void | internal_park_forever (void) |
| Park the M85 forever after an unrecoverable startup failure. | |
| static void | internal_idle_forever (void) |
| Idle the M85 forever once the M33 owns the work (low-power posture). | |
| void | main (void) |
| CPU0 (Cortex-M85) application entry. | |
Variables | |
| uint32_t | g_ra8_ls_cpu1_mram_start |
| Base of the embedded M33 image / its vector table (MRAM_CPU1). | |
| uint32_t | g_ra8_ls_cpu1_stack_top |
| Initial stack pointer handed to the M33 at release. | |
| static const uint8_t | s_blink_m33_pass_banner [] = "blink_m33: m33 released PASS\r\n" |
| Deterministic HIL banner: the M33 secondary core was released (uart_scrape). | |
CPU0 (Cortex-M85 primary core) launcher for the M33 blink template.
This is the firmware that runs on the RA8D2's primary core, the Cortex-M85, out of reset. It is the canonical "target the M33" template (issue #152): the M85 does the minimum – release the secondary Cortex-M33 and then sleep – and the M33 owns the work. Here the work is blinking LED1, but any portable app drops into cpu1_main.c the same way.
Everything the M85 does is logged with ra8_log, which the emulator echoes as [itm] lines (the J-Link SWO trace analog). The M33's proof-of-life is the blinking LED the M85 never drives. See README.md.
Definition in file main.c.
| enum blink_m33_hil_t : uint32_t |
VCOM-console line rate for the deterministic HIL success banner.
The EK-RA8D2 J-Link OB VCOM bridge (SCI8, PD02/PD03) runs 8N1 at this rate; the Pi HIL rig's uart_scrape reads /dev/ttyACM0 to gate the app. The banner is additive to the existing ra8_log ITM trace.
| Enumerator | |
|---|---|
| k_blink_m33_hil_baud | VCOM console line rate (8N1). |
|
static |
Bring up the SCI8 / J-Link OB VCOM console for the HIL success banner.
Configures the clock tree (ra8_cgc_init, which publishes the PCLKA the SCI8 BRR divisor is computed from – and which the released M33 then shares) then the EK-RA8D2 debug console (ra8_board_uart_console_init, SCI8 on PD02/PD03 at k_blink_m33_hil_baud). Best-effort: a failure only means the additive HIL banner cannot reach the host; the existing ra8_log ITM trace and the M33 release are unaffected.
| true | Clock + SCI8 console are up. |
| false | A bring-up step failed (the banner is then silently skipped). |
Definition at line 103 of file main.c.
References k_blink_m33_hil_baud, k_ra8_ok, ra8_board_uart_console_init(), ra8_cgc_init(), and RA8_INTERNAL.
Referenced by main().
|
static |
Emit the deterministic HIL success banner over the VCOM console.
Writes s_blink_m33_pass_banner to the SCI8 / J-Link OB VCOM console and flushes it so the bytes clock out before the M85 parks in WFI. A no-op if the console never came up (the write returns k_ra8_err_not_initialized, ignored).
Definition at line 132 of file main.c.
References ra8_board_uart_console_flush(), ra8_board_uart_console_write(), RA8_INTERNAL, and s_blink_m33_pass_banner.
Referenced by main().
|
static |
Idle the M85 forever once the M33 owns the work (low-power posture).
After releasing the M33 the M85 has nothing to do, so it sleeps in a WFI loop. Modelling the heavy core asleep while the lean M33 runs is the low-power co-processor posture this template exists to demonstrate.
Definition at line 182 of file main.c.
References RA8_INTERNAL.
Referenced by main().
|
static |
Park the M85 forever after an unrecoverable startup failure.
Reached only if ra8_cpu1_release fails, so the M33 never started. The core spins with the failure already logged.
Definition at line 156 of file main.c.
References RA8_INTERNAL.
Referenced by main().
| void main | ( | void | ) |
CPU0 (Cortex-M85) application entry.
The application entry point Reset_Handler hands control to.
Brings up logging, releases the Cortex-M33 (which then blinks LED1), and idles. See the file header for the teaching narrative.
Definition at line 203 of file main.c.
References g_ra8_ls_cpu1_mram_start, g_ra8_ls_cpu1_stack_top, internal_console_init(), internal_emit_pass(), internal_idle_forever(), internal_park_forever(), k_ra8_ok, ra8_cpu1_release(), ra8_log_info, ra8_log_info_val, and ra8_log_init().
|
extern |
Base of the embedded M33 image / its vector table (MRAM_CPU1).
|
extern |
Initial stack pointer handed to the M33 at release.
|
static |
Deterministic HIL banner: the M33 secondary core was released (uart_scrape).
This template has no shared-SRAM mailbox – the M33's proof-of-life is the LED1 blink the M85 never drives. The strongest verdict the M85 can report over VCOM is that ra8_cpu1_release succeeded; the operator (or the bench rig) confirms the blink visually. Emitted only on the success path, additive to the existing ra8_log ITM trace, so the Pi rig (which has no SWO / ITM capture) can gate the boot + release path.
Definition at line 78 of file main.c.
Referenced by internal_emit_pass().