Skip to main content

Constants Reference

Critical constants that define SimpleGo's behavior. Changing these values incorrectly will break protocol compatibility or cause data loss.

SMP Transport

ConstantValueDescription
SMP_BLOCK_SIZE16,384 bytesHard SMP transport limit per frame
HISTORY_MAX_PAYLOAD16,000 bytesUsable payload after framing overhead
HISTORY_MAX_TEXT4,096 bytesMaximum text stored to SD card
HISTORY_DISPLAY_TEXT512 bytesTruncation for LVGL bubbles only -- never applied before SD write

Critical rule: HISTORY_DISPLAY_TEXT is a UI-only truncation. Text must always be written to SD card at full HISTORY_MAX_TEXT length before any display truncation.

Memory Architecture

ConstantValueDescription
LVGL internal pool64 KBFixed, separate memory subsystem
PSRAM message cache30 messages (~135 KB)Sliding window between SD and LVGL
LVGL bubble window5 bubbles (~6 KB)Currently visible messages
Ratchet array128 contacts (~68 KB)ratchet_state_t in PSRAM
Frame pool4 frames (64 KB)Reusable SMP frame buffers in PSRAM

Task Stacks

TaskSizeMemoryCore
network_task16 KBSRAM0
smp_app_task16 KBSRAM1
lvgl_task8 KBSRAM1
wifi_manager4 KBPSRAM0

Crypto

ParameterValue
E2E key exchangeX448 (not X25519)
E2E symmetricAES-256-GCM
Per-queue encryptionX25519 + XSalsa20 + Poly1305 (NaCl cryptobox)
SD card encryptionAES-256-GCM with HKDF-SHA256 per-contact key
TLS version1.3, ALPN smp/1
Content padding16 KB fixed blocks at every layer

Build

ParameterValue
ToolchainESP-IDF 5.5.2
Normal buildidf.py build flash monitor -p COM6
Full eraseidf.py erase-flash then normal build
Hardware AESDisabled (CONFIG_MBEDTLS_HARDWARE_AES=n) -- DMA/memory conflict
WPA3 thresholdWIFI_AUTH_WPA2_PSK (not WPA3/WPA_WPA2)

Further Reference