Fix memory layout

master
D4VID 4 months ago
parent b972a2fbbb
commit 4ad50ec94f

@ -2,7 +2,7 @@
use core::ptr::{read_volatile, write_volatile};
const BASE_POINTER: u32 = 0x2000_0000;
const BASE_POINTER: u32 = 0x1000_0000;
const NUMBER_DISPLAY_OFFSET: u32 = 0x00;
const RANDOM_NUMBER_OFFSET: u32 = 0x04;

@ -0,0 +1,14 @@
// build.rs
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
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();
println!("cargo:rustc-link-search={}", out_dir.display());
println!("cargo:rerun-if-changed=memory.x");
println!("cargo:rerun-if-changed=build.rs");
}

@ -1,9 +1,9 @@
MEMORY
{
INST : ORIGIN = 0x00000000, LENGTH = 256K
IO : ORIGIN = 0x20000000, LENGTH = 1K
CONST : ORIGIN = 0x40000000, LENGTH = 16K
RAM : ORIGIN = 0x80000000, LENGTH = 16K
IO : ORIGIN = 0x10000000, LENGTH = 1K
CONST : ORIGIN = 0x20000000, LENGTH = 16K
RAM : ORIGIN = 0x40000000, LENGTH = 16K
}
REGION_ALIAS("REGION_TEXT", INST);

Loading…
Cancel
Save