MicroPython firmware update
flash_mpyFlashes MicroPython firmware to a CyberBrick board, writes mpy.img, and reboots the device; requires explicit user approval and confirm=true because the update is destructive.
Instructions
Run a MicroPython firmware update via the app's updateLoaderFirmwareMpy (START_MPY_UPDATE). Writes mpy.img and REBOOTS the board. DESTRUCTIVE — requires confirm=true after explicit user approval. Default path upgrades to the built-in RC MPY (mpyType=1); passing userMpyConfig targets a design MPY. Experimental: the built-in path still needs live validation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"confirm": "<confirm>"
},
"name": "flash_mpy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | ||
| target | No | Which device to target — pass exactly one field. If omitted, the app must know exactly one device; ambiguous or unmatched targets are refused. | |
| confirm | Yes | Must be true. Set it only after the user has explicitly approved this specific upgrade on this specific device. | |
| mpyType | No | 0 = user_mpy (design MPY, requires userMpyConfig), 1 = cb_rc (built-in RC MPY). | |
| designId | No | ||
| checksum0 | No | MPY checksum for the upgrade check; defaults to empty (built-in path). | |
| userMpyConfig | No | Design MPY config {title, microPython:{uniKey, checkSum0}} — required when mpyType=0. | |
| eraseFirmwareConfig | No | Also erase the board RC config after upgrade (app behavior step 13). |