diff options
| -rw-r--r-- | README.md | 46 | 
1 files changed, 33 insertions, 13 deletions
@@ -3,38 +3,58 @@  iot-contact is an IoT device to check if doors and windows are closed or open.  Furthermore roller shutter motors should be controlled. +Currently two boards are supported: + +- `native_sim/native/64` without bootloader +- `nucleo_f767zi` with bootloader +  ## Usage -The content of this repository can be build with CMake and Ninja. +To build the firmware a firmware signing key is required. It is generated with +the `imgtool.py`.  ``` -cmake -Bbuild -GNinja -ninja -C build +mkdir -p ~/mcuboot +./imgtool.py keygen --key ~/mcuboot/key.pem --type ed25519  ``` -Exported files related to the printed circuit board (PCB) can be found in the -build folder. +The content of this repository can be build with CMake and Ninja. The +application firmware will be built for the simulation board to easily use it +without special hardware. + +The bootloader is built for `nucleo_f767zi` since the simulation board is +currently not supported.  ``` -tree build/pcb +cmake -Bbuild -GNinja -DKEY=~/mcuboot/key.pem +ninja -C build  ``` -The resulting firmware can be flashed via a ST-LINK debugger / programmer. +To run the simulated firmware a virtual network interface `zeth` and a router +advertisement daemon have to be provided with an embedded script. Root rights +are required for that (prefix e.g. with `sudo`).  ``` -st-flash --connect-under-reset write build/fw/zephyr/zephyr.bin 0x8000000 +./fw/simulate-network.sh  ``` -UART shell output can be retrieved with `picocom`. +With the firmware built and the network being prepared the simulated firmware +can be run.  ``` -picocom -b 115200 /dev/ttyACM0 +./build/fw/zephyr/zephyr.exe  ``` -Finally the firmware can be erased from the device with the ST-LINK. +To build the firmware in a clean `nucleo` build folder, flash it and open a +serial interface another script can be used for convenience.  ``` -st-flash --connect-under-reset erase +./fw/nucleo.sh  ``` -[1]: https://docs.kicad.org/ +Next to the firmware artifacts the exported files related to the printed +circuit board (PCB) can be found in the build folder. + +``` +tree build/pcb +```  | 
