diff options
| author | Ian McIntyre <ianpmcintyre@gmail.com> | 2023-03-13 06:50:57 -0400 |
|---|---|---|
| committer | Ian McIntyre <me@mciantyre.dev> | 2025-11-11 08:24:38 -0500 |
| commit | 6f5633761528e484e8d0963c7ac59403f7210093 (patch) | |
| tree | f0a5f5ac03cc0a477491332adbe33bb2278faa4a /src/host.rs | |
| parent | 74d463340a87ff38a96c03a380bbed7c3ee56ba4 (diff) | |
Prototype API to build runtime in RAM
Just a proof-of-concept. The new inspect_elf test seems to show that
we're building the correct image. We need another commit in order to
help the program run in FlexRAM.
Diffstat (limited to 'src/host.rs')
| -rw-r--r-- | src/host.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/host.rs b/src/host.rs index 6a01f9d..56a9d0f 100644 --- a/src/host.rs +++ b/src/host.rs @@ -401,6 +401,27 @@ impl RuntimeBuilder { linker_script_name: DEFAULT_LINKER_SCRIPT_NAME.into(), } } + + /// Create a runtime that executes from RAM. + pub fn from_ram(family: Family) -> Self { + Self { + family, + flexram_banks: family.default_flexram_banks(), + text: Memory::Itcm, + rodata: Memory::Ocram, + data: Memory::Ocram, + vectors: Memory::Dtcm, + bss: Memory::Ocram, + uninit: Memory::Ocram, + stack: Memory::Dtcm, + stack_size: EnvOverride::new(8 * 1024), + heap: Memory::Dtcm, + heap_size: EnvOverride::new(0), + flash_opts: None, + linker_script_name: DEFAULT_LINKER_SCRIPT_NAME.into(), + } + } + /// Set the FlexRAM bank allocation. /// /// Use this to customize the sizes of DTCM, ITCM, and OCRAM. |
