Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust on Alarmo!

Crates.io Version docs.rs (with version)

This project provides a convenient API to bootstrap firmware and access peripherals on the Nintendo Alarmo, using Rust.

Status

This started as a Rust port of GaryOderNichts's MIT-licensed alarmo repository, which uses the official hardware abstraction layer. As a proof-of-concept, I first made a Rust loader that would just call GaryOderNichts's implementation, then I incrementally rewrote each part in the Rust module.

In its current state, the project no longer relies on the official HAL.

Consider this list of goals tentative:

  • It works!
  • LCD frontend using the display_interface crate
  • Better build environment (automate objcopy and firmware signing)
  • Button inputs (+ interrupts)
  • Dial input
  • Dial LED
  • Allocator with external RAM (enable the alloc feature)
  • Sound
  • USB-CDC (usb-device, usbd-serial)
  • USB Mass Storage (access eMMC via USB)
  • WLAN

Usage

First, you may need to install the ARM Rust target:

rustup target add thumbv7em-none-eabihf

Running an example

  1. Compile the example, for example lcd:
# "--features display" required to build the LCD example
cargo build --example lcd --features display
  1. Convert the example ELF into BINF:
arm-none-eabi-objcopy -O binary target/thumbv7em-none-eabihf/debug/examples/lcd lcd.bin
  1. Sign the firmware to get the a.bin.

Creating a project

  1. After you've created the Cargo project, copy the link.ld file and .cargo/ directory from this repository to the root of your crate.
  2. Add the library as a dependency:
# With LCD support
cargo add alarmo -F display

# No LCD support
cargo add alarmo

# Optionally, add some other dependencies for peripherals, see examples for details
# cargo add mipidsi
# cargo add embedded-graphics
  1. Build the project:
cargo build
  1. Convert the result ELF into BINF (change debug to release for --release):
arm-none-eabi-objcopy -O binary target/thumbv7em-none-eabihf/debug/your_crate your_crate.bin
  1. Sign the firmware to get the a.bin.

License

The library and its examples are dual-licensed under both Apache-2.0 and MIT.

Credits

About

Rust on the Alarmo!

Topics

Resources

Stars

19 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages