Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions runner/src/elf2tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ pub fn convert_elf(cli: &Cli, platform: &str) -> OutFiles {
let package_name = cli.elf.file_stem().expect("ELF must be a file");
let mut tab_path = cli.elf.clone();
tab_path.set_extension("tab");
let protected_size = TBF_HEADER_SIZE.to_string();
if cli.verbose {
println!("Package name: {:?}", package_name);
println!("TAB path: {}", tab_path.display());
println!("Protected region size: {}", protected_size);
}
let stack_size = read_stack_size(cli);
let elf = cli.elf.as_os_str();
Expand Down Expand Up @@ -71,7 +69,6 @@ pub fn convert_elf(cli: &Cli, platform: &str) -> OutFiles {
"--kernel-minor".as_ref(), "0".as_ref(),
"-n".as_ref(), package_name,
"-o".as_ref(), tab_path.as_os_str(),
"--protected-region-size".as_ref(), protected_size.as_ref(),
"--stack".as_ref(), stack_size.as_ref(),
format!("{},{}", elf.to_str().unwrap(), architecture).as_ref(),
]);
Expand Down Expand Up @@ -113,11 +110,6 @@ pub struct OutFiles {
pub tbf_path: PathBuf,
}

// The amount of space to reserve for the TBF header. This must match the
// TBF_HEADER_SIZE value in the layout file for the platform, which is currently
// 0x60 for all platforms.
const TBF_HEADER_SIZE: u32 = 0x60;

