|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Non-Secure main entry point: launches ThreadX and demo worker threads. More...
#include <stdint.h>#include <string.h>#include "ra8_err.h"#include "ra8_nsc.h"#include "tx_api.h"Go to the source code of this file.
Typedefs | |
| typedef void(* | ns_exc_handler_t) (void) |
Enumerations | |
| enum | ns_scb_addr_t : uintptr_t { k_ns_scb_vtor_addr = 0xE000ED08U } |
| Address of NS VTOR register. More... | |
| enum | ns_thread_stack_t : uint32_t { k_ns_ui_thread_stack_size = 2048U , k_ns_work_thread_stack_size = 2048U } |
| Stack sizes for Non-Secure ThreadX threads. More... | |
| enum | ns_log_cadence_t : uint32_t { k_ns_ui_heartbeat_iters = 50U , k_ns_work_heartbeat_iters = 10U } |
| Heartbeat-log cadence per thread (iterations between log lines). More... | |
| enum | ns_thread_cadence_t : uint16_t { k_ns_ui_sleep_ticks = 20U , k_ns_work_sleep_ticks = 100U } |
| Per-thread sleep cadence, in ThreadX ticks. More... | |
Functions | |
| void | PendSV_Handler (void) |
| void | _tx_timer_interrupt (void) |
| static void | ns_systick_handler (void) |
| SysTick exception handler for the Non-Secure ThreadX OS. | |
| static void | ns_panic_halt (void) |
| Park the CPU in an idle loop if a fatal startup error occurs. | |
| static void | ui_thread_entry (ULONG thread_input) |
| UI thread entry: logs periodically to simulate UI rendering loops. | |
| static void | work_thread_entry (ULONG thread_input) |
| Worker thread entry: simulates background sensors/storage processing. | |
| void | tx_application_define (void *first_unused_memory) |
| Setup ThreadX threads and resources. | |
| void | ns_reset_handler (void) |
| Non-Secure Reset handler: entered via Secure-to-NS transition. | |
| static void | ns_nmi_halt (void) |
Variables | |
| uint32_t | g_ra8_ls_ns_bss_start |
| uint32_t | g_ra8_ls_ns_bss_end |
| uint32_t | g_ra8_ls_ns_stack_top |
| uint32_t | g_ra8_ls_ns_run_start |
| static TX_THREAD | s_ui_thread |
| static TX_THREAD | s_work_thread |
| static uint8_t | s_ui_thread_stack [k_ns_ui_thread_stack_size] |
| static uint8_t | s_work_thread_stack [k_ns_work_thread_stack_size] |
| volatile uint32_t | g_ra8_threadx_systick_ready |
| 0 until _tx_initialize_low_level has armed ThreadX's SysTick + timer state; 1 afterwards. | |
| const ns_exc_handler_t | g_ra8_ns_vector_table [16] |
Non-Secure main entry point: launches ThreadX and demo worker threads.
This file is executed after the Secure world bootloader configures the SAU and jumps to ns_reset_handler. It operates entirely in Non-Secure state, leveraging ThreadX for multitasking and calling Secure services via NSC veneers.
Definition in file ns_main.c.
| enum ns_log_cadence_t : uint32_t |
| enum ns_scb_addr_t : uintptr_t |
| enum ns_thread_cadence_t : uint16_t |
Per-thread sleep cadence, in ThreadX ticks.
The UI thread runs the more responsive of the two so screen refreshes stay ahead of the background worker's batch work.
| Enumerator | |
|---|---|
| k_ns_ui_sleep_ticks | UI thread sleep between refreshes. |
| k_ns_work_sleep_ticks | Worker thread sleep between batches. |
| enum ns_thread_stack_t : uint32_t |
|
extern |
References g_ra8_threadx_systick_ready.
|
static |
Park the CPU in an idle loop if a fatal startup error occurs.
Definition at line 81 of file ns_main.c.
Referenced by ns_reset_handler().
| void ns_reset_handler | ( | void | ) |
Non-Secure Reset handler: entered via Secure-to-NS transition.
Slot 1 of the NS vector table and the NS image's linker entry symbol; the Secure boot BLXNS-es here. No header declares it because the only callers are the hardware vector fetch and the linker – the prototype below satisfies -Wmissing-prototypes for this externally-linked boot symbol.
Definition at line 191 of file ns_main.c.
References g_ra8_ls_ns_bss_end, g_ra8_ls_ns_bss_start, g_ra8_ls_ns_run_start, k_ns_scb_vtor_addr, k_ra8_ok, ns_panic_halt(), ra8_nsc_log_emit(), and ra8_nsc_periph_init().
|
static |
SysTick exception handler for the Non-Secure ThreadX OS.
Definition at line 71 of file ns_main.c.
References _tx_timer_interrupt(), and g_ra8_threadx_systick_ready.
|
extern |
| void tx_application_define | ( | void * | first_unused_memory | ) |
Setup ThreadX threads and resources.
Definition at line 141 of file ns_main.c.
References k_ns_ui_thread_stack_size, k_ns_work_thread_stack_size, s_ui_thread, s_ui_thread_stack, s_work_thread, s_work_thread_stack, TX_AUTO_START, TX_NO_TIME_SLICE, tx_thread_create, ui_thread_entry(), and work_thread_entry().
|
static |
UI thread entry: logs periodically to simulate UI rendering loops.
Definition at line 105 of file ns_main.c.
References k_ns_ui_heartbeat_iters, k_ns_ui_sleep_ticks, ra8_nsc_log_emit(), and tx_thread_sleep.
Referenced by tx_application_define().
|
static |
Worker thread entry: simulates background sensors/storage processing.
Definition at line 123 of file ns_main.c.
References k_ns_work_heartbeat_iters, k_ns_work_sleep_ticks, ra8_nsc_log_emit(), and tx_thread_sleep.
Referenced by tx_application_define().
|
extern |
|
extern |
|
extern |
|
extern |
| const ns_exc_handler_t g_ra8_ns_vector_table[16] |
|
extern |
0 until _tx_initialize_low_level has armed ThreadX's SysTick + timer state; 1 afterwards.
Set by the kernel once tx_initialize_low_level has run.
Read by the shared SysTick handler in libs/ra8_core/src/ra8_time.c.
Definition at line 58 of file tx_systick_ready.c.
|
static |
Definition at line 47 of file ns_main.c.
Referenced by tx_application_define().
|
static |
Definition at line 50 of file ns_main.c.
Referenced by tx_application_define().
|
static |
Definition at line 48 of file ns_main.c.
Referenced by tx_application_define().
|
static |
Definition at line 51 of file ns_main.c.
Referenced by tx_application_define().