|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
CPU0 (M85) Secure fallback entry for the single-core S->NS demo. More...
Go to the source code of this file.
Functions | |
| void | main (void) |
| CPU0 S-side fallback entry point. | |
Variables | |
| volatile uint32_t | g_tz_nsc_cgc_usb_s_fallback_count = 0U |
| Bench diagnostic: bumps when the S-side fallback main runs. | |
CPU0 (M85) Secure fallback entry for the single-core S->NS demo.
On the happy path this function is never reached. SystemInit calls ra8_trustzone_init, which programmes the SAU via ra8_tz_secure_boot_sau_init and then BLXNS-es into the NS image at 0x02080000 (ns_reset_handler in ns_main.c). BLXNS does not return on hardware, so the Reset_Handler step that calls main() is unreachable.
If the BLXNS path fails – the NS vector table is blank, the SAU could not be programmed, or the secure-boot library returned for some other reason – the fallback main() runs and stamps a diagnostic counter. Bench memprobe scripts read this counter via SWD to distinguish "BLXNS succeeded -> main never ran" (counter stays 0) from "BLXNS failed -> main ran" (counter advances).
The fallback parks the CPU in a NOP loop so it cannot accidentally touch NS-attributed memory or peripherals from S state.
Definition in file main.c.
| void main | ( | void | ) |
CPU0 S-side fallback entry point.
The application entry point Reset_Handler hands control to.
See file header.
Definition at line 76 of file main.c.
References g_tz_nsc_cgc_usb_s_fallback_count.
| volatile uint32_t g_tz_nsc_cgc_usb_s_fallback_count = 0U |
Bench diagnostic: bumps when the S-side fallback main runs.
Stays 0 on the happy path because BLXNS in ra8_trustzone_init never returns. Any non-zero value means the secure-boot library bailed out before transferring control to the NS image – bench scripts should treat that as a regression in the TZ scaffolding, not in the NS app logic.
Definition at line 58 of file main.c.
Referenced by main().