esp32 lvgl firmware

    1

    Build and debug responsive ESP32 firmware with LVGL UI, multi-core concurrency, and Anthropic API integration.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    esp32 lvgl firmware

    Example session with this skill installed

    I need to create a new settings screen for my ESP32 handheld. It needs to handle WiFi configuration and a back button to the main menu. Give me the C template following the skill rules.

    • Read your context and instructions
    • Compiled the esp32 lvgl firmware

    I will generate a screen module template for your settings screen. This follows the four-layer architecture, ensuring the UI runs on the LVGL task while suggesting a background task for WiFi operations to prevent blocking the interface.

    Settings Screen Module Implementation

    #include "ui.h"
    #include "board.h"
    #include <lvgl.h>
    
    static lv_obj_t *s_screen;
    static lv_obj_t *s_wifi_btn;
    static volatile bool s_is_connecting = false;
    
    // Background task for WiFi to prevent UI freeze
    static void wifi_connect_task(void *pvParameters) {
        board_lock();
        if (lv_obj_is_valid(s_wifi_btn)) {
            lv_label_set_text(lv_obj_get_child(s_wifi_btn, 0), "Connecting...");
        }
        board_unlock();
    
        // Perform blocking WiFi connect here (Core 0)
        // ... 
        
        s_is_connecting = false;
        vTaskDelete(NULL);
    }
    
    static void wifi_event_handler(lv_event_t * e) {
        if (s_is_connecting) return;
        s_is_connecting = true;
        xTaskCreatePinnedToCore(wifi_connect_task, "wifi_task", 6144, NULL, 5, NULL, 0);
    }
    
    void ui_settings_screen_init(void) {
        s_screen = ui_make_screen();
        
        // WiFi Button
        s_wifi_btn = lv_btn_create(s_screen);
        lv_obj_set_size(s_wifi_btn, 160, 40);
        lv_obj_align(s_wifi_btn, LV_ALIGN_CENTER, 0, -20);
        lv_obj_t *label = lv_label_create(s_wifi_btn);
        lv_label_set_text(label, "Connect WiFi");
        
        lv_obj_add_event_cb(s_wifi_btn, wifi_event_handler, LV_EVENT_CLICKED, NULL);
        ui_add_to_group(s_wifi_btn);
    
        // Back button handling
        ui_add_back(s_screen);
    }
    
    void ui_load_settings_screen(void) {
        ui_settings_screen_init();
        ui_load_screen(s_screen);
    }
    

    Next steps

    • Register the ui_load_settings_screen function in your main menu's event handler.
    • Update your board.h to ensure board_lock() uses a non-recursive mutex.
    • Verify that your background task stack size is at least 6144 bytes if adding HTTPS calls.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    This skill provides technical guidance for building event-driven ESP32 firmware using the LVGL graphics library. It addresses common pain points in embedded development, such as responsive UI threading, ESP-IDF build environment quirks, and integrating LLM APIs on constrained hardware. The skill helps you implement a structured four-layer architecture—drivers, services, screens, and main logic—ensuring every UI component follows a consistent lifecycle of creation, focus management, and memory cleanup.

    What it does

    • Standardizes UI architecture by implementing a four-layer, event-driven model for screens and services.
    • Manages concurrency with specific FreeRTOS task rules to prevent UI freezes and stack overflows during I/O operations.
    • Resolves build issues by providing workarounds for ESP-IDF v5.4 silent failures in git-bash environments.
    • Integrates AI services using patterns for HTTPS POST requests to the Anthropic Messages API on background tasks.
    • Handles bilingual output through UTF-8 detection and custom font regeneration workflows for Chinese characters.

    How it works

    1. Initialize the environment using the specific export.bat workaround for your terminal to ensure the ESP-IDF toolchain loads correctly.
    2. Scaffold screen modules using the recommended template to handle widget creation and button group registration.
    3. Implement background services for WiFi, SD card, or API calls on core 0 while keeping LVGL on core 1.
    4. Flash the firmware following the partition layout and image assembly steps for CP210x or CH340 boards.

    Frameworks & tools

    This skill focuses on ESP-IDF v5.4, FreeRTOS, and LVGL. It targets ESP32 handheld hardware and utilizes the Anthropic Messages API for network-based AI features.

    Why this beats prompting it yourself

    Generic AI prompts often ignore the fragile nature of ESP32 concurrency, leading to race conditions between the LVGL task and network callbacks. This skill enforces specific memory safety rules, like lv_obj_is_valid checks and non-reentrant locking, that are unique to stable embedded deployments.

    Use cases

    • Porting a chat-based AI assistant interface to a custom ESP32 handheld device.
    • Debugging stack overflows and watchdog resets in multi-threaded firmware.
    • Building a captive portal for WiFi configuration using SoftAP and a web server.
    • Creating a menu-driven UI that manages hardware peripherals like SD cards and displays.

    Known limitations

    Supports ESP-IDF v5.4 specifically. Limited to 2.4 GHz WiFi hardware. Build workarounds are designed for Windows-based environments (cmd.exe and git-bash).

    Targets ESP-IDF v5.4. Limited to 2.4 GHz WiFi. Build workarounds specific to Windows cmd.exe/git-bash. Requires specific task stack sizes (6-8KB) to avoid overflows.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Write Files
    Network Access
    Listed14 days ago

    What's inside

    Frequently Asked Questions

    This skill provides a structured four-layer architecture—drivers, services, screens, and logic—specifically designed to prevent common UI freezes and race conditions when using LVGL and FreeRTOS together.

    The skill is optimized for ESP-IDF v5.4 and includes specific workarounds for silent build failures in Windows environments like git-bash and cmd.exe.

    Yes, it includes specialized patterns for making HTTPS POST requests to the Anthropic Messages API using background tasks to ensure your UI remains responsive during network I/O.

    The skill provides a complete firmware framework, including scaffolding templates for screen modules, memory safety rules for widget lifecycle management, and custom font workflows for multilingual support.

    The skill implements a dual-core strategy where high-latency services like WiFi and SD card operations run on Core 0, while the LVGL graphics task is isolated on Core 1 to prevent watchdog resets.

    New in APIs & Backend