summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore (renamed from fw/.gitignore)2
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md27
l---------compile_commands.json2
-rw-r--r--fw/CMakeLists.txt4
-rw-r--r--fw/README.md25
6 files changed, 36 insertions, 29 deletions
diff --git a/fw/.gitignore b/.gitignore
index 06f39a9..60fd437 100644
--- a/fw/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
-build
.cache
+build
log.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..7d5602c
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.10)
+
+project(iot-contact LANGUAGES NONE)
+
+add_subdirectory(fw)
diff --git a/README.md b/README.md
index 72b2b57..c2db017 100644
--- a/README.md
+++ b/README.md
@@ -2,4 +2,31 @@
iot-contact is an IoT device to check if doors and windows are closed or open.
+## Usage
+
+The content of this repository can be build with CMake and Ninja.
+
+```
+cmake -Bbuild -GNinja
+ninja -C build
+```
+
+The resulting firmware can be flashed via an ST-LINK debugger / programmer.
+
+```
+st-flash --connect-under-reset write build/fw/zephyr/zephyr.bin 0x8000000
+```
+
+UART shell output can be retrieved with `picocom`.
+
+```
+picocom -b 115200 /dev/ttyACM0
+```
+
+Finally the firmware can be erased from the device with the ST-LINK.
+
+```
+st-flash --connect-under-reset erase
+```
+
[1]: https://docs.kicad.org/
diff --git a/compile_commands.json b/compile_commands.json
index c87e7db..25eb4b2 120000
--- a/compile_commands.json
+++ b/compile_commands.json
@@ -1 +1 @@
-fw/build/compile_commands.json \ No newline at end of file
+build/compile_commands.json \ No newline at end of file
diff --git a/fw/CMakeLists.txt b/fw/CMakeLists.txt
index 5cd52ce..000039e 100644
--- a/fw/CMakeLists.txt
+++ b/fw/CMakeLists.txt
@@ -15,9 +15,9 @@ find_package(Zephyr
"${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/zephyr"
)
-project(iot-contact)
+project(iot-contact-fw)
target_sources(app
PRIVATE
- src/main.c
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/main.c"
)
diff --git a/fw/README.md b/fw/README.md
index 8287fab..9883b2d 100644
--- a/fw/README.md
+++ b/fw/README.md
@@ -3,29 +3,4 @@
This is the firmware for iot-contact. It is based on the Zephyr real time
operating system [1].
-## Build
-
-```
-cmake -Bbuild -GNinja
-ninja -C build
-```
-
-## Flash
-
-```
-st-flash --connect-under-reset write build/zephyr/zephyr.bin 0x8000000
-```
-
-## Get shell output
-
-```
-picocom -b 115200 /dev/ttyACM0
-```
-
-## Remove firmware from device
-
-```
-st-flash --connect-under-reset erase
-```
-
[1]: https://zephyrproject.org