|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Shared-SRAM control block for the M33 autonomous counter demo. More...
Go to the source code of this file.
Data Structures | |
| struct | dualcore_bg_t |
| Shared control block for the autonomous M33 counter demo. More... | |
Enumerations | |
| enum | bg_addr_t : uintptr_t { k_bg_sram_base = (uintptr_t)k_ra8_board_shared_ram_base } |
| Fixed SRAM address for the shared control block. More... | |
| enum | bg_const_t : uint32_t { k_bg_m33_signature = 0x33330033UL , k_bg_target_count = 1000U } |
| Protocol constants shared by both core images. More... | |
Functions | |
| static volatile dualcore_bg_t * | dualcore_bg (void) |
| Typed pointer to the fixed-address shared control block. | |
Shared-SRAM control block for the M33 autonomous counter demo.
This header defines the single shared-memory struct that lets the M85 observe the M33 running autonomously. The layout is intentionally minimal: three words at a fixed SRAM address that both cores can reach without any linker-visible symbol on the other core's image.
Why a fixed address? Each core is a separate compiled image with its own linker script, so a C-level global in one image is invisible to the other. Hard-coding the address is the one name both images resolve identically.
Address choice: 0x22100000 is the start of the upper on-chip SRAM region, just above the M85 secure SRAM the linker claims (0x22000000 + 1024K). The M33 image's 64 KiB bank lives far above it at the top of SRAM (0x22190000-0x221A0000), so neither linker script allocates these three words, leaving them free for shared use. Both cores can access this address because the on-chip SRAM bus is shared (HUM Ch 5.1 "Address Space" Table 5.1 p 239 – dual-core SRAM spans 0x22000000..0x221A0000).
Coherency: the M85 leaves its data cache off in system_init.c, so a single dsb drains the write buffer and makes a store visible to the other core. The fields are volatile so the compiler always emits real load/store instructions.
Protocol:
Definition in file dualcore_background.h.
| enum bg_addr_t : uintptr_t |
Fixed SRAM address for the shared control block.
The shared block sits at 0x22100000, the start of the upper on-chip SRAM region just above the M85 secure SRAM allocation (which ends at 0x22000000 + 1 MiB = 0x22100000). The M33 image's 64 KiB bank sits far above it at the top of on-chip SRAM (0x22190000-0x221A0000), so no linker script claims this range.
| Enumerator | |
|---|---|
| k_bg_sram_base | Shared block = window base. |
Definition at line 67 of file dualcore_background.h.
| enum bg_const_t : uint32_t |
Protocol constants shared by both core images.
k_bg_m33_signature is a distinctive bit pattern the M33 stamps on boot so the M85 can prove the second core left reset. The low byte (0x33) and the high word (0x3333) together make the value easy to spot in a memory-view debugger window.
| Enumerator | |
|---|---|
| k_bg_m33_signature | Boot sentinel written by M33. |
| k_bg_target_count | Increment iterations M33 runs. |
Definition at line 85 of file dualcore_background.h.
|
inlinestatic |
Typed pointer to the fixed-address shared control block.
Returns the same physical SRAM address whether called from the M85 image or the M33 image. Inlined so no shared translation unit is required.
| non-NULL | Always; the address is a compile-time constant. |
Definition at line 136 of file dualcore_background.h.
References k_bg_sram_base.
Referenced by cpu1_main(), and main().