54typedef enum : uint32_t {
65static const uint8_t
k_msg_boot[] =
"epub-stress-hil: boot\r\n";
66static const uint8_t
k_msg_fail[] =
"epub-stress-hil: FAIL init\r\n";
67static const uint8_t
k_msg_open[] =
"epub-stress-hil: FAIL open (arena no_mem?)\r\n";
68static const uint8_t
k_msg_chap[] =
"epub-stress-hil: FAIL chapters\r\n";
69static const uint8_t
k_msg_toc[] =
"epub-stress-hil: FAIL toc\r\n";
70static const uint8_t
k_msg_cov[] =
"epub-stress-hil: FAIL cover\r\n";
71static const uint8_t
k_msg_pre[] =
"epub-stress-hil: files=125 chapters=";
77static void est_print(
const uint8_t* msg, uint32_t len)
86 __asm__
volatile(
"bkpt #0");
88 __asm__
volatile(
"wfi");
106 for (uint32_t i = 0U; i < n; i++) {
114 uint32_t cpuclk0_hz = 0U;
150 uint16_t chapters = 0U;
159 if (
s_book.cover_path[0] ==
'\0') {
162 *out_chap = chapters;
180 uint16_t chapters = 0U;
192 __asm__
volatile(
"wfi");
void main(void)
Secure fallback main entry point.
EPUB (.epub) reader and chapter iterator for ra8-firmware.
ra8_err_t epub_open(const void *media, const char *path, epub_book_t *out_book)
Open an EPUB book from an opaque media handle.
ra8_err_t epub_get_chapter_count(const epub_book_t *book, uint16_t *out_count)
Report how many chapters the spine contains.
ra8_err_t epub_get_toc_count(const epub_book_t *book, uint16_t *out_count)
Report how many table-of-contents entries the book exposes.
Baked synthetic large-structure EPUB3 for the #144 pool-stress gate.
@ k_epub_stress_fixture_len
EPUB stress fixture length.
static const uint8_t k_epub_stress_fixture[k_epub_stress_fixture_len]
Baked synthetic large-structure EPUB3 byte stream.
static epub_book_t s_book
Opened book (large – file-scope, not on the stack).
static const uint8_t k_msg_pre[]
static const uint8_t k_msg_ok[]
static const uint8_t k_msg_boot[]
static const uint8_t k_msg_chap[]
static const uint8_t k_msg_open[]
static const uint8_t k_msg_fail[]
static void est_setup_or_halt(void)
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
est_consts_t
Console / assertion knobs (no magic numbers).
@ k_est_expect_toc
navPoint count in the synthetic NCX.
@ k_est_dec_ten
Decimal base for the small printer.
@ k_est_expect_chap
Spine length of the synthetic book.
@ k_est_expect_files
Archive entries (reported, not gated).
@ k_est_uart_baud
Console baud.
static const uint8_t k_msg_tocp[]
static const uint8_t k_msg_cov[]
static const uint8_t k_msg_covp[]
static void est_print_uint(uint32_t value)
Print a small unsigned integer in decimal.
static void est_print(const uint8_t *msg, uint32_t len)
Emit a byte run on the SCI8 console.
static void est_open_or_halt(uint16_t *out_chap, uint16_t *out_toc)
Open the stress EPUB through bounded ZIP/XML paths; assert the structure.
static const uint8_t k_msg_toc[]
static void est_panic_halt(const uint8_t *msg, uint32_t len)
Print the fail banner and trap (ra8_emulator halts on the BKPT).
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.
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.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
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.