[{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI'm often wanting to list what's on a device in terms of partition table. There's a handy utility included with the ESP-IDF, but it's python only and it only accepts files so you have to first call esptool to save your partition table data. I've had to do it so often that I've saved the two commands in another playground note, but not any longer!\u003c/p\u003e\n\u003cp\u003eThe other thing is I swear that there used to be some online place to download your devices flash for backup using web serial, but try as I might\u0026nbsp; I cant find such a place, and my google-fu is usually on point - ignoring my switch to duckduckgo...I digress, introducing my latest possibly needless project, esptool-js \"partition edition\":\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n        \u003ch2\u003e\n\u003ca href=\"https://tyeth.github.io/read-partitions-esptool-js/\" target=\"_blank\"\u003ehttps://tyeth.github.io/read-partitions-esptool-js/\u003c/a\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; (\u003ca href=\"https://github.com/tyeth/read-partitions-esptool-js/tree/read-partitions-clean\" target=\"_blank\"\u003eSource\u003c/a\u003e)\u003c/h2\u003e\n      ","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI'm a big fan of the web-serial based ESPTool-JS from Espressif, it allows you to do most things from the browser and not install any dependencies or open a terminal.\u003c/p\u003e\n\u003cp\u003eWeb Serial is amazing!\u003c/p\u003e\n\u003cp\u003eAnyway, I've always been a bit upset that I couldn't find any way to run the same partition info retrieval via the browser. Today I finally bit the bullet and attempted to use copilot to interrogate the existing python file and produce a typescript port of the code. It didn't run, but after a bit of code wrangling it came together. \u003cbr\u003eNext the reading flash into a blob (binary object in browser-speak) and triggering the download, and finally adding a few finishing touches like logging and getting the downloaded file names correct, and it was good enough for now!\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/394/original/image_%289%29.png?1731556178","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eHow to use it?\u003c/h2\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eWell, the image above shows after I've clicked the\u0026nbsp;\u003cstrong\u003eRead Partition Table\u003c/strong\u003e button. The default partition offset of 0x8000 should be fine for most boards, otherwise try 0x9000, although custom partition table offsets are supported. You won't even see those options until you've clicked Connect and selected your boards serial port.\u003c/p\u003e\n\u003cp\u003eOnce your partition table has loaded it shows the expected information, the bit most people are usually interested in is the first app partition, or ota_0 in this case, and the user file system (user_fs), which is a FAT partition in this screenshot.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eThe final column in the table has the download button for each partition, clicking it will start reading from the flash memory of the connected device, and once finished will ask the browser to download it. It will be named according to the chip name, partition type, starting offset, and size in bytes, but all the numbers are in hex not decimal.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003cp\u003eWith these files you can restore this device at any point in the future, by using the top section of the web page labelled \u003cstrong\u003eProgram\u003c/strong\u003e, or using the python version of esptool like all of the board guides show on the \u003ca href=\"https://learn.adafruit.com/adafruit-metro-esp32-s3/factory-reset#step-2-enter-rom-bootloader-mode-3106832\" target=\"_blank\"\u003efactory reset page\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eNow go and freely install something, anything, maybe CircuitPython, or maybe something totally wild, safe in the knowledge that your previous work can be restored. You could even clone a device!\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003ch1\u003e🎥 \"Live\" oEmbed version:\u003c/h1\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"embed","content":"https://tyeth.github.io/read-partitions-esptool-js/"},{"element_type":"text","content":"\n  \n        \u003cp\u003e\u003cem\u003eKeywords for future google warriors: esptool.py.exe read partition table gen_esp32part.py\u003cbr\u003e\u003c/em\u003e\u003cem\u003eread esp32 partitions, backup esp32s3, esp32s2, esp32c3, esp32c6, esp32h2, esp32p4, esp32c61\u003c/em\u003e\u003c/p\u003e\n      \n","metadata":{}}]