|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
On-silicon HIL: large-structure EPUB opens on the static arena (#144). More...
#include <stddef.h>#include <stdint.h>#include "epub.h"#include "epub_stress_fixture.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_err.h"#include "ra8_isr.h"#include "ra8_mstp.h"#include "ra8_time.h"Go to the source code of this file.
Enumerations | |
| enum | est_consts_t : uint32_t { k_est_uart_baud = 115200U , k_est_expect_chap = 60U , k_est_expect_toc = 60U , k_est_expect_files = 125U , k_est_dec_ten = 10U } |
| Console / assertion knobs (no magic numbers). More... | |
Functions | |
| static void | est_print (const uint8_t *msg, uint32_t len) |
| Emit a byte run on the SCI8 console. | |
| static void | est_panic_halt (const uint8_t *msg, uint32_t len) |
| Print the fail banner and trap (ra8_emulator halts on the BKPT). | |
| static void | est_print_uint (uint32_t value) |
| Print a small unsigned integer in decimal. | |
| static void | est_setup_or_halt (void) |
| Bring up clocks/MSTP/time + the SCI8 console; halt on failure. | |
| 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. | |
| void | main (void) |
| App entry: open the large-structure EPUB on silicon, print the banner. | |
Variables | |
| static epub_book_t | s_book |
| Opened book (large – file-scope, not on the stack). | |
| static const uint8_t | k_msg_boot [] = "epub-stress-hil: boot\r\n" |
| static const uint8_t | k_msg_fail [] = "epub-stress-hil: FAIL init\r\n" |
| static const uint8_t | k_msg_open [] = "epub-stress-hil: FAIL open (arena no_mem?)\r\n" |
| static const uint8_t | k_msg_chap [] = "epub-stress-hil: FAIL chapters\r\n" |
| static const uint8_t | k_msg_toc [] = "epub-stress-hil: FAIL toc\r\n" |
| static const uint8_t | k_msg_cov [] = "epub-stress-hil: FAIL cover\r\n" |
| static const uint8_t | k_msg_pre [] = "epub-stress-hil: files=125 chapters=" |
| static const uint8_t | k_msg_tocp [] = " toc=" |
| static const uint8_t | k_msg_covp [] = " cover=ok" |
| static const uint8_t | k_msg_ok [] = " PASS\r\n" |
On-silicon HIL: large-structure EPUB opens on the static arena (#144).
Regression gate for #144 bug 1 ("large EPUBs fail to open with no_mem"). On the firmware target, miniz's ZIP central directory uses a 96 KiB static arena while OPF and NCX parsing use fixed caller-owned XML workspaces. A big real book (many image files + a large OPF manifest) stresses both bounds. The original no_mem turned out to be the 16 KiB OPF/NCX scratch buffer (fixed in the NCX commit, now 48 KiB), not the arena – this gate proves the arena itself holds a large-structure book.
It opens a baked synthetic large-structure EPUB in memory – 60 chapters
The fixture is synthetic (not the copyrighted novel), tens of KB, so it bakes into MRAM and opens in memory like epub_parse. Deterministic, so the ra8_emulator CRC-free banner is the regression net:
epub-stress-hil: files=125 chapters=60 toc=60 cover=ok PASS
Any failure prints a FAIL banner and halts on a BKPT before PASS.
[Ring 7 / App] {World: NS}
Definition in file main.c.
| enum est_consts_t : uint32_t |
Console / assertion knobs (no magic numbers).
|
static |
Open the stress EPUB through bounded ZIP/XML paths; assert the structure.
Halts on any failure stage before returning. Proves the miniz arena and caller-owned XML workspaces handle a 125-entry / 60-chapter book and that the NCX + cover both parse.
| [out] | out_chap | Receives the parsed chapter count (== 60 on success). |
| [out] | out_toc | Receives the parsed NCX TOC count (== 60 on success). |
out_chap / out_toc are set. Definition at line 143 of file main.c.
References epub_get_chapter_count(), epub_get_toc_count(), epub_open(), est_panic_halt(), k_epub_stress_fixture, k_epub_stress_fixture_len, k_est_expect_chap, k_est_expect_toc, k_msg_chap, k_msg_cov, k_msg_open, k_msg_toc, k_ra8_ok, and s_book.
Referenced by main().
|
static |
Print the fail banner and trap (ra8_emulator halts on the BKPT).
Definition at line 83 of file main.c.
References est_print().
Referenced by est_open_or_halt(), and est_setup_or_halt().
|
static |
Emit a byte run on the SCI8 console.
Definition at line 77 of file main.c.
References ra8_board_uart_console_write().
Referenced by est_panic_halt(), est_print_uint(), and main().
|
static |
Print a small unsigned integer in decimal.
Definition at line 93 of file main.c.
References est_print(), and k_est_dec_ten.
Referenced by main().
|
static |
Bring up clocks/MSTP/time + the SCI8 console; halt on failure.
Definition at line 112 of file main.c.
References est_panic_halt(), k_est_uart_baud, k_msg_fail, k_ra8_clock_id_cpuclk0, k_ra8_ok, ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), and ra8_time_init().
Referenced by main().
| void main | ( | void | ) |
App entry: open the large-structure EPUB on silicon, print the banner.
The application entry point Reset_Handler hands control to.
Definition at line 174 of file main.c.
References est_open_or_halt(), est_print(), est_print_uint(), est_setup_or_halt(), k_msg_boot, k_msg_covp, k_msg_ok, k_msg_pre, k_msg_tocp, and ra8_isr_globals_enable().
|
static |
|
static |
|
static |
Definition at line 70 of file main.c.
Referenced by ec_render_cover_or_halt(), and est_open_or_halt().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 69 of file main.c.
Referenced by est_open_or_halt().
|
static |
|
static |