6 Commits

Author SHA1 Message Date
Huang Qi
a8c62307ec examples/rust/slint: Update nuttx crate branch from master to main and fix pixel format check.
Changed the NUTTX dependency branch to 'main' for consistency with repository updates.
Updated pixel format check to use FB_FMT_RGB16_565 for better clarity and accuracy.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:29 +08:00
simbit18
4315a1c8cc [nxstyle] fix Relative file path
fix Relative file path does not match actual file.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-21 16:29:13 -05:00
Huang Qi
18838d23bf examples/rust: Add basic Slint example
Summary:
- Added a basic Slint example for NuttX, demonstrating how to integrate Slint UI framework with Rust on NuttX
- Includes a simple UI with a counter and touchscreen input handling
- Provides CMake, Kconfig, and Makefile configurations for building the example

Impact:
- Introduces a new example showcasing Slint UI framework usage on NuttX
- Enables developers to explore Rust-based UI development on embedded systems
- Demonstrates integration with NuttX framebuffer and touchscreen drivers

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-29 14:08:45 +08:00
Huang Qi
9b6de015bc rust/hello: Optimize the build flags
Summary:
- Added `codegen-units = 1` and `opt-level = 'z'` to the release profile in `Cargo.toml`
- These changes optimize the build for minimal binary size

Impact:
- Reduces the final binary size by ~7% (244316 -> 228380 bytes)
- Improves resource utilization for embedded systems
- No functional changes to the application behavior

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-19 17:16:38 +08:00
Huang Qi
14fa7d2726 examples/rust: Rename hello_rust to rust/baremetal
Summary:
- Renamed hello_rust example to rust/baremetal to better reflect its purpose
- Updated file headers and Makefile paths
- Maintained all existing Kconfig options and functionality
- Prepares for future Rust development patterns where Cargo will be the
mainstream approach, with baremetal demonstrating traditional build method
- Creates clearer structure for Rust examples as we expand Rust support

Impact:
- No functional changes to the example itself
- Better organization of Rust examples under examples/rust/
- Existing configurations using this example will continue to work
- Build system will now look for the example in the new location

Testing:
- Confirmed Kconfig options remain unchanged
- GitHub CI passed and local build tested

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-15 01:53:56 +08:00
Huang Qi
f7e7453807 examples: New app to build Rust with Cargo
Build Rust applictions with cargo is the most commn way,
and it's more easy to cooporate with Rust ecosystem.

This example shows how to use cargo to build a simple hello world
application.

And please notice that you need to install nighly version of rustc
to support this feature, any version after https://github.com/rust-lang/rust/pull/127755
is merged, can use NuttX as cargo target directly.

Build
-----

To build hello_rust_cargo application, you can use any target that based
on RISCV32IMAC, for example:
```
cmake -B build -DBOARD_CONFIG=rv-virt:nsh -GNinja .
```

And disable ARCH_FPU in menuconfig, since the hard coded target triple
in this demo is `riscv32imac`.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 22:25:13 +08:00