|
| 1 | +--- |
| 2 | +theme: ../slidev-template/theme |
| 3 | +layout: cover |
| 4 | +background: /intro.png |
| 5 | +class: text-center |
| 6 | +--- |
| 7 | + |
| 8 | +## Running demo Wi-Fi Zephyr application inside the CROSSCON Hypervisor |
| 9 | + |
| 10 | +<center> |
| 11 | + <img src="/../img/zarhus_logo.png" width="150px" |
| 12 | + style="margin-left:-20px;filter: invert(1);"> |
| 13 | +</center> |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Who am I? |
| 18 | + |
| 19 | +<div class="grid grid-cols-2 gap-8"> |
| 20 | + |
| 21 | +<div> |
| 22 | + |
| 23 | +**Paweł Langowski** |
| 24 | + |
| 25 | +_Junior Embedded Systems Engineer_ |
| 26 | + |
| 27 | +_member of the **Zarhus** team_ |
| 28 | + |
| 29 | + |
| 30 | +- [3mdeb.com](https://3mdeb.com) |
| 31 | + |
| 32 | +</div> |
| 33 | + |
| 34 | +<div class="flex justify-center items-center"> |
| 35 | + <img src="/../img/zarhus_logo.png" height="220px" style="filter: invert(1)"/> |
| 36 | +</div> |
| 37 | + |
| 38 | +</div> |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Agenda |
| 43 | + |
| 44 | +<v-clicks> |
| 45 | + |
| 46 | +- Introduction |
| 47 | +- Prerequisites |
| 48 | +- Implementation |
| 49 | +- Demo |
| 50 | +- Conclusion |
| 51 | + |
| 52 | +</v-clicks> |
| 53 | + |
| 54 | +<!-- |
| 55 | +* The agenda of the presentation |
| 56 | +* First I will introduce the topic and explain the goal of the task |
| 57 | +* Then I will talk about the hardware and software used to achieve this goal |
| 58 | +* Next I will explain how the task was implemented |
| 59 | +* Afterwards, I will show you a quick demo |
| 60 | +* I will end the presentation with conclusions |
| 61 | +--> |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Introduction |
| 66 | + |
| 67 | +### What is crosscon? |
| 68 | + |
| 69 | +<center><img src="/../img/crosscon-logo-2.png" width="200px"></center> |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | + |
| 74 | +## Introduction |
| 75 | + |
| 76 | +### Goal of the task |
| 77 | + |
| 78 | +- Run a Zephyr application inside a VM on the CROSSCON Hypervisor |
| 79 | +- The Zephyr application connects to a Wi-Fi network |
| 80 | + |
| 81 | +<!-- |
| 82 | +* The goal of our task was to run a Zephyr app inside a virtual machine within |
| 83 | +the CROSSCON Hypervisor |
| 84 | +* The Zephyr application scans for available Wi-Fi access points and connects to |
| 85 | +a specified hotspot. |
| 86 | +--> |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Prerequisites |
| 91 | + |
| 92 | +### [LPCXPRESSO55S69](https://docs.zephyrproject.org/latest/boards/nxp/lpcxpresso55s69/doc/index.html) |
| 93 | + |
| 94 | +<img src="/../img/lpc.jpg" width="350px" align="right"> |
| 95 | + |
| 96 | +- LPC55S69 dual core Arm Cortex-M33 microcontroller |
| 97 | +- MikroEletronika Click expansion |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## Prerequisites |
| 102 | + |
| 103 | +### [MikroElektronika WIFI and BLE Shield](https://docs.zephyrproject.org/latest/boards/shields/mikroe_wifi_bt_click/doc/index.html) |
| 104 | + |
| 105 | +<img src="/../img/wifi_click.jpg" width="300px" align="right"> |
| 106 | + |
| 107 | +- Wi-Fi and Bluetooth |
| 108 | +- Uses the standard MikroBus interface with UART pins |
| 109 | + |
| 110 | + |
| 111 | +### Software |
| 112 | + |
| 113 | +- Zephyr OS |
| 114 | +- Baremetal Wi-Fi application |
| 115 | +- Bao Hypervisor |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## Implementation |
| 120 | + |
| 121 | +- VM entry point had to be |
| 122 | +- Discovering devices and interfaces that were used by the application and its |
| 123 | +libraries |
| 124 | + |
| 125 | +After enabling `CONFIG_NETWORKING`: |
| 126 | + |
| 127 | +```diff |
| 128 | +1301a1505,1506 |
| 129 | +> CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y |
| 130 | +> # CONFIG_XOSHIRO_RANDOM_GENERATOR is not set |
| 131 | +1302a1508,1510 |
| 132 | +> CONFIG_CSPRNG_ENABLED=y |
| 133 | +> CONFIG_HARDWARE_DEVICE_CS_GENERATOR=y |
| 134 | +> # CONFIG_CTR_DRBG_CSPRNG_GENERATOR is not set |
| 135 | +``` |
| 136 | + |
| 137 | +Access to the random number generator had to be granted to the VM. |
| 138 | + |
| 139 | +--- |
| 140 | + |
| 141 | +## Implementation |
| 142 | + |
| 143 | +Hypervisor config: |
| 144 | + |
| 145 | +```c |
| 146 | +@@ -102,6 +102,12 @@ struct config config = { |
| 147 | ++ { |
| 148 | ++ /* RNG */ |
| 149 | ++ .pa = 0x4003a000, |
| 150 | ++ .va = 0x4003a000, |
| 151 | ++ .size = 0x1000, |
| 152 | ++ }, |
| 153 | + }, |
| 154 | + .ipc_num = 1, |
| 155 | + .ipcs = (struct ipc[]) { |
| 156 | +``` |
| 157 | +
|
| 158 | +- Granting access to required flash regions |
| 159 | +
|
| 160 | +The program failed to call the `memset` function. It turned out that the flash |
| 161 | +memory region, where `memset` was defined was outside the scope assigned to the |
| 162 | +VM. The flash size had to be increased. |
| 163 | +
|
| 164 | +--- |
| 165 | +
|
| 166 | +- UART conflict |
| 167 | +
|
0 commit comments