zephyr/samples/mpu/mpu_test
Carles Cufi 915bf989cf samples: mmu: Convert doc to CMake
Convert the samples/mmu documentation to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
..
src kbuild: Removed KBuild 2017-11-08 20:00:22 -05:00
CMakeLists.txt Introduce cmake-based rewrite of KBuild 2017-11-08 20:00:22 -05:00
README.rst samples: mmu: Convert doc to CMake 2017-11-12 21:13:23 -05:00
prj.conf samples: mpu_test: Add Allow Flash Write config 2017-08-08 11:20:46 -05:00
prj_single.conf samples: move all MPU samples into one directory 2017-06-19 21:23:11 -04:00
sample.yaml tests: samples: fix yaml syntax 2017-10-15 08:15:00 -04:00

README.rst

.. _mpu_test:

Memory Protection Unit (MPU) TEST
#################################

Overview
********
This test provides a set options to check the correct MPU configuration
against the following security issues:

* Read at an address that is reserved in the memory map.
* Write into the boot Flash/ROM.
* Run code located in SRAM.

If the MPU configuration is correct each option selected ends up in an MPU
fault.

Building and Running
********************

This project can be built and executed as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/mpu/mpu_test
   :board: v2m_beetle
   :goals: build flash
   :compact:

Reset the board and you should be able to see on the corresponding
Serial Port the following message:

.. code-block:: console

   ***** BOOTING ZEPHYR OS v1.7.99 - BUILD: Mar  9 2017 13:01:59 *****
   *** MPU test options ***
   1 - Read a reserved address in the memory map
   2 - Write in to boot FLASH/ROM
   3 - Run code located in RAM
   Select an option:

To build the single thread version, use the supplied configuration file for
single thread: :file:`prj_single.conf`:

.. zephyr-app-commands::
   :zephyr-app: samples/mpu/mpu_test
   :board: v2m_beetle
   :conf: prj_single.conf
   :goals: run
   :compact:

To build a version that allows writes to the flash device, edit
``prj.conf``, and follow the directions in the comments to enable the
proper configs.

Sample Output
=============

.. code-block:: console

   ***** BOOTING ZEPHYR OS v1.7.99 - BUILD: May 12 2017 09:47:02 *****
   shell> select mpu_test
   mpu_test> read
   ***** BUS FAULT *****
     Executing thread ID (thread): 0x200003b8
     Faulting instruction address:  0x290
     Precise data bus error
     Address: 0x24000000
   Fatal fault in thread 0x200003b8! Aborting.