|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Shared contract for the "render a held e-reader page on the M33" demo. More...
Go to the source code of this file.
Data Structures | |
| struct | erm33_mailbox_t |
| Cross-core progress block backed by a fixed shared-SRAM address. More... | |
Enumerations | |
| enum | erm33_mailbox_addr_t : uintptr_t { k_erm33_mailbox_addr = (uintptr_t)k_ra8_board_shared_ram_base } |
| Fixed shared-SRAM base address of the progress mailbox. More... | |
| enum | erm33_sdram_addr_t : uintptr_t { k_erm33_sdram_base = 0x68000000U , k_erm33_sdram_end = 0x6C000000U } |
| Base + extent of the external SDRAM window the held page lives in. More... | |
| enum | erm33_fb_geom_t : uint32_t { k_erm33_fb_width = 256U , k_erm33_fb_height = 64U , k_erm33_fb_bpp = 2U , k_erm33_fb_stride = 512U , k_erm33_fb_bytes = 32768U , k_erm33_fb_cols = 32U , k_erm33_fb_rows = 4U } |
| Geometry of the RGB565 page framebuffer both images agree on. More... | |
| enum | erm33_const_t : uint32_t { k_erm33_magic = 0x45524D33U , k_erm33_m33_sig = 0x33524452U , k_erm33_status_running = 0U , k_erm33_status_ok = 1U , k_erm33_status_bad_book = 2U , k_erm33_status_render_fail = 3U , k_erm33_fb_format_rgb565 = 2U , k_erm33_page_chars = 128U } |
| Signatures, status codes, the RGB565 format tag, and the page width shared by both core images. More... | |
| enum | erm33_cycle_t : uint32_t { k_erm33_max_turns = 3U , k_erm33_touch_dwell = 4096U } |
| Bounds for the #150 park / wake / re-render mode-switch cycle. More... | |
Functions | |
| static volatile erm33_mailbox_t * | erm33_mailbox (void) |
| Typed pointer to the fixed-address shared progress mailbox. | |
Shared contract for the "render a held e-reader page on the M33" demo.
This header pins the cross-core contract for the #150 power-saving model: the Cortex-M85 (primary, "CPU0") does the one-time heavy work – it owns the baked book and could open / compile it at 1 GHz – then hands the reader to the Cortex-M33 (secondary, "CPU1") and PARKS. The slow core renders one held e-reader page into a real RGB565 framebuffer in external SDRAM through the production ra8_gfx text path, then HOLDS that page – exactly the idle posture an e-reader spends almost all its time in, now at a fraction of the power while the M85 @ 1 GHz sleeps in WFI. "Power saving = drop to the slow core."
Two shared regions both core images must agree on:
Why the M33 CRCs its own framebuffer: on the ra8_emulator host emulator the two cores share only the on-chip SRAM host buffer; each core's external-SDRAM window is a separate mapping, so the parked M85 cannot read back the bytes the M33 wrote at 0x68000000. The M33 therefore reads its own SDRAM framebuffer back to fold a CRC-32 – which is itself the proof that real pixels landed in SDRAM – and publishes that value through the shared mailbox. The M85 reports the published CRC; the ra8_emulator gate asserts it against a golden. On silicon the single physical SDRAM is shared, so an M85 re-read would match.
Coherency: this app's system_init.c leaves the M85 data cache OFF, so a store from one core is visible to the other once a dsb has drained the write buffer; no cache clean / invalidate dance is needed. The mailbox fields are volatile so the compiler emits a real load / store on every access.
Protocol (the reader handoff + the held-page handshake + the #150 mode-switch):
Definition in file ereader_m33.h.
| enum erm33_const_t : uint32_t |
Signatures, status codes, the RGB565 format tag, and the page width shared by both core images.
k_erm33_magic ("ERM3") lets the M33 confirm the mailbox is live before trusting it; k_erm33_m33_sig is the boot sentinel the M33 stamps so the M85 can prove the second core left reset. k_erm33_fb_format_rgb565 is the ra8_gfx_format_t value the M33 publishes in fb_format (cross-checked against the real enum by a static_assert in the M33 image). k_erm33_page_chars is the fixed character capacity of the held page.
Definition at line 168 of file ereader_m33.h.
| enum erm33_cycle_t : uint32_t |
Bounds for the #150 park / wake / re-render mode-switch cycle.
The M85 parks and the M33 holds the page; k_erm33_max_turns is the deterministic number of page-turn handoffs the demo exercises before both cores park for good. k_erm33_touch_dwell is the bounded count of hold-loop iterations the M33 spins as a fake touch latency between page turns – a deterministic stand-in for polling the GT911 touch controller (the real touch poll is a HIL follow-up, see the README). Kept small so the ra8_emulator gate completes the whole cycle in a handful of instruction chunks. Both are uint32_t so the M33 / M85 loop bounds are a single fixed type.
| Enumerator | |
|---|---|
| k_erm33_max_turns | Page-turn handoffs the cycle exercises. |
| k_erm33_touch_dwell | M33 hold-loop spins per simulated touch wait. |
Definition at line 196 of file ereader_m33.h.
| enum erm33_fb_geom_t : uint32_t |
Geometry of the RGB565 page framebuffer both images agree on.
A small landscape page strip rendered through ra8_gfx: RGB565 (two bytes per pixel, the EK-RA8D2 panel's native format), k_erm33_fb_width pixels wide by k_erm33_fb_height tall. With the 8x16 ra8_gfx font that is k_erm33_fb_cols glyph columns by k_erm33_fb_rows glyph rows, enough for the k_erm33_page_chars characters one held page carries. Kept deliberately tiny so the CRC-32 over the whole plane is fast and stable for the ra8_emulator gate.
Definition at line 143 of file ereader_m33.h.
| enum erm33_mailbox_addr_t : uintptr_t |
Fixed shared-SRAM base address of the progress mailbox.
The mailbox sits at the base of the CPU0 <-> CPU1 window. The window itself is a board fact, declared once in ra8_board_ek_ra8d2_dualcore.h along with why both linker scripts leave it free; this app only names its own slice of it.
| Enumerator | |
|---|---|
| k_erm33_mailbox_addr | Mailbox base = window base. |
Definition at line 104 of file ereader_m33.h.
| enum erm33_sdram_addr_t : uintptr_t |
Base + extent of the external SDRAM window the held page lives in.
The 64 MiB external SDRAM maps at 0x68000000. The M33 places its page framebuffer in .sdram_bss near this base and publishes the exact address in fb_base; the M85 only uses these bounds to sanity-check that the published base lies inside the SDRAM window. Declared uintptr_t so the constants cast to a pointer correctly on both the 32-bit target and the 64-bit unit-test host.
| Enumerator | |
|---|---|
| k_erm33_sdram_base | External SDRAM window base. |
| k_erm33_sdram_end | External SDRAM window end (+64 MiB). |
Definition at line 122 of file ereader_m33.h.
|
inlinestatic |
Typed pointer to the fixed-address shared progress mailbox.
Inlined so both core images compute the identical address with no shared translation unit. Returns the same physical SRAM location on the M85 and the M33.
| non-NULL | Always; the address is a compile-time constant. |
Definition at line 263 of file ereader_m33.h.
References k_erm33_mailbox_addr.
Referenced by cpu1_run_reader(), and main().