Skip to content
Open
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
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"boards/hifive1",
"boards/imix",
"boards/imxrt1050-evkb",
"boards/lpc55s69-evk",
"boards/litex/arty",
"boards/litex/sim",
"boards/msp_exp432p401r",
Expand Down Expand Up @@ -81,6 +82,7 @@ members = [
"chips/esp32",
"chips/esp32-c3",
"chips/imxrt10xx",
"chips/lpc55s6x",
"chips/litex",
"chips/litex_vexriscv",
"chips/lowrisc",
Expand Down
1 change: 1 addition & 0 deletions boards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ but the approximate definitions:
| [MSP432 Evaluation kit MSP432P401R](msp_exp432p401r/README.md) | ARM Cortex-M4 | MSP432P401R | openocd | custom | No |
| [CY8CPROTO-062-4343W](cy8cproto_62_4343_w/README.md) | ARM Cortex-M0+ | PSoC62 | openocd | custom | No |
| [Raspberry Pi Pico 2](raspberry_pi_pico_2/README.md) | ARM Cortex-M33 | RP2350 | openocd | openocd | No |
| [LPCXpresso55S69 Development Board](lpc55s69-evk/README.md) | ARM Cortex-M33 | LPC55S6x | probe-rs | probe-rs | No |


### Other
Expand Down
14 changes: 14 additions & 0 deletions boards/lpc55s69-evk/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Licensed under the Apache License, Version 2.0 or the MIT License.
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Copyright Tock Contributors 2024.

include = [
"../../cargo/tock_flags.toml",
"../../cargo/unstable_flags.toml",
]

[build]
target = "thumbv8m.main-none-eabi"

[unstable]
config-include = true
25 changes: 25 additions & 0 deletions boards/lpc55s69-evk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Licensed under the Apache License, Version 2.0 or the MIT License.
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Copyright Tock Contributors 2025.

[package]
name = "lpc55s69-evk"
version.workspace = true
authors.workspace = true
edition.workspace = true
build = "../build.rs"

[dependencies]
cortexm33 = { path = "../../arch/cortex-m33" }
kernel = { path = "../../kernel"}
lpc55s6x = { path = "../../chips/lpc55s6x" }
components = { path = "../components" }
enum_primitive = { path = "../../libraries/enum_primitive" }
capsules-core = { path = "../../capsules/core" }
capsules-system = { path = "../../capsules/system" }

[build-dependencies]
tock_build_scripts = { path = "../build_scripts" }

[lints]
workspace = true
45 changes: 45 additions & 0 deletions boards/lpc55s69-evk/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Licensed under the Apache License, Version 2.0 or the MIT License.
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Copyright Tock Contributors 2022.

# Makefile for building the tock kernel for the NUCLEO-F429ZI platform
#

include ../Makefile.common

PROBE_RS=probe-rs

# The specific chip on the NUCLEO-F429ZI board.
# probe-rs needs this to know what it's flashing.
iCHIP=LPC55S69JBD100

APP=/home/pc1/Projects/libtock-c/examples/blink/build/cortex-m7/cortex-m7.tbf
KERNEL=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/release/$(PLATFORM).elf
KERNEL_WITH_APP=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/release/$(PLATFORM)-app.elf

# Default target for installing the kernel.
.PHONY: install
install: flash

# flash-debug is no longer needed as a separate target, but kept for
# compatibility. `make debug` is the new recommended command.
.PHONY: flash-debug
flash-debug: debug

# Flash the release version of the kernel to the board.
.PHONY: flash
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf
$(PROBE_RS) flash --chip $(CHIP) --erase-all $<

# Flash the debug version and attach an RTT console to view kernel logs.
# This is the recommended command for debugging.
.PHONY: debug
debug: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/debug/$(PLATFORM).elf
$(PROBE_RS) run --chip $(iCHIP) $<

# An alias for the default `install` target.
.PHONY: program
program: release
arm-none-eabi-objcopy --set-section-flags .apps=LOAD,ALLOC $(KERNEL) $(KERNEL_WITH_APP)
arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL_WITH_APP)
$(PROBE_RS) run --chip $(iCHIP) $(KERNEL_WITH_APP)
42 changes: 42 additions & 0 deletions boards/lpc55s69-evk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
NXP LPCXpresso55S69 Development Board
======================================

