Skip to content

letanphuc/watchy_zephyr_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watchy Zephyr Application

A Zephyr RTOS application for the Watchy smartwatch platform, featuring LVGL GUI support, WiFi connectivity, and sensor integration.

Tested on Watchy device.

Features

  • 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

Getting Started

Prerequisites

Before you begin, ensure you have the Zephyr development environment set up. Follow the Zephyr Getting Started Guide to install required dependencies.

Installation

  1. Initialize the workspace with west:
west init -m https://github.com/letanphuc/watchy_zephyr_app --mr main watchy_zephyr_app
  1. Update Zephyr modules:
cd watchy_zephyr_app
west update
  1. 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
  1. Install Python dependencies:
pip install -r zephyr/scripts/requirements.txt
  1. 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/activate

Building

Build the application for Watchy:

west build -b watchy/esp32/procpu app -- -DBOARD_ROOT=$PWD/app

Clean build (if needed):

west build -t clean

Flashing and Monitoring

Flash the application and start the serial monitor:

west flash && west espressif monitor

Project Structure

app/
├── 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

Configuration

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

Development

Adding Images

Place PNG images in src/app/images/res/. The build system automatically converts them to LVGL-compatible format using the lvgl_image.cmake module.

Creating New Apps

Follow the pattern in src/app/counter/ to create new application modules. Register your app in app_manager.c.

Resources

License

SPDX-License-Identifier: Apache-2.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published