1
0
Fork
You've already forked memsolve
0
Memsolve is a ROM memory layout generator for embedded Rust
  • Rust 100%
2026年06月16日 12:06:03 +02:00
data docs: add explanatory readme to the data examples 2026年06月16日 12:06:03 +02:00
examples chore: rename crate to memsolve 2026年06月08日 15:51:07 +02:00
src fix: mark serde structs as deny_unknown_fields 2026年06月16日 12:05:01 +02:00
.gitignore chore: initial layout 2026年05月01日 22:49:24 +02:00
Cargo.toml chore: sort Cargo.toml sections 2026年06月16日 11:38:50 +02:00
clippy.toml chore: resolve clippy issues 2026年06月15日 16:55:47 +02:00
LICENSE-APACHE chore: add license files 2026年06月16日 10:07:37 +02:00
LICENSE-MIT chore: add license files 2026年06月16日 10:07:37 +02:00
prek.toml chore: add prek.toml 2026年06月16日 11:37:00 +02:00
README.md doc: add main documentation 2026年06月08日 15:55:27 +02:00
rustfmt.toml chore: add rustfmt config 2026年05月17日 21:31:49 +02:00

memsolve License: MIT OR Apache-2.0 memsolve on crates.io memsolve on docs.rs Source Code Repository

Memsolve is a crate to generate ROM Memory Layouts for microcontrollers and other embedded devices.

Microcontrollers have limited flash (ROM) available, separated into pages. This flash can used for multiple purposes, a bootloader, data storage, multiple applications. memsolve allows for describing the different requirements of these sections, whether thats a set number of pages or a minimal size, and uses a linear solver to resolve the layout into addresses for the flash layout. This layout can then be used as basis for the memory.x file in projects such as Embassy or [Ariel OS][__link1]

Overview

This section gives a brief overview of the primary types in this crate:

  • [Memory][__link2] is the primary object and represents the memory layout.
  • [Chip][__link3] describes the target of the layout, including the total size of the flash and the page size
  • [Section][__link4] describes the requirements on a single section.

Example: simple layout

This example shows how to generate a layout for a microcontroller where one section will contain the application and another contains some configuration. The application section must be as large as possible within the flash and the configuration section requires 3 pages, but no specific minimum size.

usememsolve::{Memory,section::Section,chip::Chip,information::Information};useuom::si::information::{byte,kibibyte};// Our example chip has 64 KiB Flash with 2048 byte pages
letchip=Chip::new(Information::new::<byte>(2048),0x800_000,Information::new::<kibibyte>(64))?;letmutmemory=Memory::new(chip);// Add the application section
memory.add_section(Section::new("app")?.set_boot(true).set_maximize(true));// Add the configuration storage section
memory.add_section(Section::new("config")?.set_pages(3));// This layout is fully resolved
letlayout=memory.resolve_layout()?;assert_eq!(layout[0].address,0x800_000);assert_eq!(layout[0].pages,29);assert_eq!(layout[1].address,0x80E_800);assert_eq!(layout[1].pages,3);

[__link1]: Ariel OS [__link2]: https://docs.rs/memsolve/0.1.0/memsolve/struct.Memory.html [__link3]: https://docs.rs/memsolve/0.1.0/memsolve/?search=chip::Chip [__link4]: https://docs.rs/memsolve/0.1.0/memsolve/?search=section::Section