adafruit / tinyuf2

UF2 bootloader based on TinyUSB for embedded devices such as ESP32S2, STM32F4 and iMX RT10xx
MIT License
314 stars 172 forks source link

ESP32-SX Have alternate partition scheme with no OTA support #227

Closed UnexpectedMaker closed 1 year ago

UnexpectedMaker commented 2 years ago

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?

hathach commented 2 years ago

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)

hopkapi commented 2 years ago

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?

Neradoc commented 1 year ago

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 existing drive can be extended like this (save your data first of course).

import storage
storage.erase_filesystem(extended=True)
hopkapi commented 1 year ago

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

import storage
storage.erase_filesystem(extended=True)