![]() |
MelexisIO SCPI Commands
|
Compact reference for the EEPROM emulation interface. The module stores a JSON document in RAM (eeprom_buffer) and persists versioned snapshots as binary records in a dedicated Flash sector.
On system startup / reset the firmware loads the last valid persisted record (latest intact) into the RAM buffer automatically.
Each persisted record (little endian):
Records are appended sequentially until no space remains or corruption is detected. An erased word reads 0xFFFFFFFF.
| Command | Parameters | Action |
|---|---|---|
:EeProm:INIT | *(none or index)* | Load latest record (no param / -1) or 0-based record index. |
:EeProm:ERASE | - | Clear RAM buffer only (Flash untouched). |
:EeProm:DUMP | - | Pretty-print current RAM JSON. |
:EeProm:SAVE | optional 0/1 | Persist RAM JSON (append 0/None or 1 to force erase all). |
:EeProm:RECords? | - | List all valid / first corrupt Flash records. |
:EeProm:Object? | key[.prop] | Pretty-print object at top-level key. |
:EeProm:String | key[.prop],value | Set string. |
:EeProm:Integer | key[.prop],value | Set integer. |
:EeProm:Float | key[.prop],value | Set float. |
:EeProm:Boolean | key[.prop],value | Set boolean (0/1/true/false/on/off/yes/no). |
:EeProm:String? | key[.prop] | Get string. |
:EeProm:Integer? | key[.prop] | Get integer. |
:EeProm:Float? | key[.prop] | Get float. |
:EeProm:Boolean? | key[.prop] | Get boolean. |
:EeProm:DELete | key[.prop] | Delete key or property. |
Notes:
. (e.g. net.port). Missing objects are auto-created on set.:EeProm:INIT scans the sector, validating consecutive records:
:EeProm:INIT,<n> loads record index n (0-based) if valid; aborts if out of range.Return messages (examples):
Syntax: :EeProm:SAVE or :EeProm:SAVE,«erase» where «erase» is 0 or 1.
Flow:
""), it is converted to {} before saving.Messages:
Empty JSON example:
:EeProm:RECords? prints table until free space or first corruption:
Status meanings:
Outputs:
key="value"key=123key=1.23key=0|1 On success for set/delete: OK.Error samples:
:EeProm:DELete key removes whole key. :EeProm:DELete parent.child removes only child from object parent. Nonexistent targets report an error.
| Case | Handling |
|---|---|
| Empty buffer save | Auto-converted to {}. |
| Duplicate save | Skipped if identical (wear reduction). |
| Full sector | Auto-erase (unless skip) then write at offset 0. |
| Corruption mid-chain | Stop scan; latest prior valid used; next save may erase. |
| Oversized JSON | Rejected with error before Flash write. |
Maximum JSON length per record: EE_SECTOR_SIZE - 12 - 1 - padding.
Internal helper APIs may suppress printing when verbose == 0. SCPI command layer typically prints always.
End of EEPROM SCPI reference.