← index #6553Issue #8355
Off-topic · high · value 2.420
QUERY · ISSUE

ESP32 execute esp.read_flash() cause exception

openby walklinewangopened 2020-10-16updated 2024-09-13
docsport-esp32
  • firmware version: MicroPython v1.13-106-g893f75546-dirty on 2020-10-16

  • customize partition table:

    name type sub-type offset size
    nvs data nvs 0x9000 0x6000
    phy_init data phy 0xf000 0x1000
    factory app factory 0x10000 0x180000
    vfs data fat 0x200000 0x1ff000
    user_data data fat 0x3ff000 0x1000
  • executed code:

    >>> import esp32
    >>> part=esp32.Partition
    >>> part.find(type=part.TYPE_DATA)
    [<Partition type=1, subtype=2, address=36864, size=24576, label=nvs, encrypted=0>, <Partition type=1, subtype=1, address=61440, size=4096, label=phy_init, encrypted=0>, <Partition type=1, subtype=129, address=2097152, size=2093056, label=vfs, encrypted=0>, <Partition type=1, subtype=129, address=4190208, size=4096, label=user_data, encrypted=0>]
    >>> user=part("user_data")
    >>> user.info()
    (1, 129, 4190208, 4096, 'user_data', False)
    >>>
    >>>
    >> import esp
    >>> esp.flash_size()
    4194304
    >>> esp.flash_write(0x3ff000, b'walkline')
    >>> esp.flash_read(0x3ff000, 0x10)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: object with buffer protocol required
    >>>
    

According to the doc, the 2nd param is a length of buffer that I want to read, but why it raise a TypeError to me?

BTW, are there anyone knows how to use esp32.Partition to read and write blocks?

Thanks~

CANDIDATE · ISSUE

ESP 32 OTA with v1.18

openby VarshneyNaupadaopened 2022-02-25updated 2025-10-03
port-esp32

Hi Team,

I have flashed " esp32-ota-20220117-v1.18.bin " to my esp32 with 4MB flash device, After flashing it it took almost 1.5 MB for firmware partition and rest for others as per given below partition table.

As per below table and v1.18 bin file size, there is no possibility for OTA updates with provision of having factory , OTA_0 & OTA_1, along with application code. please correct me if my understanding is not valid.

Also, I did not find any sample code for implementation of OTA along with application code . Requesting team to include sample files or guide us the implementation instructions with this version.

Partition table for MicroPython with OTA support using 4MB flash
Notes: the offset of the partition table itself is set in
$IDF_PATH/components/partition_table/Kconfig.projbuild.
Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xd000, 0x2000,
phy_init, data, phy, 0xf000, 0x1000,
ota_0, app, ota_0, 0x10000, 0x180000,
ota_1, app, ota_1, 0x190000, 0x180000,
vfs, data, fat, 0x310000, 0x0f0000,

Thank you

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