Debug with EmbedScope
EmbedScope provides a desktop Inspector, the escope CLI, and a Rust host SDK for device identity, logs, metrics, UI trees, display capture, and input reproduction. An rs_lvgl application reuses its existing LVGL instance and handles inspection on the UI thread.
Diagnostics require an explicit application choice. Default rs_lvgl and rs_lvgl_ui builds do not create an Agent, start a server, or enumerate a diagnostic USB interface.
When to enable and disable diagnostics
--release does not disable diagnostics. Cargo features and optimization profiles are independent, and features are unified across dependencies. Avoid --all-features for production. Check whether another dependency, build script, or workspace command enables diagnostics again.
A device continues running its installed image after a feature-disabled build. Install and boot that new image to remove the running Agent and diagnostic USB interface.
Run the native integration example
The rs_lvgl 0.8 and EmbedScope 0.6.0 example renders a counter and a brightness
slider into a 320 × 240 LVGL memory display. Inspector shows the RGB888 flush
output. Reference application
Install the CLI and Inspector from EmbedScope 0.6.0. The example builds with Rust, a native C compiler and libclang. Run it from the rs_lvgl repository root.
The default endpoint is tcp://127.0.0.1:9338. The tree reports the current
pixel locations of settings.increment and action:settings.brightness.
Choose a new filename for each capture.
Connect Inspector 0.6 to the same endpoint after the CLI exits. Enable Send taps and click near the middle of the brightness slider. Last observed action reports the outcome and shows the completed frame number when the preview matches. The example includes presets for rejection and an unconfirmed preview. Reproduction steps
Give the application one explicit switch
embedscope is an application feature in the example and Dango OS. It is not a built-in rs_lvgl_ui feature. An application can use:
Keep the application's existing rs_lvgl_ui dependency/configuration. Gate the diagnostic modules, initialization, buffers, log fan-out and transport behind #[cfg(feature = "embedscope")]. Selecting dependencies makes APIs available; the application still implements Backend and byte transport.
Applications using escope-lvgl 0.6/native for NativeTree share the
rs_lvgl_sys 0.8 provider, source and configuration.
These related switches have distinct purposes:
Connect a physical device
Reuse the application's executor, display and input drivers. Transport tasks exchange frames and queue bounded requests. The UI loop executes Backend operations at a safe point after layout, updates and native callbacks.
- Keep every LVGL access on the UI thread. Stop reads and drop the tree adapter before deleting its root. Advance revision after native changes; do not reuse node IDs or cursors across session/revision boundaries.
- Use one native provider, ABI and configuration. The example uses registry dependencies throughout. Unify sources before mixing path and registry providers, or use default
escope-lvglwith an applicationTreeSourcethat does not link another LVGL. - Capture an independently owned fixed frame. State whether it comes from a subtree, final display submission or panel readback. Direct drawing and transitions usually need the platform's final output path.
- Route injected input through system input arbitration with paired press/release. Disconnect, cancellation and shutdown release input, capture and stale-session queues.
- Fan out structured records from the existing logger before formatting. Keep unmeasured metrics
nulland advertise implemented capabilities only.
See EmbedScope Rust integration and LVGL integration for platform interfaces.
Dango OS
Dango OS is a Rust embedded system for ESP-Mosaico with a companion Home screen, native settings and Lua applications. Its adapter uses a second USB CDC for EmbedScope while preserving the console, application installation and OTA.
In a Dango checkout containing the adapter:
cargo fw already includes --release. Install the diagnostic image with Dango tooling, then connect to the enumerated second CDC with --dtr on. Follow the EmbedScope Dango OS guide for integration, port selection, and native/Lua screen diagnosis.
Verify a production build
For the native example:
The normal/build dependency graph should contain no escope-* when diagnostics are disabled. For firmware, also inspect the final linked artifact, USB descriptors and interfaces after boot. A disconnected Inspector does not establish removal. Switching features reuses Cargo's appropriate cached artifacts; cargo clean is unnecessary.
Run the native integration acceptance test with:
It covers real native tree/pixels, input-driven state changes, logs, fixed capture, malformed frames, reconnect cleanup and ordered shutdown. Physical display, touch and device transport acceptance remain target-project checks.