-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[ESP32] Partition.find(label='x') not supported. #5378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
bdev = Partition.find(Partition.TYPE_DATA, label='vfs') I think you need to specify the partition type? |
For reference, here is @dpgeorge original comment on the functionality:
Passing just the label also does not work,
@jimmo
|
Seems this is probably an issue with Espressif, since MicroPython just hands off the search to ESP IDF https://docs.espressif.com/projects/esp-idf/en/stable/api-reference/storage/spi_flash.html#_CPPv418esp_partition_find20esp_partition_type_t23esp_partition_subtype_tPKc |
As mentioned in #4910 (comment) there are 2 ways to construct a partition object:
Doing |
Here is my partition table:
Note that
But, ident is found by type, as above,
|
The IDF docs does have this one line: For which,
Perhaps custom partition types are not supported when searching by label. |
Further documentation on custom partitions: https://docs.espressif.com/projects/esp-idf/en/stable/api-guides/partition-tables.html#type-field The boot loader ignores any type other than 0x00 and 0x01. While I was aware of this and found this satisfactory. I didn't expect other features of the partition API to ignore it. Either way, I no longer think this is a MicroPython bug and I'm happy to close this. Perhaps the documentation could do with a bump. Maybe I should poke Espressif on this. |
Right, that's the problem. The IDF doesn't (AFAIK) provide a way to search all partition types for a given identifier. You must know the type to search for it. The MicroPython bindings search both TYPE_APP and TYPE_DATA (in that order) when given a string, and fails if the string is not found under one of those types. I don't think it's sensible for MicroPython to search all types (eg a for loop over 0x00-0xff). I guess the point is you can define the same label more than once for different types. |
That sounds sensible. Thanks! |
Conclusion: You cannot search only by a label if the partition type is not APP or DATA, this is an ESP-IDF limitation. If you're searching for a partition by name and it is not either APP or DATA, then you must also explictly specify the type, eg:
wont-fix |
…ay-i2s Espressif: Use i2s peripheral for parallel LCD displays
When trying to find a partition by label only, on ESP32, the returned list is empty.
If its not too much effort, it would be nice to just give the label name and find the partition.
The text was updated successfully, but these errors were encountered: