idftool 0.2.2__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. idftool-0.5.0/CHANGELOG.md +118 -0
  2. idftool-0.5.0/Makefile +62 -0
  3. {idftool-0.2.2/idftool.egg-info → idftool-0.5.0}/PKG-INFO +75 -13
  4. idftool-0.2.2/PKG-INFO → idftool-0.5.0/README.md +70 -26
  5. idftool-0.5.0/idftool/__main__.py +1328 -0
  6. idftool-0.2.2/README.md → idftool-0.5.0/idftool.egg-info/PKG-INFO +88 -12
  7. idftool-0.5.0/idftool.egg-info/SOURCES.txt +48 -0
  8. {idftool-0.2.2 → idftool-0.5.0}/idftool.egg-info/requires.txt +5 -0
  9. idftool-0.5.0/idftool.egg-info/scm_file_list.json +44 -0
  10. idftool-0.5.0/idftool.egg-info/scm_version.json +8 -0
  11. {idftool-0.2.2 → idftool-0.5.0}/pyproject.toml +12 -0
  12. idftool-0.5.0/test/README.md +43 -0
  13. idftool-0.5.0/test/conftest.py +103 -0
  14. idftool-0.5.0/test/fixtures/README.md +12 -0
  15. idftool-0.5.0/test/fixtures/esp32s3/app-v1.bin +0 -0
  16. idftool-0.5.0/test/fixtures/esp32s3/app-v2.bin +0 -0
  17. idftool-0.5.0/test/fixtures/esp32s3/bootloader.bin +0 -0
  18. idftool-0.5.0/test/fixtures/esp32s3/flash-image.bin +0 -0
  19. idftool-0.5.0/test/fixtures/esp32s3/nvs.csv +6 -0
  20. idftool-0.5.0/test/fixtures/esp32s3/partition-table.bin +0 -0
  21. idftool-0.5.0/test/fixtures/esp32s3/partitions.csv +11 -0
  22. idftool-0.5.0/test/project/.gitignore +5 -0
  23. idftool-0.5.0/test/project/CMakeLists.txt +12 -0
  24. idftool-0.5.0/test/project/README.md +35 -0
  25. idftool-0.5.0/test/project/build_fixtures.sh +50 -0
  26. idftool-0.5.0/test/project/main/CMakeLists.txt +1 -0
  27. idftool-0.5.0/test/project/main/idf_component.yml +5 -0
  28. idftool-0.5.0/test/project/main/main.c +13 -0
  29. idftool-0.5.0/test/project/nvs.csv +6 -0
  30. idftool-0.5.0/test/project/partitions.csv +11 -0
  31. idftool-0.5.0/test/project/sdkconfig.defaults +4 -0
  32. idftool-0.5.0/test/samples/bootloader-template.csv +7 -0
  33. idftool-0.5.0/test/samples/nvs.csv +5 -0
  34. idftool-0.5.0/test/samples/partitions.csv +9 -0
  35. idftool-0.5.0/test/test_device.py +143 -0
  36. idftool-0.5.0/test/test_offline.py +100 -0
  37. idftool-0.2.2/CHANGELOG.md +0 -48
  38. idftool-0.2.2/Makefile +0 -39
  39. idftool-0.2.2/idftool/__main__.py +0 -1141
  40. idftool-0.2.2/idftool.egg-info/SOURCES.txt +0 -21
  41. {idftool-0.2.2 → idftool-0.5.0}/.github/workflows/build.yml +0 -0
  42. {idftool-0.2.2 → idftool-0.5.0}/.github/workflows/publish.yml +0 -0
  43. {idftool-0.2.2 → idftool-0.5.0}/.gitignore +0 -0
  44. {idftool-0.2.2 → idftool-0.5.0}/CONTRIBUTING.md +0 -0
  45. {idftool-0.2.2 → idftool-0.5.0}/LICENSE.md +0 -0
  46. {idftool-0.2.2 → idftool-0.5.0}/idftool/__init__.py +0 -0
  47. {idftool-0.2.2 → idftool-0.5.0}/idftool/traceback.py +0 -0
  48. {idftool-0.2.2 → idftool-0.5.0}/idftool-onedir.spec +0 -0
  49. {idftool-0.2.2 → idftool-0.5.0}/idftool.egg-info/dependency_links.txt +0 -0
  50. {idftool-0.2.2 → idftool-0.5.0}/idftool.egg-info/entry_points.txt +0 -0
  51. {idftool-0.2.2 → idftool-0.5.0}/idftool.egg-info/top_level.txt +0 -0
  52. {idftool-0.2.2 → idftool-0.5.0}/idftool.py +0 -0
  53. {idftool-0.2.2 → idftool-0.5.0}/idftool.spec +0 -0
  54. {idftool-0.2.2 → idftool-0.5.0}/setup.cfg +0 -0
