|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
NSC veneers: secure-side watchdog arm + refresh. More...
Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_nsc_wdt_start (void) |
| NSC veneer: arm the Secure WDT with the e-reader configuration. | |
| void | ra8_nsc_wdt_refresh (void) |
| NSC veneer: refresh the Secure WDT down-counter. | |
Variables | |
| static const ra8_wdt_cfg_t | s_wdt_cfg |
| Fixed Secure-side WDT configuration used by ra8_nsc_wdt_start. | |
NSC veneers: secure-side watchdog arm + refresh.
The WDT (ra8_wdt, HUM Ch 27) is a Secure-owned peripheral – only the Secure world programmes WDTCR / WDTRR. The Non-Secure e-reader runs the ThreadX watchdog supervisor (ra8_wdt_supervisor), which decides in NS whether every worker thread is alive and, when so, must refresh the WDT down-counter. NS cannot touch WDTRR directly, so these two argument-free veneers give it a Secure gateway:
Neither veneer takes a pointer argument, so no cmse_check_address_range is required: nothing crosses the boundary that must be range-checked.
Definition in file ra8_nsc_wdt.c.
| void ra8_nsc_wdt_refresh | ( | void | ) |
NSC veneer: refresh the Secure WDT down-counter.
Forwards to ra8_wdt_refresh_deferred (WDTRR heartbeat). Installed as the ThreadX supervisor's ra8_wdt_sup_refresh_fn_t hook so the supervisor kicks the WDT only when every registered NS thread has checked in on time.
Definition at line 106 of file ra8_nsc_wdt.c.
References RA8_NSC_VENEER, and ra8_wdt_refresh_deferred().
Referenced by internal_wdt_setup().
|
nodiscard |
NSC veneer: arm the Secure WDT with the e-reader configuration.
Forwards to ra8_wdt_init with the fixed s_wdt_cfg. In register-start mode ra8_wdt_init programmes WDTCR/WDTRCR/WDTCSTPR and issues the unlock sequence that arms the down-counter, so the NS caller should invoke this immediately before starting the supervisor thread that refreshes it – keeping the arm-to-first-refresh gap small (as the flat demo does).
| k_ra8_ok | WDT configured and armed. |
| k_ra8_err_invalid_arg | The fixed configuration was rejected by the driver. |
Definition at line 82 of file ra8_nsc_wdt.c.
References RA8_NSC_VENEER, ra8_wdt_init(), and s_wdt_cfg.
Referenced by internal_wdt_setup().
|
static |
Fixed Secure-side WDT configuration used by ra8_nsc_wdt_start.
Mirrors the validated wdt_supervisor_demo configuration: a fully-open refresh window (window_start_100 / window_end_0 – no upper or lower bound, so any refresh before the timeout is accepted), the counter halted in Sleep, and expiry routed to NMI rather than an internal reset (switching to k_ra8_wdt_on_expiry_reset is a separate product decision). Living in the Secure .rodata it is never reachable from NS.
Definition at line 50 of file ra8_nsc_wdt.c.
Referenced by ra8_nsc_wdt_start().