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 | |
| 19 | Building |
| 20 | ======== |
| 21 | |
| 22 | Once Rust is installed, build cargo by:: |
| 23 | |
| 24 | $ cargo build --release |
| 25 | |
| 26 | this should download and compile the necessary dependencies, compile |
| 27 | the relevant modules from mcuboot, and build the simulator. The |
| 28 | resulting executable will be placed in ``./target/release/bootsim`` |
| 29 | and can be run directly:: |
| 30 | |
| 31 | $ ./target/release/bootsim run --device k64f |
| 32 | |
| 33 | Calling with ``--help`` will give a more thorough usage. |
| 34 | |
| 35 | Debugging |
| 36 | ========= |
| 37 | |
| 38 | If the simulator indicates a failure, you can turn on additional |
| 39 | logging by setting ``RUST_LOG=warn`` or ``RUST_LOG=error`` in the |
| 40 | environment:: |
| 41 | |
| 42 | $ RUST_LOG=warn ./target/release/bootsim run ... |