72typedef enum : uint32_t {
76typedef enum : uint32_t {
102#ifndef RA8_OFF_TARGET
137 __asm__
volatile(
"wfi");
151 uint32_t cpuclk0_hz = 0U;
179 if (s == (
const char*)0) {
200 uint32_t i = (uint32_t)
sizeof(buf);
205 while ((value != 0U) && (i > 0U)) {
213#ifndef RA8_OFF_TARGET
244 static CHAR s_flash_name[] =
"ra8_xspi_nor";
248 if (status != LX_SUCCESS) {
253 if (status != LX_SUCCESS) {
279 if (status != LX_SUCCESS) {
310#ifndef LX_NOR_DISABLE_EXTENDED_CACHE
341 if (readback == counter) {
342 demo_print(
"[lx] sector rw verified readback=");
374 demo_print(
"[lx] formatting + opening LevelX partition\r\n");
378 uint32_t counter = 0U;
382 if (status != LX_SUCCESS) {
426 (void)first_unused_memory;
428 lx_nor_flash_initialize();
455 demo_print(
"[lx] booting ThreadX + LevelX...\r\n");
457#ifndef RA8_OFF_TARGET
void main(void)
Secure fallback main entry point.
static TX_THREAD s_demo_thread
demo_config_t
Compile-time settings for the HTTPS client demo.
@ k_demo_thread_stack
Demo thread stack.
static UCHAR s_demo_stack[k_demo_thread_stack]
void tx_application_define(void *first_unused_memory)
ThreadX system-define hook: build worker thread + byte pool.
@ k_demo_tick_ms
Battery decrement period.
static LX_NOR_FLASH s_nor_flash
LevelX control block (statically allocated – NASA P10 Rule 3).
static void demo_print(const char *msg)
Print a NUL-terminated string on the demo's UART stream.
static void demo_setup_or_halt(void)
Bring up CGC + SysTick + the SCI8 console; halt forever on any failure.
static void demo_panic_halt(void)
Halt forever in WFI – used as a panic stop on init failure.
static CHAR s_thread_name[]
static void demo_thread_entry(ULONG thread_input)
ThreadX worker entry: PSA + NetX up, connect, run the TLS session.
static void demo_print_wear_stats(void)
Dump LevelX's wear-levelling statistics to SCI8.
static void demo_print_u32(uint32_t value)
Print an unsigned 32-bit integer in decimal to SCI8.
static UINT demo_heartbeat(uint32_t counter)
Run one heartbeat: program counter into sector 0 + read back.
lx_log_pace_t
Compile-time settings for the LevelX wear-levelling demo.
@ k_lx_log_every_n
Log once every N loop iterations.
static ULONG s_demo_sector_io[k_demo_sector_bytes/sizeof(ULONG)]
static void demo_print_stat(const char *label, ULONG value)
Print one labelled ULONG LevelX statistic line over SCI8.
@ k_demo_burnin_writes
Number of heartbeats before printing wear-levelling stats.
@ k_demo_sector_bytes
LevelX bytes per logical sector (= 512).
@ k_demo_sector_index
LevelX logical sector the heartbeat counter is stored in.
@ k_demo_u32_buf_size
Buffer size for demo_print_u32 (10 digits + sign + NUL).
@ k_demo_radix_dec
Decimal radix used by demo_print_u32.
static void demo_report_rw_once(uint32_t counter, uint32_t readback)
Emit a one-shot HIL success banner after the first verified heartbeat.
static void demo_lx_format_or_panic(void)
Format + open the LevelX partition.
LevelX NOR-flash driver shim that bridges LevelX onto the RA8 ra8_xspi HAL (EK-RA8D2 ISSI IS25LX512M ...
UINT lx_nor_driver_ra8_xspi_initialize(LX_NOR_FLASH *nor_flash)
LevelX NOR driver-initialise entry point bridging onto ra8_xspi.
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
ra8_err_t ra8_board_uart_console_flush(void)
Block until every byte queued on the J-Link OB VCOM console has finished clocking out on the wire.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
size_t strlen(const char *s)
Calculate string length.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
unsigned int UINT
ThreadX-compatible unsigned int (host stub).
char CHAR
ThreadX-compatible CHAR (host stub).
unsigned long ULONG
ThreadX-compatible unsigned long (host stub).
Opaque thread stand-in for the host build.