Getting Started
Development
Prerequisites
Please install the following components to your system. Otherwise, you will face errors during the setup process!
- Git >= 2.25
- Python >= 3.8.5
- Pip >= 20.0.2
- CMake >= 3.16
Setup developer environment
- Clone the project from
git@github.com:inoa-io/inoa-os-esp32.git
- Clone the submodules
git submodule update --init --recursive
- Go to the inoa-os-esp32 directory
- Run
./libraries/esp-idf/install.sh
- Run
. ./libraries/esp-idf/export.sh
- Use an IDE of your choice, recommended is CLion
- Be sure to run the IDE from the same terminal session you sourced the export.sh script!
- Set the CMake root directory to the firmware folder to import the project correctly
Local Build
idf.py all
If you also want to upload the firmware, use:
idf.py -p /dev/ttyUSB? flash
From time to time you will also have to clean your project. For example, if the SDK config has been changed or components have been updated.
idf.py clean
idf.py fullclean
Executing the device tests
idf.py -C device-tests inoa_qemu_test
Coding rules
- Use the standard code style format defined in the file .clang-format (Please import this code style in your IDE)
- Use the
#pragma once
macro for all your header files - For all other rules, please follow this guide
Console
- Use
idf.py -C firmware -p /dev/ttyUSB? monitor
to open the console - You should see the console now
- You can exit the console by pressing Ctrl + ]
- Do not forget to close the connection if you want to upload new firmware!
Troubleshooting
Decoding Backtraces
- Use the monitoring tool as described in chapter "Console"
- The Backtrace will automatically be decoded
Debugging
We use GDB (OpenOCD / JTAG) with the ESP Prog Adapter to debug the software on a running hardware.
Build full binary image
idf.py inoa_flash_image
Testing
Unit Testing
On-Device Testing
- Set your CMake project root from firmware to the device-tests folder
- Clean and re-import the project (also clear caches if possible in your IDE)
- Follow the ESP-IDF Documentation
- Or, use the emulator:
idf.py -C device-tests inoa_qemu_test
Integration Testing
See the Testing project for hardware integrated tests.
Usage
MenuConfig
idf.py menuconfig
Upload
- Connect the USB port to your PC
- Press and hold "Reset" button on board
- Press and hold "Prog" button on board
- Release "Reset" button on board
- Release "Prog" button on board
- Run
./idf.py -p /dev/ttyUSB? flash
- Press "Reset" button on board