@@ -0,0 +1,118 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is
4
+ based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
5
+ this project adheres to [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [v0.5.0] — 2026-07-17
8
+
9
+ ### Changed
10
+ - The CLI is rebuilt on [click](https://click.palletsprojects.com/) and
11
+ [rich-click](https://github.com/ewels/rich-click) (like esptool): `--help`,
12
+ usage, and errors now render in boxed panels, and commands are grouped into
13
+ labelled sections. Command names, arguments, options, aliases (`reflash`,
14
+ `list`), and behaviour are unchanged — only the help/usage and error
15
+ formatting differ.
16
+
17
+ ### Added
18
+ - `create-table` as an alias for `convert-table`.
19
+ - `create-nvs` and `write-nvs` now accept a pre-built NVS binary image as
20
+ input (auto-detected), not only a CSV — it is validated against the
21
+ partition size and padded to it, instead of failing when parsed as CSV.
22
+ - A test suite: an offline suite (no hardware) plus a real-device suite that
23
+ cycles every command against a connected ESP, with fixtures built from a
24
+ small ESP-IDF app (`make test-offline` / `make test-device`).
25
+
26
+ ### Fixed
27
+ - `write-bundle` now reports a clear error when a bundle entry is larger than
28
+ its target partition, instead of crashing with an `AttributeError`.
29
+
30
+ ## [v0.3.0] — 2026-07-15
31
+
32
+ ### Added
33
+ - Partition table file commands that make the table itself the subject
34
+ (a positional file), keeping the global `--partition-table-file`
35
+ option for its existing role of overriding the layout of other
36
+ commands:
37
+ - `convert-table <in> <out>` — convert a partition table between CSV
38
+ and binary, offline. Format is auto-detected on input and inferred
39
+ from the output extension (`.csv`/`.bin`) or `--format`.
40
+ - `print-table [file]` — pretty-print a partition table from a CSV or
41
+ binary file (offline), or from the device when no file is given.
42
+ - `dump-table [output]` — read the partition table from the device and
43
+ save it as CSV or binary (default filename
44
+ `{chip}-{mac}-{timestamp}-partition-table.csv`).
45
+ - `write-table <file>` — flash a partition table from a CSV or binary
46
+ file to the device. Requires an explicit file (so it can never read
47
+ the device's current table and write it back to itself), verifies
48
+ the table before flashing (override with `--force`), and warns that
49
+ only the map is replaced — existing partition data is not moved or
50
+ erased.
51
+
52
+ ### Changed
53
+ - `list` is now an alias of `print-table` (both print the device's
54
+ partition table identically). Its `--partition-type`,
55
+ `--partition-subtype`, and `--partition-name` flags — which were never
56
+ implemented — have been removed.
57
+
58
+ ### Fixed
59
+ - Working with empty or truncated input files now reports a clear error
60
+ instead of a confusing parser failure (e.g. "Partition table is
61
+ missing an end-of-table marker" for a zero-byte image). Empty images,
62
+ app binaries, and bundle ZIPs are rejected up front, as are images too
63
+ small to reach the partition table offset and corrupt (non-ZIP)
64
+ bundles.
65
+ - A parsed-but-empty partition table (all-`0xFF` binary region,
66
+ comment-only CSV, etc.) is now rejected across all parse paths rather
67
+ than silently yielding a table with no partitions.
68
+ - Loading a partition table CSV that contains bootloader rows (such as one
69
+ produced by `dump-table`) no longer requires re-specifying
70
+ `--primary-bootloader-offset`: the offset embedded in the CSV is
71
+ recovered from the file, so dumped tables round-trip through
72
+ `print-table`, `convert-table`, `write-table`, and `--partition-table-file`
73
+ without extra arguments. The flag still works as an explicit override.
74
+
75
+ ## [v0.2.2] — 2026-06-15
76
+
77
+ ### Added
78
+ - `print-image` — inspect a flash image file offline: prints the
79
+ partition table and, for each app partition that contains a valid
80
+ app, the project name, version, IDF version, compile time, ELF
81
+ SHA256, and target chip.
82
+ - `print-bundle` — same output for a partition bundle ZIP, driven by
83
+ the embedded `partition_table.csv` and the per-partition `.bin`
84
+ entries.
85
+
86
+ ### Changed
87
+ - Bumped `esp-idf-defs` to `~=0.1.3`. `print_partition_table` now takes
88
+ a `(offset, length) -> bytes` accessor instead of an `ESPLoader`
89
+ instance, so the same printing path serves device, image, and bundle
90
+ inspection.
91
+
92
+ ## [v0.2.1] — 2026-06-10
93
+
94
+ ### Changed
95
+ - Boot partition state now uses `OtaImageState` for clearer reporting.
96
+
97
+ ## [v0.2.0] — 2026-05-26
98
+
99
+ ### Added
100
+ - `create-nvs` and `write-nvs` commands for generating NVS partition
101
+ images from CSV.
102
+ - Rich-style boxed traceback formatter for friendlier error output.
103
+
104
+ ### Documentation
105
+ - README installation section and command index table.
106
+ - Recommend `pipx` over the standalone binary for installation.
107
+
108
+ ## [v0.1.0] — 2026-05-25
109
+
110
+ ### Added
111
+ - Initial release.
112
+
113
+ [v0.5.0]: https://github.com/nebkat/idftool/releases/tag/v0.5.0
114
+ [v0.3.0]: https://github.com/nebkat/idftool/releases/tag/v0.3.0
115
+ [v0.2.2]: https://github.com/nebkat/idftool/releases/tag/v0.2.2
116
+ [v0.2.1]: https://github.com/nebkat/idftool/releases/tag/v0.2.1
117
+ [v0.2.0]: https://github.com/nebkat/idftool/releases/tag/v0.2.0
118
+ [v0.1.0]: https://github.com/nebkat/idftool/releases/tag/v0.1.0
idftool-0.5.0/Makefile ADDED
@@ -0,0 +1,62 @@
1
+ .PHONY: build build-onefile test test-offline test-device test-device-full install install-onefile uninstall clean
2
+
3
+ VENV := .venv
4
+ PYINSTALLER := $(VENV)/bin/pyinstaller
5
+ PREFIX := $(HOME)/.local
6
+ BINDIR := $(PREFIX)/bin
7
+ SHAREDIR := $(PREFIX)/share/idftool
8
+
9
+ # Device test config: `make test-device PORT=/dev/cu.usbmodem101 CHIP=esp32s3`
10
+ PORT :=
11
+ CHIP := esp32s3
12
+
13
+ build: $(VENV)
14
+ $(PYINSTALLER) --noconfirm --distpath ./dist-onedir --workpath ./build-onedir idftool-onedir.spec
15
+
16
+ build-onefile: $(VENV)
17
+ $(PYINSTALLER) --noconfirm --distpath ./dist --workpath ./build idftool.spec
18
+
19
+ test: build
20
+ ./dist-onedir/idftool/idftool --help >/dev/null
21
+
22
+ # Offline test suite (no hardware).
23
+ test-offline: $(VENV)
24
+ $(VENV)/bin/pip install -q -e ".[test]"
25
+ $(VENV)/bin/pytest test/test_offline.py
26
+
27
+ # Real-device test suite (fast core: the quick per-command tests). Requires a connected board and
28
+ # built fixtures (test/project/build_fixtures.sh). WILL ERASE THE DEVICE'S FLASH.
29
+ test-device: $(VENV)
30
+ @test -n "$(PORT)" || { echo "Usage: make test-device PORT=/dev/... [CHIP=$(CHIP)]"; exit 2; }
31
+ $(VENV)/bin/pip install -q -e ".[test]"
32
+ $(VENV)/bin/pytest test/test_device.py --port $(PORT) --chip $(CHIP) -m "not slow"
33
+
34
+ # Full device suite, including the slow full-flash dump-image / bundle round-trips. These move
35
+ # megabytes and take many minutes (a full 16 MB dump-image is ~25 min on USB-Serial-JTAG boards).
36
+ test-device-full: $(VENV)
37
+ @test -n "$(PORT)" || { echo "Usage: make test-device-full PORT=/dev/... [CHIP=$(CHIP)]"; exit 2; }
38
+ $(VENV)/bin/pip install -q -e ".[test]"
39
+ $(VENV)/bin/pytest test/test_device.py --port $(PORT) --chip $(CHIP)
40
+
41
+ install: build
42
+ mkdir -p $(BINDIR)
43
+ rm -rf $(SHAREDIR)
44
+ mkdir -p $(dir $(SHAREDIR))
45
+ cp -R dist-onedir/idftool $(SHAREDIR)
46
+ ln -sf $(SHAREDIR)/idftool $(BINDIR)/idftool
47
+
48
+ install-onefile: build-onefile
49
+ mkdir -p $(BINDIR)
50
+ cp dist/idftool $(BINDIR)/idftool
51
+
52
+ uninstall:
53
+ rm -f $(BINDIR)/idftool
54
+ rm -rf $(SHAREDIR)
55
+
56
+ clean:
57
+ rm -rf build build-onedir dist dist-onedir $(VENV)
58
+
59
+ $(VENV):
60
+ python3 -m venv $(VENV)
61
+ $(VENV)/bin/pip install --upgrade pip
62
+ $(VENV)/bin/pip install -e . pyinstaller
@@ -1,15 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: idftool
3
- Version: 0.2.2
3
+ Version: 0.5.0
4
4
  Summary: Utility for flashing, provisioning, and interacting with Espressif SOCs running ESP-IDF
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Source, https://github.com/nebkat/idftool
7
7
  Requires-Python: >=3.10
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE.md
10
+ Requires-Dist: click>=8.1
11
+ Requires-Dist: rich-click>=1.8
10
12
  Requires-Dist: esptool~=5.2.0
11
13
  Requires-Dist: esp-idf-defs~=0.1.3
12
14
  Requires-Dist: esp-idf-nvs-partition-gen~=0.2.0
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest>=8; extra == "test"
13
17
  Dynamic: license-file
14
18
 
15
19
  # idftool
@@ -103,7 +107,7 @@ Setting boot partition to 'ota_1'...
103
107
  |---------|-------------|
104
108
  | **Discovery** | |
105
109
  | [`devices`](#devices) | List serial ports with hardware IDs |
106
- | [`list`](#list) | Print the partition table |
110
+ | [`list`](#print-table) | Print the partition table (alias of `print-table`) |
107
111
  | **Partition I/O** | |
108
112
  | [`read`](#read) | Read a partition (or slice) into a file |
109
113
  | [`write`](#write) | Write one or more files to named partitions |
@@ -126,6 +130,11 @@ Setting boot partition to 'ota_1'...
126
130
  | [`dump-bundle`](#dump-bundle) | Pack every partition from the device into a ZIP |
127
131
  | [`write-bundle`](#write-bundle) | Flash every binary in a bundle ZIP |
128
132
  | [`print-bundle`](#print-bundle) | Print partition table and app info from a bundle ZIP |
133
+ | **Partition table** | |
134
+ | [`convert-table`](#convert-table) | Convert a partition table file between CSV and binary |
135
+ | [`print-table`](#print-table) | Print a partition table from a CSV or binary file, or the device |
136
+ | [`dump-table`](#dump-table) | Read the partition table from the device into a file |
137
+ | [`write-table`](#write-table) | Flash a partition table from a CSV or binary file |
129
138
  | **NVS** | |
130
139
  | [`create-nvs`](#create-nvs) | Generate an NVS partition image from a CSV file |
131
140
  | [`write-nvs`](#write-nvs) | Generate an NVS image from CSV and flash it |
@@ -141,17 +150,6 @@ hardware IDs.
141
150
  idftool devices
142
151
  ```
143
152
 
144
- #### `list`
145
- Print the device's partition table. With a connected ESP, idftool also
146
- reads the application descriptor of every app partition (project name,
147
- version) and marks the currently-active OTA slot with a trailing `*`. The
148
- selected otadata copy is shown next to the otadata partition's subtype
149
- (`ota (A)`, `ota (B)`, or `ota (invalid)` when otadata is erased).
150
- ```text
151
- idftool list
152
- idftool --partition-table-file partitions.csv list # offline
153
- ```
154
-
155
153
  ### Partition I/O
156
154
 
157
155
  #### `read`
@@ -312,6 +310,70 @@ version, IDF version, compile time, ELF SHA256, and target chip.
312
310
  idftool print-bundle release.zip
313
311
  ```
314
312
 
313
+ ### Partition table
314
+
315
+ These commands work directly on a partition table as a file — the table
316
+ is the subject, passed as a positional argument. This is distinct from the
317
+ global `--partition-table-file` option, which overrides the layout *other*
318
+ commands use to address partitions by name. Input format (CSV or binary)
319
+ is auto-detected; output format is inferred from the file extension
320
+ (`.csv`/`.bin`) or set with `--format`.
321
+
322
+ When the input is a CSV that includes a bootloader row, pass
323
+ `--primary-bootloader-offset` (an offset or a chip name, e.g. `esp32s3`)
324
+ so the offset can be resolved.
325
+
326
+ #### `convert-table`
327
+ Convert a partition table between CSV and binary, offline. Handles both
328
+ directions; the binary output includes the MD5 checksum and padding, so it
329
+ is ready to flash or embed in an image.
330
+ ```text
331
+ idftool convert-table partitions.csv partitions.bin
332
+ idftool convert-table partitions.bin partitions.csv
333
+ idftool --primary-bootloader-offset esp32s3 convert-table partitions.csv partitions.bin
334
+ ```
335
+
336
+ #### `print-table`
337
+ Pretty-print a partition table. Given a CSV or binary file it runs offline;
338
+ with no file it reads the table from the device (or from
339
+ `--partition-table-file`). With a connected ESP, idftool also reads the
340
+ application descriptor of every app partition (project name, version) and
341
+ marks the currently-active OTA slot with a trailing `*`; the selected otadata
342
+ copy is shown next to the otadata partition's subtype (`ota (A)`, `ota (B)`,
343
+ or `ota (invalid)` when otadata is erased).
344
+
345
+ Aliased as `list`.
346
+ ```text
347
+ idftool print-table partitions.bin # from a file, offline
348
+ idftool print-table # from the device
349
+ idftool list # same thing
350
+ idftool --partition-table-file partitions.csv print-table
351
+ ```
352
+
353
+ #### `dump-table`
354
+ Read the partition table from the connected device and save it. Defaults to
355
+ CSV with an auto-generated filename; pass an output file or `--format` to
356
+ choose otherwise.
357
+ ```text
358
+ idftool dump-table # auto-named .csv
359
+ idftool dump-table backup.bin
360
+ idftool dump-table backup.csv --format csv
361
+ ```
362
+
363
+ #### `write-table`
364
+ Flash a partition table from a CSV or binary file to the device. The file is
365
+ required, so this never reads the device's current table and writes it back
366
+ to itself — use `dump-table` to pull the current table. The table is verified
367
+ before flashing (override with `--force`).
368
+
369
+ Only the partition map (at the partition table offset) is replaced; existing
370
+ partition **data** on flash is not moved, resized, or erased, so a table that
371
+ no longer matches the flash contents can make the device unbootable.
372
+ ```text
373
+ idftool write-table partitions.csv
374
+ idftool write-table partitions.bin --force
375
+ ```
376
+
315
377
  ### NVS
316
378
 
317
379
  idftool can generate a binary NVS (Non-Volatile Storage) partition image
@@ -1,17 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: idftool
3
- Version: 0.2.2
4
- Summary: Utility for flashing, provisioning, and interacting with Espressif SOCs running ESP-IDF
5
- License-Expression: Apache-2.0
6
- Project-URL: Source, https://github.com/nebkat/idftool
7
- Requires-Python: >=3.10
8
- Description-Content-Type: text/markdown
9
- License-File: LICENSE.md
10
- Requires-Dist: esptool~=5.2.0
11
- Requires-Dist: esp-idf-defs~=0.1.3
12
- Requires-Dist: esp-idf-nvs-partition-gen~=0.2.0
13
- Dynamic: license-file
14
-
15
1
  # idftool
16
2
 
17
3
  A CLI tool built on top of [`esptool`](https://github.com/espressif/esptool)
@@ -103,7 +89,7 @@ Setting boot partition to 'ota_1'...
103
89
  |---------|-------------|
104
90
  | **Discovery** | |
105
91
  | [`devices`](#devices) | List serial ports with hardware IDs |
106
- | [`list`](#list) | Print the partition table |
92
+ | [`list`](#print-table) | Print the partition table (alias of `print-table`) |
107
93
  | **Partition I/O** | |
108
94
  | [`read`](#read) | Read a partition (or slice) into a file |
109
95
  | [`write`](#write) | Write one or more files to named partitions |
@@ -126,6 +112,11 @@ Setting boot partition to 'ota_1'...
126
112
  | [`dump-bundle`](#dump-bundle) | Pack every partition from the device into a ZIP |
127
113
  | [`write-bundle`](#write-bundle) | Flash every binary in a bundle ZIP |
128
114
  | [`print-bundle`](#print-bundle) | Print partition table and app info from a bundle ZIP |
115
+ | **Partition table** | |
116
+ | [`convert-table`](#convert-table) | Convert a partition table file between CSV and binary |
117
+ | [`print-table`](#print-table) | Print a partition table from a CSV or binary file, or the device |
118
+ | [`dump-table`](#dump-table) | Read the partition table from the device into a file |
119
+ | [`write-table`](#write-table) | Flash a partition table from a CSV or binary file |
129
120
  | **NVS** | |
130
121
  | [`create-nvs`](#create-nvs) | Generate an NVS partition image from a CSV file |
131
122
  | [`write-nvs`](#write-nvs) | Generate an NVS image from CSV and flash it |
@@ -141,17 +132,6 @@ hardware IDs.
141
132
  idftool devices
142
133
  ```
143
134
 
144
- #### `list`
145
- Print the device's partition table. With a connected ESP, idftool also
146
- reads the application descriptor of every app partition (project name,
147
- version) and marks the currently-active OTA slot with a trailing `*`. The
148
- selected otadata copy is shown next to the otadata partition's subtype
149
- (`ota (A)`, `ota (B)`, or `ota (invalid)` when otadata is erased).
150
- ```text
151
- idftool list
152
- idftool --partition-table-file partitions.csv list # offline
153
- ```
154
-
155
135
  ### Partition I/O
156
136
 
157
137
  #### `read`
@@ -312,6 +292,70 @@ version, IDF version, compile time, ELF SHA256, and target chip.
312
292
  idftool print-bundle release.zip
313
293
  ```
314
294
 
295
+ ### Partition table
296
+
297
+ These commands work directly on a partition table as a file — the table
298
+ is the subject, passed as a positional argument. This is distinct from the
299
+ global `--partition-table-file` option, which overrides the layout *other*
300
+ commands use to address partitions by name. Input format (CSV or binary)
301
+ is auto-detected; output format is inferred from the file extension
302
+ (`.csv`/`.bin`) or set with `--format`.
303
+
304
+ When the input is a CSV that includes a bootloader row, pass
305
+ `--primary-bootloader-offset` (an offset or a chip name, e.g. `esp32s3`)
306
+ so the offset can be resolved.
307
+
308
+ #### `convert-table`
309
+ Convert a partition table between CSV and binary, offline. Handles both
310
+ directions; the binary output includes the MD5 checksum and padding, so it
311
+ is ready to flash or embed in an image.
312
+ ```text
313
+ idftool convert-table partitions.csv partitions.bin
314
+ idftool convert-table partitions.bin partitions.csv
315
+ idftool --primary-bootloader-offset esp32s3 convert-table partitions.csv partitions.bin
316
+ ```
317
+
318
+ #### `print-table`
319
+ Pretty-print a partition table. Given a CSV or binary file it runs offline;
320
+ with no file it reads the table from the device (or from
321
+ `--partition-table-file`). With a connected ESP, idftool also reads the
322
+ application descriptor of every app partition (project name, version) and
323
+ marks the currently-active OTA slot with a trailing `*`; the selected otadata
324
+ copy is shown next to the otadata partition's subtype (`ota (A)`, `ota (B)`,
325
+ or `ota (invalid)` when otadata is erased).
326
+
327
+ Aliased as `list`.
328
+ ```text
329
+ idftool print-table partitions.bin # from a file, offline
330
+ idftool print-table # from the device
331
+ idftool list # same thing
332
+ idftool --partition-table-file partitions.csv print-table
333
+ ```
334
+
335
+ #### `dump-table`
336
+ Read the partition table from the connected device and save it. Defaults to
337
+ CSV with an auto-generated filename; pass an output file or `--format` to
338
+ choose otherwise.
339
+ ```text
340
+ idftool dump-table # auto-named .csv
341
+ idftool dump-table backup.bin
342
+ idftool dump-table backup.csv --format csv
343
+ ```
344
+
345
+ #### `write-table`
346
+ Flash a partition table from a CSV or binary file to the device. The file is
347
+ required, so this never reads the device's current table and writes it back
348
+ to itself — use `dump-table` to pull the current table. The table is verified
349
+ before flashing (override with `--force`).
350
+
351
+ Only the partition map (at the partition table offset) is replaced; existing
352
+ partition **data** on flash is not moved, resized, or erased, so a table that
353
+ no longer matches the flash contents can make the device unbootable.
354
+ ```text
355
+ idftool write-table partitions.csv
356
+ idftool write-table partitions.bin --force
357
+ ```
358
+
315
359
  ### NVS
316
360
 
317
361
  idftool can generate a binary NVS (Non-Volatile Storage) partition image