A Zephyr RTOS application for the Watchy smartwatch platform, featuring LVGL GUI support, WiFi connectivity, and sensor integration.
Tested on Watchy device.
- LVGL-based user interface with custom image support
- WiFi connectivity with credential management
- BMA4XX accelerometer support
- Button input handling
- Multiple app framework (counter app, image viewer)
- ESP32 hardware support
Before you begin, ensure you have the Zephyr development environment set up. Follow the Zephyr Getting Started Guide to install required dependencies.
- Initialize the workspace with west:
west init -m https://github.com/letanphuc/watchy_zephyr_app --mr main watchy_zephyr_app- Update Zephyr modules:
cd watchy_zephyr_app
west update- Apply Zephyr patch for Watchy display:
cd zephyr
git apply ../app/patch/0001-Fix-for-display-of-watchy.patch
cd ..This patch fixes:
- Display pixel format (MONO01 instead of MONO10)
- Reset pin logic for the SSD16xx e-paper display
- Install Python dependencies:
pip install -r zephyr/scripts/requirements.txt- Set up the environment:
Source the Zephyr environment and activate your Python virtual environment:
source zephyr/zephyr-env.sh
source /path/to/your/.venv/bin/activateBuild the application for Watchy:
west build -b watchy/esp32/procpu app -- -DBOARD_ROOT=$PWD/appClean build (if needed):
west build -t cleanFlash the application and start the serial monitor:
west flash && west espressif monitorapp/
├── CMakeLists.txt # Main CMake configuration
├── prj.conf # Project configuration
├── west.yml # West manifest
├── boards/ # Board-specific configurations
│ └── sqfmi/
├── cmake/ # Custom CMake modules
│ └── lvgl_image.cmake # LVGL image conversion
├── imgs/ # Image assets
├── script/ # Utility scripts
│ └── img_convert.py # Image conversion tool
└── src/ # Source code
├── main.c # Application entry point
├── buttons.c/h # Button handling
├── sensors.c # Sensor integration
└── app/ # Application modules
├── app_manager.c
├── counter/
├── images/
└── gpio_event.c
Key configuration options in prj.conf:
- WiFi: Enabled with credentials storage in NVS
- Display: LVGL with 1-bit color depth for e-paper
- Sensors: BMA4XX accelerometer support
- Networking: IPv4, DHCP, DNS resolver
- Logging: Enabled with immediate mode
Place PNG images in src/app/images/res/. The build system automatically converts them to LVGL-compatible format using the lvgl_image.cmake module.
Follow the pattern in src/app/counter/ to create new application modules. Register your app in app_manager.c.
SPDX-License-Identifier: Apache-2.0