|
1 |
| -# Threaded RPC with uVisor Example |
| 1 | +# Threaded RPC with uVisor example |
2 | 2 |
|
3 | 3 | This is a simple example to show how to use several uVisor APIs to build a box that securely stores a number.
|
4 | 4 | This number can only be written by one box, but read by all boxes.
|
5 | 5 |
|
6 |
| -- Create and run secure boxes. |
7 |
| -- Secure static and dynamic memory inside secure boxes. |
8 |
| -- Run threads inside secure boxes. |
9 |
| -- Issue RPC requests to other secure boxes and wait for their completion. |
10 |
| -- Receive and process incoming RPC requests from other secure boxes. |
11 |
| -- Get box id and namespace of the RPC caller. |
| 6 | +* Create and run secure boxes. |
| 7 | +* Secure static and dynamic memory inside secure boxes. |
| 8 | +* Run threads inside secure boxes. |
| 9 | +* Issue RPC requests to other secure boxes and wait for their completion. |
| 10 | +* Receive and process incoming RPC requests from other secure boxes. |
| 11 | +* Get box id and namespace of the RPC caller. |
12 | 12 |
|
13 | 13 | This demo contains three secure boxes:
|
14 | 14 |
|
15 | 15 | 1. The secure number vault. This box stores one number that can only be written to by client A, but read by everyone.
|
16 |
| -2. Client A, which attempts to write (and succeeds) and read the secure number. |
17 |
| -3. Client B, which attempts to write (but fails) and read the secure number. |
| 16 | +1. Client A, which attempts to write (and succeeds) and read the secure number. |
| 17 | +1. Client B, which attempts to write (but fails) and read the secure number. |
18 | 18 |
|
19 | 19 | The insecure box 0 also attempts to write (but fails) and read the secure number.
|
20 | 20 |
|
21 |
| -## Building |
| 21 | +Supported devices: |
22 | 22 |
|
23 |
| -The example currently only works on K64F with the GCC_ARM toolchain. |
| 23 | +| Target | Toolchain | Baud rate | |
| 24 | +|--------|-----------|-----------| |
| 25 | +| `K64F` | `GCC_ARM` | 9600 | |
24 | 26 |
|
25 |
| -### Release |
| 27 | +Latest release: [mbed-os-5.3.0](https://github.com/ARMmbed/mbed-os-example-uvisor/releases/tag/mbed-os-5.3.0). Tested with [mbed-cli v1.0.0](https://github.com/ARMmbed/mbed-cli/releases/tag/1.0.0). |
| 28 | + |
| 29 | +## Quickstart |
26 | 30 |
|
27 | 31 | For a release build, please enter:
|
28 | 32 |
|
29 | 33 | ```bash
|
30 |
| -$ mbed compile -m K64F -t GCC_ARM |
| 34 | +$ mbed compile -m K64F -t GCC_ARM -c |
31 | 35 | ```
|
32 | 36 |
|
33 | 37 | You will find the resulting binary in `BUILD/K64F/GCC_ARM/mbed-os-example-uvisor-number-store.bin`. You can drag and drop it onto your board USB drive.
|
34 | 38 |
|
| 39 | +Press the reset button. The `box_number_store` secure box will use 3 LEDs on your target to signal the execution of the `get_caller_id`, `get_number` and `set_number` APIs. You can observe the example output on the serial port: |
| 40 | + |
| 41 | +```bash |
| 42 | +$ screen /dev/tty.usbmodem1422 9600 |
| 43 | +``` |
| 44 | + |
| 45 | +You will see an output similar to the following one: |
| 46 | + |
| 47 | +``` |
| 48 | +**** uVisor secure number store example ***** |
| 49 | +Trusted client a has box id 2 |
| 50 | +2: Wrote '0xfffffed4' |
| 51 | +1: Read '0xfffffed4' |
| 52 | +1: Permission denied. This client cannot write the secure number '0xfffffe0c' |
| 53 | +0: Read '0xfffffed4' |
| 54 | +0: Permission denied. This client cannot write the secure number '0x00000019' |
| 55 | +2: Read '0xfffffed4' |
| 56 | +2: Wrote '0xfffffda8' |
| 57 | +2: Read '0xfffffda8' |
| 58 | +1: Permission denied. This client cannot write the secure number '0xfffffc18' |
| 59 | +2: Wrote '0xfffffc7c' |
| 60 | +... |
| 61 | +``` |
| 62 | + |
| 63 | +> **Note**: If your target does not have 3 different LEDs or LED colours, you will see the same LED blink multiple times. The example use the general mbed OS naming structure `LED1`, `LED2`, `LED3`. |
| 64 | +
|
35 | 65 | ### Debug
|
36 | 66 |
|
37 |
| -When a debugger is connected, you can observe debug output from uVisor. Please note that these messages are sent through semihosting, which halts the program execution if a debugger is not connected. For more information please read the [Debugging uVisor on mbed OS](https://github.com/ARMmbed/uvisor/blob/master/docs/api/DEBUGGING.md) guide. To build a debug version of the program: |
| 67 | +When a debugger is connected, you can observe debug output from uVisor. Please note that these messages are sent through semihosting, which halts the program execution if a debugger is not connected. For more information please read the [Debugging uVisor on mbed OS](https://github.com/ARMmbed/uvisor/blob/master/docs/api/DEBUGGING.md) guide. To build a debug version of this example, please enter: |
38 | 68 |
|
39 | 69 | ```bash
|
40 | 70 | $ mbed compile -m K64F -t GCC_ARM --profile mbed-os/tools/profiles/debug.json -c
|
|
0 commit comments