A simple yet powerful Rust template for developing applications on Numworks calculators
This template provides a minimal foundation for creating Rust applications that run natively on Numworks calculators (N110, N115, N120). It includes a "Hello World" example that displays perfectly centered text on the screen.
- 🦀 Rust
no_stdconfiguration for embedded calculators - 🎯 ARM cross-compilation with
thumbv7em-none-eabihf - 🔧 EADK Numworks SDK integration
- 🖥️ Epsilon simulator support
- ⚡ Build system with Just
- 🎨 Working Hello World example with perfect text centering
- 📱 Multi-calculator support (N110, N115, N120)
To build this application, you need to install:
- 🦀 Rust compiler with embedded ARM support
- 🔨 Arm GCC compiler
- 📦 Node.js
- 🛠️ EADK Numworks SDK via nwlink
⚠️ Important: Make surearm-none-eabi-gccis in your PATH.
For detailed SDK installation instructions, follow this guide.
# On macOS with Homebrew
brew install rustup node
# Or equivalent on your OS
rustup-init
rustup target add thumbv7em-none-eabihf
cargo install just # Makefile alternativejust buildConnect your calculator and run:
just sendjust simYou can speed up simulator compilation by specifying the number of jobs:
just sim 5If you encounter a video error when launching the simulator, use this command to force X11 driver usage:
export SDL_VIDEODRIVER=x11
just simThis command resolves video compatibility issues on some Linux systems.
📦 num-template/
├── 📁 src/
│ ├── 📄 main.rs # 🚀 Main entry point
│ ├── 📄 eadk.rs # 🔧 EADK SDK bindings
│ └── 📁 libs/ # 📚 C libraries (storage)
│ ├── 📄 storage.c
│ └── 📄 storage.h
├── 📁 assets/
│ └── 🖼️ icon.png # 🎨 Application icon (55x55 PNG)
├── 📄 build.rs # ⚙️ Custom build script
├── 📄 Cargo.toml # 🦀 Rust configuration
└── 📄 justfile # 🔨 Build commands
Edit src/main.rs to customize your application. The current example displays "Hello World!" with perfectly centered text and waits for the EXE key to exit.
When you replace the default icon with your own, you must update the array size in main.rs:
// Change this size to match your icon's byte size
pub static EADK_APP_ICON: [u8; 1520] = *include_bytes!("../target/icon.nwi");How to find your icon size:
# Check the size of your generated icon
ls -la target/icon.nwiIf the compilation fails with a "mismatched types" error, it means the array size doesn't match your icon's actual size. Update the number in the brackets [u8; YOUR_SIZE_HERE] to fix this.
- 🔧 Use EADK APIs in
src/eadk.rsfor display, input, etc. - 📦 Add your dependencies in
Cargo.toml - ⚡ Respect
no_stdconstraints for calculator compatibility
- N110/N115: ✅ Full support
- N120: ✅ Full support with better performance
- Simulator: 🖥️ Development and testing
The template includes a estimate_text_width() function that calculates text width based on character count and font size, enabling perfect horizontal centering on the 320x240 calculator screen.
- Calculator: 🎯 ARM Cortex-M target with
no_std - Simulator: 🖥️ Native platform for development and testing
- Build system: ⚡ Automated cross-compilation and deployment
- 🔄 Embedded allocator for heap management
- ⚡ Optimized for calculator memory constraints
- 🛡️ Safe memory operations with overflow protection
- 📥 Clone this template
- 📦 Install prerequisites
- 🖼️ Add your
assets/icon.png(16x16 PNG) - ✏️ Modify
src/main.rsfor your application - 🔨 Build with
just build - 🧪 Test with
just simor deploy withjust send
This template is designed to be a starting point for Numworks calculator applications. Feel free to:
- ➕ Add more examples
- ⚡ Improve the build system
- 🛠️ Add utility functions
- 📱 Create application templates for specific use cases
This template is provided as-is for educational and development purposes. Please respect Numworks' terms of service when developing applications for their calculators.
This template was inspired by the amazing work done in NumcraftRust - a Minecraft-like game running natively on Numworks calculators. The project demonstrates the incredible potential of Rust for embedded calculator development and serves as an excellent reference for advanced Numworks applications.