For more details about the board [visit the NXP board website](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK). More details about the chip can be found [here](https://www.nxp.com/products/LPC55S6x)

## Flashing the kernel

### Prerequisites

The primary tool used for flashing this board is `probe-rs`. You will need to install it. The recommended way is using `cargo`, the Rust package manager. More details can be found [here](https://probe.rs/docs/getting-started/installation/)

```bash
$ cargo install probe-rs
```

### Compiling and Flashing

To compile the Tock kernel and flash it to the board, navigate to the `boards/lpc55s69-evk` directory and run `make flash-debug` or `make flash`. This command compiles the kernel either in debug mode or in release mode and uses `probe-rs` to flash the binary file to the chip.

```bash
$ make flash-debug
or
$ make flash
```

The expected output of the command is looking like this:

```bash
$ make flash-debug
Finished `dev` profile [optimized + debuginfo] target(s) in 8.95s
text data bss dec hex filename
409B 32 8220 12350 303e /home/USER/tock/target/thumbv8em.main-none-eabihf/debug/lpc55s69-evk
0b7602b822e4507274cd6dd2a47879cee487d8981b83186a9931adc2269880bf /home/USER/tock/target/thumbv8em.main-none-eabihf/debug/lpc55s69-evk.bin
probe-rs run --chip LPC55S69JBD100 /home/USER/tock/targetthumbv8m.main-none-eadihf/debug/lpc55s69-evk.elf
```

### Flashing app

Applications are built separately from the main project. After building an application, specify its path in the `APP` variable within the Makefile, then execute:
```bash
$ make program
```
24 changes: 24 additions & 0 deletions boards/lpc55s69-evk/chip_layout.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Licensed under the Apache License, Version 2.0 or the MIT License. */
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/* Copyright Tock Contributors 2025. */

MEMORY
{
rom(rx) : ORIGIN = 0x00000000, LENGTH = 64K
ram(rwx) : ORIGIN = 0x20000000, LENGTH = 320K
prog(rx) : ORIGIN = 0x00010000, LENGTH = 576K
}

PAGE_SIZE = 4K;

SECTIONS{
.stack (NOLOAD) :
{
. = ALIGN(8);
*(.stack*)
. = ALIGN(8);
} > ram

}

ENTRY(initialize_ram_jump_to_main)
6 changes: 6 additions & 0 deletions boards/lpc55s69-evk/layout.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Licensed under the Apache License, Version 2.0 or the MIT License. */
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/* Copyright Tock Contributors 2025. */

INCLUDE ./chip_layout.ld
INCLUDE tock_kernel_layout.ld
67 changes: 67 additions & 0 deletions boards/lpc55s69-evk/src/io.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Copyright Tock Contributors 2025.

use crate::{LPCPin, CHIP, PROCESSES, PROCESS_PRINTER};
use core::fmt::Write;
use core::panic::PanicInfo;
use core::ptr::{addr_of, addr_of_mut};
// use cortex_m_semihosting::hprint;
use kernel::debug::{self, IoWrite};
use kernel::hil::gpio::Configure;
use kernel::hil::led::LedHigh;
use lpc55s6x::gpio::GpioPin;
use lpc55s6x::iocon::{Config, Function, Iocon, Pull, Slew};

pub struct Writer;

/// Global static for debug writer
pub static mut WRITER: Writer = Writer;

// TODO: This will be implemented later, when UART support will be available

impl Write for Writer {
fn write_str(&mut self, s: &str) -> ::core::fmt::Result {
for _byte in s.as_bytes() {
// TODO print one character when UART becomes available
}
Ok(())
}
}

impl IoWrite for Writer {
fn write(&mut self, buf: &[u8]) -> usize {
for _byte in buf {
// TODO print one character when UART becomes available
}
buf.len()
}
}

#[panic_handler]
pub unsafe fn panic_fmt(panic_info: &PanicInfo) -> ! {
let iocon_ctrl = Iocon::new();
let led_pin_config = Config {
function: Function::GPIO,
pull: Pull::Up,
slew: Slew::Standard,
invert: false,
digital_mode: true,
open_drain: false,
};
iocon_ctrl.configure_pin(LPCPin::P1_6, led_pin_config);
let red_led = GpioPin::new(LPCPin::P1_6);
red_led.make_output();
let led = &mut LedHigh::new(&red_led);
let writer = &mut *addr_of_mut!(WRITER);

debug::panic(
&mut [led],
writer,
panic_info,
&cortexm33::support::nop,
PROCESSES.unwrap().as_slice(),
&*addr_of!(CHIP),
&*addr_of!(PROCESS_PRINTER),
)
}
Loading