David Brown | 841d73a | 2017-01-09 12:23:09 -0700 | [diff] [blame] | 1 | MCUboot Simulator |
| 2 | ################# |
| 3 | |
| 4 | This is a small simulator designed to exercise the mcuboot upgrade |
| 5 | code, specifically testing untimely reset scenarios to make sure the |
| 6 | code is robust. |
| 7 | |
| 8 | Prerequisites |
| 9 | ============= |
| 10 | |
| 11 | The simulator is written in Rust_, and you will need to install it to |
| 12 | build it. The installation_ page describes this process. The |
| 13 | simulator can be built with the stable release of Rust. |
| 14 | |
| 15 | .. _Rust: https://www.rust-lang.org/ |
| 16 | |
| 17 | .. _installation: https://www.rust-lang.org/en-US/install.html |
| 18 | |
David Brown | 9600ec8 | 2017-07-21 08:28:28 -0600 | [diff] [blame^] | 19 | Dependent code |
| 20 | -------------- |
| 21 | |
| 22 | The simulator depends on some external modules. These are stored as |
| 23 | submodules within git. To fetch these dependencies the first time:: |
| 24 | |
| 25 | $ git submodule update --init |
| 26 | |
| 27 | will clone and check out these trees in the appropriate place. |
| 28 | |
David Brown | 841d73a | 2017-01-09 12:23:09 -0700 | [diff] [blame] | 29 | Building |
| 30 | ======== |
| 31 | |
| 32 | Once Rust is installed, build cargo by:: |
| 33 | |
| 34 | $ cargo build --release |
| 35 | |
| 36 | this should download and compile the necessary dependencies, compile |
| 37 | the relevant modules from mcuboot, and build the simulator. The |
| 38 | resulting executable will be placed in ``./target/release/bootsim`` |
| 39 | and can be run directly:: |
| 40 | |
| 41 | $ ./target/release/bootsim run --device k64f |
| 42 | |
| 43 | Calling with ``--help`` will give a more thorough usage. |
| 44 | |
| 45 | Debugging |
| 46 | ========= |
| 47 | |
| 48 | If the simulator indicates a failure, you can turn on additional |
| 49 | logging by setting ``RUST_LOG=warn`` or ``RUST_LOG=error`` in the |
| 50 | environment:: |
| 51 | |
| 52 | $ RUST_LOG=warn ./target/release/bootsim run ... |