summaryrefslogtreecommitdiff
path: root/fw/sim
diff options
context:
space:
mode:
Diffstat (limited to 'fw/sim')
-rw-r--r--fw/sim/meson.build23
-rw-r--r--fw/sim/srv/README.md17
-rw-r--r--fw/sim/srv/zeth.netdev7
-rw-r--r--fw/sim/srv/zeth.network13
4 files changed, 60 insertions, 0 deletions
diff --git a/fw/sim/meson.build b/fw/sim/meson.build
new file mode 100644
index 0000000..2e0b4fa
--- /dev/null
+++ b/fw/sim/meson.build
@@ -0,0 +1,23 @@
+external_project = import('unstable-external_project')
+
+external_project.add_project(
+ configure_zephyr,
+ configure_options: [
+ '--source-tree', application_source,
+ '--build-tree', meson.current_build_dir() / 'build',
+ '--board', 'native_sim/native/64',
+ '--zephyr-base', zephyr,
+ '--zephyr-modules', ';'.join(zephyr_modules),
+ ],
+ verbose: true,
+)
+
+simulation = custom_target(
+ output: ['simulation-linux-amd64.exe'],
+ command: [
+ build_zephyr,
+ '--build-tree', meson.current_build_dir() / 'build',
+ '--binary-name', 'zephyr.exe',
+ '--target-name', 'simulation-linux-amd64.exe',
+ ],
+)
diff --git a/fw/sim/srv/README.md b/fw/sim/srv/README.md
new file mode 100644
index 0000000..455800f
--- /dev/null
+++ b/fw/sim/srv/README.md
@@ -0,0 +1,17 @@
+# Network setup for native sim firmware
+
+This folder contains documentation to provide a network setup suitable to run
+the native sim build of the firmware.
+
+It assumes a Linux host, an executable file with the native sim firmware,
+`systemd-networkd` as network configuration solution and `ufw` as firewall.
+
+For network configuration the `zeth.netdev` and `zeth.network` files from this
+folder have to be used with `systemd-networkd`.
+
+The following is required to open the firewall for the firmware on the `zeth`
+virtual network interface created by `systemd-networkd`:
+
+```
+ufw allow in on zeth to any port 1883 proto tcp
+```
diff --git a/fw/sim/srv/zeth.netdev b/fw/sim/srv/zeth.netdev
new file mode 100644
index 0000000..e8de39d
--- /dev/null
+++ b/fw/sim/srv/zeth.netdev
@@ -0,0 +1,7 @@
+# This Source Code Form is subject to the terms of the Mozilla Public License,
+# v. 2.0. If a copy of the MPL was not distributed with this file, You can
+# obtain one at https://mozilla.org/MPL/2.0/.
+
+[NetDev]
+Name=zeth
+Kind=tap
diff --git a/fw/sim/srv/zeth.network b/fw/sim/srv/zeth.network
new file mode 100644
index 0000000..7bf386a
--- /dev/null
+++ b/fw/sim/srv/zeth.network
@@ -0,0 +1,13 @@
+# This Source Code Form is subject to the terms of the Mozilla Public License,
+# v. 2.0. If a copy of the MPL was not distributed with this file, You can
+# obtain one at https://mozilla.org/MPL/2.0/.
+
+[Match]
+Name=zeth
+
+[Network]
+IPv6SendRA=yes
+Address=2001:db8::36/64
+
+[IPv6Prefix]
+Prefix=2001:db8::/64