fix: chunked write protocol for large file uploads - #9
Open
dwgx wants to merge 1 commit into
Open
Conversation
storage_write sent entire file in one protobuf message, exceeding Flipper's RPC frame limit (~512 bytes payload). Files >50KB fail silently or produce truncated .fap on device. Implements proper chunked protocol per flipperzero-protobuf spec: - Split into 512-byte chunks, shared command_id across all - Every WriteRequest carries path (required by firmware) - Intermediate chunks: has_next=True, fire without waiting - Final chunk: has_next=False, await device ACK - Timeout scales with file size instead of fixed 3s
dwgx
force-pushed
the
fix/chunked-storage-write
branch
from
July 3, 2026 22:50
1d26fb3 to
46a3ebc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
storage_write sends the entire file payload in a single protobuf message. Flipper's RPC transport caps frame payload at ~512 bytes, so any file over that threshold is rejected by the firmware or silently produces a truncated file on the SD card.
This made it impossible to upload .fap application binaries (typically 10-170KB) through the RPC interface.
Fix
Implements the chunked write protocol per flipperzero-protobuf spec:
Tested
Uploaded 14 FAP binaries (4KB-172KB) to Flipper Zero over USB serial. All wrote correctly and matched expected sizes on-device.