// Reads the stack size, and returns it as a String for use on elf2tab's command
// line.
fn read_stack_size(cli: &Cli) -> String {
Expand Down
12 changes: 7 additions & 5 deletions runtime/layouts/apollo3.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Apollo3 MCU, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00040000, LENGTH = 0x00060000
RAM (W) : ORIGIN = 0x10002000, LENGTH = 0x2000
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00040000;
FLASH_LENGTH = 0x00060000;

RAM_START = 0x10002000;
RAM_LENGTH = 0x2000;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/clue_nrf52840.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the micro:bit v2 board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00080000, LENGTH = 512K
RAM (W) : ORIGIN = 0x20006000, LENGTH = 216K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00080000;
FLASH_LENGTH = 512K;

RAM_START = 0x20006000;
RAM_LENGTH = 216K;

INCLUDE libtock_layout.ld
15 changes: 7 additions & 8 deletions runtime/layouts/esp32_c3_devkitm_1.ld
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* Layout for the esp32c3 DevKit M1 board, used by the examples in this repository. */

MEMORY {
/* Note that the SRAM address may need to be changed depending on
* the kernel binary, check for the actual address of APP_MEMORY!
*/
FLASH (X) : ORIGIN = 0x403B0000, LENGTH = 0x30000
RAM (W) : ORIGIN = 0x3FCA1800, LENGTH = 0x2E800
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x403B0000;
FLASH_LENGTH = 0x30000;

RAM_START = 0x3FCA2000;
RAM_LENGTH = 0x2E000;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/hail.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Hail board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00030000, LENGTH = 0x00040000
RAM (W) : ORIGIN = 0x20008000, LENGTH = 62K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00030000;
FLASH_LENGTH = 0x00040000;

RAM_START = 0x20008000;
RAM_LENGTH = 62K;

INCLUDE libtock_layout.ld
15 changes: 7 additions & 8 deletions runtime/layouts/hifive1.ld
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* Layout for the RISC-V 32 boards, used by the examples in this repository. */

MEMORY {
/* Note that the SRAM address may need to be changed depending on
* the kernel binary, check for the actual address of APP_MEMORY!
*/
FLASH (X) : ORIGIN = 0x20040000, LENGTH = 32M
RAM (W) : ORIGIN = 0x80002800, LENGTH = 0x1800
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x20040000;
FLASH_LENGTH = 32M;

RAM_START = 0x80003000;
RAM_LENGTH = 0x1000;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/imix.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Imix board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00040000, LENGTH = 0x00040000
RAM (W) : ORIGIN = 0x20008000, LENGTH = 62K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00040000;
FLASH_LENGTH = 0x00040000;

RAM_START = 0x20008000;
RAM_LENGTH = 62K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/imxrt1050.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the iMX.RT1050 board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x63002000, LENGTH = 0x1000000
RAM (W) : ORIGIN = 0x20004000, LENGTH = 112K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x63002000;
FLASH_LENGTH = 0x1000000;

RAM_START = 0x20004000;
RAM_LENGTH = 112K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/microbit_v2.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the micro:bit v2 board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00040000, LENGTH = 256K
RAM (W) : ORIGIN = 0x20004000, LENGTH = 112K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00040000;
FLASH_LENGTH = 256K;

RAM_START = 0x20004000;
RAM_LENGTH = 112K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/msp432.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
MEMORY {
FLASH (X) : ORIGIN = 0x00020000, LENGTH = 0x00020000
RAM (W) : ORIGIN = 0x20004000, LENGTH = 0x2000
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00020000;
FLASH_LENGTH = 0x00020000;

RAM_START = 0x20004000;
RAM_LENGTH = 0x2000;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/nano_rp2040_connect.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Raspberry Pi Pico board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x10020000, LENGTH = 256K
RAM (W) : ORIGIN = 0x20004000, LENGTH = 248K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x10020000;
FLASH_LENGTH = 256K;

RAM_START = 0x20004000;
RAM_LENGTH = 248K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/nrf52.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the nRF52-DK, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00030000, LENGTH = 0x00060000
RAM (W) : ORIGIN = 0x20004000, LENGTH = 62K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00030000;
FLASH_LENGTH = 0x00060000;

RAM_START = 0x20004000;
RAM_LENGTH = 62K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/nrf52840.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the nRF52840-DK, usable by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x00030000, LENGTH = 0x000D0000
RAM (W) : ORIGIN = 0x20008000, LENGTH = 46K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x00030000;
FLASH_LENGTH = 0x000D0000;

RAM_START = 0x20008000;
RAM_LENGTH = 46K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/nucleo_f429zi.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Nucleo F429zi, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x08040000, LENGTH = 255K
RAM (W) : ORIGIN = 0x20004000, LENGTH = 112K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x08040000;
FLASH_LENGTH = 255K;

RAM_START = 0x20004000;
RAM_LENGTH = 112K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/nucleo_f446re.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Nucleo F446re, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x08040000, LENGTH = 255K
RAM (W) : ORIGIN = 0x20004000, LENGTH = 176K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x08040000;
FLASH_LENGTH = 255K;

RAM_START = 0x20004000;
RAM_LENGTH = 176K;

INCLUDE libtock_layout.ld
17 changes: 8 additions & 9 deletions runtime/layouts/opentitan.ld
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* Layout for the RISC-V 32 boards, used by the examples in this repository. */

MEMORY {
/* Note that the SRAM address may need to be changed depending on
* the kernel binary, check for the actual address of APP_MEMORY!
*/
FLASH (X) : ORIGIN = 0x20030000, LENGTH = 32M
RAM (W) : ORIGIN = 0x10004000, LENGTH = 512K
}

TBF_HEADER_SIZE = 0x60;
TBF_HEADER_SIZE = 0x80;

FLASH_START = 0x20030000;
FLASH_LENGTH = 32M;

RAM_START = 0x10005000;
RAM_LENGTH = 512K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/raspberry_pi_pico.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the Raspberry Pi Pico board, used by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x10040000, LENGTH = 256K
RAM (W) : ORIGIN = 0x20011800, LENGTH = 194K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x10040000;
FLASH_LENGTH = 256K;

RAM_START = 0x20012000;
RAM_LENGTH = 192K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/stm32f3discovery.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the stm32f3discovery board, usable by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x08020000, LENGTH = 0x00020000
RAM (W) : ORIGIN = 0x20004000, LENGTH = 48K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x08020000;
FLASH_LENGTH = 0x00020000;

RAM_START = 0x20004000;
RAM_LENGTH = 48K;

INCLUDE libtock_layout.ld
12 changes: 7 additions & 5 deletions runtime/layouts/stm32f412gdiscovery.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Layout for the stm32f412gdiscovery board, usable by the examples in this repository. */

MEMORY {
FLASH (X) : ORIGIN = 0x08030000, LENGTH = 256K
RAM (W) : ORIGIN = 0x20004000, LENGTH = 112K
}

TBF_HEADER_SIZE = 0x60;

FLASH_START = 0x08030000;
FLASH_LENGTH = 256K;

RAM_START = 0x20004000;
RAM_LENGTH = 112K;

INCLUDE libtock_layout.ld
Loading