mcuboot/sim
David Brown 72e7a5176f Change the image header magic
Since we've changed the meaning of several fields in the header, bump
the header to a new magic number.  The fields that are still present are
in the same place, but all of the signature and TLV information is moved
into the TLV itself, which is still immediately after the image.

As of this commit, this defines the new image header/TLV format used for
1.0.

Based on work by Marko Kiiskila <marko@runtime.io>

Signed-off-by: Marko Kiiskila <marko@runtime.io>
Signed-off-by: David Brown <david.brown@linaro.org>
2017-09-06 16:16:58 -06:00
..
mcuboot-sys sim: Enable -Werror 2017-07-12 15:00:57 -06:00
simflash Fix flash to not ignore write to non-erased area 2017-07-17 15:34:36 -03:00
src Change the image header magic 2017-09-06 16:16:58 -06:00
.gitignore sim: Add simulator code 2017-01-09 12:28:10 -07:00
Cargo.lock Move key_id from header into TLV 2017-09-06 16:16:58 -06:00
Cargo.toml Move key_id from header into TLV 2017-09-06 16:16:58 -06:00
README.rst sim: Update doc to explain submodules 2017-07-21 11:50:48 -06:00

README.rst

MCUboot Simulator
#################

This is a small simulator designed to exercise the mcuboot upgrade
code, specifically testing untimely reset scenarios to make sure the
code is robust.

Prerequisites
=============

The simulator is written in Rust_, and you will need to install it to
build it.  The installation_ page describes this process.  The
simulator can be built with the stable release of Rust.

.. _Rust: https://www.rust-lang.org/

.. _installation: https://www.rust-lang.org/en-US/install.html

Dependent code
--------------

The simulator depends on some external modules.  These are stored as
submodules within git.  To fetch these dependencies the first time::

  $ git submodule update --init

will clone and check out these trees in the appropriate place.

Building
========

Once Rust is installed, build cargo by::

  $ cargo build --release

this should download and compile the necessary dependencies, compile
the relevant modules from mcuboot, and build the simulator.  The
resulting executable will be placed in ``./target/release/bootsim``
and can be run directly::

  $ ./target/release/bootsim run --device k64f

Calling with ``--help`` will give a more thorough usage.

Debugging
=========

If the simulator indicates a failure, you can turn on additional
logging by setting ``RUST_LOG=warn`` or ``RUST_LOG=error`` in the
environment::

  $ RUST_LOG=warn ./target/release/bootsim run ...