Skip to content
Closed
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
6 changes: 0 additions & 6 deletions boards/layout_apollo3.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x10002000, LENGTH = 0x2000
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_hail.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 62K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_hifive1.ld
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x80002400, LENGTH = 0x1C00
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 1K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_imxrt1050.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 112K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_msp432.ld
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x2000
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_nrf52.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 62K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_nrf52840.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 62K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_nucleo_f429zi.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 112K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_nucleo_f446re.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 176K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout_generic.ld
6 changes: 0 additions & 6 deletions boards/layout_opentitan.ld
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ MEMORY {
SRAM (rwx) : ORIGIN = 0x10004000, LENGTH = 512K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 1K;

INCLUDE layout_generic.ld
5 changes: 5 additions & 0 deletions core/examples/empty_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

#![no_std]

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x400] = [0; 0x400];

// If you don't *use* anything from libtock_core directly, cargo will not link
// it into the executable. However, we still need the runtime and lang items.
// Therefore a libtock_core app that doesn't directly mention anything in
Expand Down
5 changes: 5 additions & 0 deletions examples-features/alloc_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::syscalls;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
fn main() -> TockResult<()> {
let mut vec = Vec::new();
Expand Down
5 changes: 5 additions & 0 deletions examples-features/ble_scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use libtock::result::TockResult;
use libtock::simple_ble;
use serde::Deserialize;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[derive(Deserialize)]
struct LedCommand {
pub nr: u8,
Expand Down
5 changes: 5 additions & 0 deletions examples-features/ctap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#![no_std]
#![feature(alloc_error_handler)]

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x5000] = [0; 0x5000];

extern crate alloc;

use core::alloc::Layout;
Expand Down
5 changes: 5 additions & 0 deletions examples-features/libtock_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ use libtock::result::TockResult;
use libtock::timer::DriverContext;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples-features/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::syscalls;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
panic!("Bye world!");
Expand Down
5 changes: 5 additions & 0 deletions examples-features/simple_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ use libtock::simple_ble::BleAdvertisingDriver;
use libtock::timer::Duration;
use serde::Serialize;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];
Comment thread
alistair23 marked this conversation as resolved.

#[derive(Serialize)]
struct LedCommand {
pub nr: u8,
Expand Down
5 changes: 5 additions & 0 deletions examples/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/adc_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::syscalls;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
/// Reads a 128 byte sample into a buffer and prints the first value to the console.
async fn main() -> TockResult<()> {
Expand Down
5 changes: 5 additions & 0 deletions examples/blink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x400] = [0; 0x400];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/blink_random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use libtock::leds::LedsDriver;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x400] = [0; 0x400];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/button_leds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use futures::future;
use libtock::buttons::ButtonState;
use libtock::result::TockResult;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/button_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/button_subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/ctap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use libtock::result::TockResult;
use libtock::syscalls;
use libtock::{print, println};

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

// Example works on P0.03
#[libtock::main]
async fn main() -> TockResult<()> {
Expand Down
5 changes: 5 additions & 0 deletions examples/gpio_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

// example works on p0.03
#[libtock::main]
async fn main() -> TockResult<()> {
Expand Down
5 changes: 5 additions & 0 deletions examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use libtock::println;
use libtock::result::TockResult;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x400] = [0; 0x400];

#[libtock::main]
async fn main() -> TockResult<()> {
let drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/hmac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::syscalls;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/sensors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use libtock::result::TockResult;
use libtock::sensors::Sensor;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
5 changes: 5 additions & 0 deletions examples/seven_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use libtock::electronics::ShiftRegister;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

fn number_to_bits(n: u8) -> [bool; 8] {
match n {
1 => [false, false, false, true, false, true, false, false],
Expand Down
5 changes: 5 additions & 0 deletions examples/temperature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use libtock::println;
use libtock::result::TockResult;
use libtock::timer::Duration;

/// Dummy buffer that causes the linker to reserve enough space for the stack.
#[no_mangle]
#[link_section = ".stack_buffer"]
pub static mut STACK_MEMORY: [u8; 0x800] = [0; 0x800];

#[libtock::main]
async fn main() -> TockResult<()> {
let mut drivers = libtock::retrieve_drivers()?;
Expand Down
Loading