← index #5596PR #8268
Related · medium · value 0.572
QUERY · ISSUE

[ESP32 Docs]: Partition readblocks / writeblocks extended

openby mrwhy-origopened 2020-01-31updated 2024-10-01
docsneeds-info

The Partition class docs are a bit misleading, if i am right.

These methods implement the simple and extended block protocol defined by uos.AbstractBlockDev.

But the source code of the Partition class is using an internal calculated offset so atm there is just the simple protocol:

STATIC mp_obj_t esp32_partition_readblocks(mp_obj_t self_in, mp_obj_t block_num, mp_obj_t buf_in) { esp32_partition_obj_t *self = MP_OBJ_TO_PTR(self_in); uint32_t offset = mp_obj_get_int(block_num) * BLOCK_SIZE_BYTES; mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); check_esp_err(esp_partition_read(self->part, offset, bufinfo.buf, bufinfo.len)); return mp_const_none; }
Please correct me if I am wrong.

CANDIDATE · PULL REQUEST

esp32: support 512 byte block size in esp32.Partition

mergedby dpgeorgeopened 2022-02-07updated 2022-02-21
port-esp32

This is to support FAT filesystems that use a 512 byte block size. Useful for compatibility with filesystems created by CircuitPython (eg when using TinyUF2).

To do:

  • test writes
  • add more comments

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