← index #5913PR #12493
Related · high · value 3.957
QUERY · ISSUE

ESP32-OTA: Partition.writeblocks with buffer size not multiple of blocksize gives OSError

openby chtinnesopened 2020-04-12updated 2024-01-10
port-esp32

Hey,

Just realized, that writing data into partition with a data buffer with size != 0 mod BLOCK_SIZE leads to an OSError: -260.
It is due to the erase call esp_partition_erase_range(self->part, offset, bufinfo.len) in
esp32_partition_writeblocks.

I am not sure if this is intended behavior. If not, I would recommend either to return a proper error message or to erase ceil(buffer_size/BLOCK_SIZE) blocks.

CANDIDATE · PULL REQUEST

esp32: fix Partition.writeblocks partial write corruption

mergedby pillo79opened 2023-09-21updated 2023-09-26
port-esp32

To simulate a partial erase, the code reads a native block, erases it, and writes back the data before and after the erased area. However, the current logic was filling the area after the erased block with data from the beginning of the native block-aligned data, instead of applying the proper offset.

Fixes #12474.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied