← index #12703PR #4910
Related · high · value 3.785
QUERY · ISSUE

OTA partitions in ESP32-C3

openby pbdaranopened 2023-10-16updated 2023-10-25
bugport-esp32

I am trying to enable OTA partitions in ESP32-C3 by changing the custom partition file in sdkconfig file.
But it's not getting enabled. Can you please help?

CANDIDATE · PULL REQUEST

esp32: Add esp32.Partition class to interface to OTA functions.

closedby dpgeorgeopened 2019-07-09updated 2020-04-07
port-esp32

Following on from the comment https://github.com/micropython/micropython/pull/3576#issuecomment-486954865 here is a proposal for a wrapper class for the ESP32 OTA/partition functions.

The API is based around a single Partition class. The constructor is used to create new Partition objects, and methods manipulate such objects.

from esp32 import Partition

# Constructors
Partition(Partition.FIRST, type=Partition.TYPE_APP)
Partition(Partition.FIRST, type=Partition.TYPE_DATA)
Partition(Partition.FIRST, type=Partition.TYPE_DATA, subtype=2, label='nvs')
Partition(Partition.BOOT) # get boot partition
Partition(Partition.RUNNING) # get currently running partition

# Methods
part.info() # returns a 6-tuple of (type, subtype, addr, size, label, encr)
part.readblocks(block_num, buf)
part.writeblocks(block_num, buf)
part.eraseblocks(block_num, size)
part.set_boot() # sets current as bootable, for next reset
part.get_next_update() # returns new Partition

I didn't yet test the OTA functionality

Edit: updated signatures for partition methods.

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