The smallest Rust application:
it prints a message from main() with println!.
pbl samples samples/rust/hello_world
every board
cmake_minimum_required(VERSION 3.20)
find_package(PebbleOS REQUIRED HINTS $ENV{PEBBLEOS_BASE})
project(hello_world)
pbl_rust_app()
[package]
name = "hello_world"
version = "0.1.0"
edition = "2024"
license = "Apache-2.0"
publish = false
[lib]
crate-type = ["staticlib"]
[dependencies]
pebbleos = { path = "../../../rust/pebbleos" }
#![no_std]
use pebbleos::println;
#[pebbleos::main]
fn main() {
println!("Hello World! {}", pebbleos::kconfig::BOARD);
}
Hello World! \w+
Generated from PebbleOS 7753e801d. This page is maintained in the pebbleos repository: docs/samples/rust/hello_world.md.