rustapp/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright (c) 2024 Linaro LTD
// SPDX-License-Identifier: Apache-2.0

#![no_std]

use zephyr::printkln;

// Reference the Zephyr crate so that the panic handler gets used.  This is only needed if no
// symbols from the crate are directly used.
extern crate zephyr;

#[no_mangle]
extern "C" fn rust_main() {
    printkln!("Hello world from Rust on {}", zephyr::kconfig::CONFIG_BOARD);
}