tinyuf2 icon indicating copy to clipboard operation
tinyuf2 copied to clipboard

ESP32-SX Have alternate partition scheme with no OTA support

Open UnexpectedMaker opened this issue 3 years ago • 2 comments

Though OTA is cool, I'd hazard to guess that fewer CircuitPython users would use OTA in general, and even be confident enough to guess hardly any use it all.

I'd like to see, not only a second UF2 option for ESP32-SX boards that has no OTA partitions laid out at all, and just a much bigger user file system partition, but also have that be the new default partition layout/binary and have OTA as a second option for those that want to use OTA.

I've spoken a few times with @tannewt about this, and it has to happen at the UF2 bootloader side, as that is what enforces the partition scheme, so we'd need this integrated as alternate builds for ESP32 (and any other platforms that could/might) use this in the future.

I am constantly getting asked questions like... Screen Shot 2022-06-25 at 10 43 32 am

or folks just letting me know their board they just received is faulty because it's only got 2MB of flash on it instead of 4MB or 8MB etc like advertised.

I don't really mind how this is implemented - but I think it's really important to give users more flash if it's available on the chip, and the choice to use it or choose OTA instead if that suits their needs.

@hathach Thoughts?

UnexpectedMaker avatar Jun 25 '22 00:06 UnexpectedMaker

you could add partitions-8MB-noota.csv in additional to default with ota. If it is generic enough, it could be place along side with other csv in ports/expressif. If it is too specific to an board, you should put it under your board folder (with a bit of update to the path-to-csv)

hathach avatar Jun 28 '22 15:06 hathach

Just got an ESP32-S2 TFT Feather from Adafruit myself, and have just had a similar "Huh?" moment upon realising my "4MB Flash" board has less than 1MB I can actually use for stuff in CP due to this. It does seem like a strange default unless this is really key to something I'm unaware of?

hopkapi avatar Jun 29 '22 20:06 hopkapi

Note that a solution is now released in Circuitpython 8. This PR: https://github.com/adafruit/circuitpython/pull/7000 thanks to MicroDev, lets you reformat the CIRCUITPY drive so that it extends into the OAT1 partition. https://docs.circuitpython.org/en/latest/shared-bindings/storage/index.html#storage.erase_filesystem

  • An empty flash is formatted in extended mode by default.
  • It disables the dualbank module (it's still there but raises an exception).
  • Reformatting an existing drive preserves the [non] extended nature of it.

An existing drive can be extended like this (save your data first of course).

import storage
storage.erase_filesystem(extended=True)

Neradoc avatar Feb 23 '23 06:02 Neradoc

Just to be clear, it's actually "extended", rather than "extend":

import storage
storage.erase_filesystem(extended=True)

hopkapi avatar Mar 06 '23 03:03 hopkapi