Skip to content

Commit

Permalink
Make FMC's test-rt memory layout match real RT FW's
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegate010 authored and jhand2 committed Feb 15, 2024
1 parent 11edcf3 commit 6505bc9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 47 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions fmc/test-fw/test-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ ureg.workspace = true

[build-dependencies]
cfg-if.workspace = true
caliptra_common = { workspace = true, default-features = false }
caliptra-gen-linker-scripts.workspace = true

[dev-dependencies]
caliptra-builder.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions fmc/test-fw/test-rt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ fn main() {
use std::env;
use std::fs;
use std::path::PathBuf;
use caliptra_gen_linker_scripts::gen_memory_x;

let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

// Put the linker script somewhere the linker can find it.
fs::write(out_dir.join("memory.x"), include_bytes!("memory.x")).unwrap();
fs::write(out_dir.join("memory.x"),gen_memory_x(caliptra_common::RUNTIME_ORG, caliptra_common::RUNTIME_SIZE)
.as_bytes())
.expect("Unable to generate memory.x");

println!("cargo:rustc-link-search={}", out_dir.display());

println!("cargo:rerun-if-changed=memory.x");
Expand Down
45 changes: 0 additions & 45 deletions fmc/test-fw/test-rt/memory.x

This file was deleted.

0 comments on commit 6505bc9

Please sign in to comment.