Files
mellifera_firmware/README.md
2024-05-15 21:04:36 -06:00

98 lines
2.4 KiB
Markdown

# Zephyr Example Application
## Getting Started
### Initialization
The first step is to initialize the workspace folder (``my-workspace``) where
the ``example-application`` and all Zephyr modules will be cloned. Run the following
command:
```shell
# initialize my-workspace for the example-application (main branch)
west init -m https://github.com/zephyrproject-rtos/example-application --mr main my-workspace
# update Zephyr modules
cd my-workspace
west update
```
### Building and running
To build the application, run the following command:
```shell
cd mellifera_firmware
west build -b mellifera_rev1 app
```
Once you have built the application, run the following command to flash it:
```shell
west flash
```
```shell
go install github.com/apache/mynewt-mcumgr-cli/mcumgr@latest
```
### Bootloader
```shell
# build and flash the bootloader
west build -p -b mellifera_rev1 ../mcuboot/boot/zephyr/ -- -DCONF_FILE=$(pwd)/boot.conf
west flash
# define serial connection to device
~/go/bin/mcumgr conn add acm0 type="serial" connstring="dev=/dev/ttyACM0,baud=115200,mtu=512"
~/go/bin/mcumgr conn add ttyusb0 type="serial" connstring="dev=/dev/ttyUSB0,baud=115200,mtu=512"
# hold button while power cycling to enter bootloading mode
~/go/bin/mcumgr -c ttyusb0 image list
# build the app
west build -p -b mellifera_rev1 app
~/go/bin/mcumgr -c ttyusb0 image upload -e build/zephyr/zephyr.signed.bin
~/go/bin/mcumgr -c ttyusb0 image list
```
### Testing
To execute Twister integration tests, run the following command:
```shell
west twister -T tests --integration
```
### Documentation
A minimal documentation setup is provided for Doxygen and Sphinx. To build the
documentation first change to the ``doc`` folder:
```shell
cd doc
```
Before continueing, check if you have Doxygen installed. It is recommended to
use the same Doxygen version used in [CI](.github/workflows/docs.yml). To
install Sphinx, make sure you have a Python installation in place and run:
```shell
pip install -r requirements.txt
```
API documentation (Doxygen) can be built using the following command:
```shell
doxygen
```
The output will be stored in the ``_build_doxygen`` folder. Similarly, the
Sphinx documentation (HTML) can be built using the following command:
```shell
make html
```
The output will be stored in the ``_build_sphinx`` folder. You may check for
other output formats other than HTML by running ``make help``.