diff --git a/packages/embeddedci-mcp/CHANGELOG.md b/packages/embeddedci-mcp/CHANGELOG.md index 9fc7452..3c38c6a 100644 --- a/packages/embeddedci-mcp/CHANGELOG.md +++ b/packages/embeddedci-mcp/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog — `embeddedci-mcp` +## Unreleased + +For BenchPod firmware with the `prog_flash` feature; needs the matching embeddedci (the tool says so on an older SDK). + +- **`flash` takes the pin-programmer targets** `avr-updi`, `pic`, `efm8`, `attiny-tpi` and `xmega` + (`updi`, `c2`, `tpi` and `pdi` work too): the pod flashes AVR tinyAVR/megaAVR/DA/DB/DD, PIC16F1xxx, + PIC16F18xxx and PIC18F Q-series, Silicon Labs EFM8 and C8051F, ATtiny4/5/9/10/20/40/102/104 and + XMEGA chips over their own programming pins from a `.hex`, `.elf` or `.bin`. New arguments: `device` + (name the chip; omitted, its ID decides), `clk`, `data` and `reset_pin` (LA pins or wiring names; default + a profile signal named for the protocol, else `swd_swclk` / `swd_swdio`), `erase` (`chip`, `page`, + `none`) and `dry_run` (only read the chip's ID: a wiring test). A failure is `ok=false` with + what to check in `stderr_tail`. The server instructions describe the flow. The ATtiny4/5/9/10/20/40 + need 5 V, which the pod cannot give. + ## 4.0.4 For BenchPod firmware with the `jtag` feature; JTAG flashing needs embeddedci 4.0.4 (the tool says so on an older SDK). diff --git a/packages/embeddedci-mcp/README.md b/packages/embeddedci-mcp/README.md index aec4c1c..5cad792 100644 --- a/packages/embeddedci-mcp/README.md +++ b/packages/embeddedci-mcp/README.md @@ -233,7 +233,7 @@ description, ranges and enums, so an agent sees more than this table. | Tool | Purpose | Parameters | | --- | --- | --- | -| `flash` | Program the DUT over SWD or JTAG through the pod's CMSIS-DAP probe (JTAG is picked when the wiring has `jtag_tck`, `jtag_tms`, `jtag_tdi` and `jtag_tdo` and there are no SWD pins, or the target is JTAG only: `esp32`, `esp32s2`, `gd32vf103`, `fe310`, `k210`, `riscv*`; the wiring profile's `debug_port` (`swd` or `jtag`) picks for a board wired for both, and JTAG or SWD pins passed in the call beat it; needs the pod's `jtag` feature): a local `file` (OpenOCD runs next to the server), or a build uploaded to embeddedci.com (`build` id or `latest`, `repo`, `ref`; embeddedci.com runs OpenOCD on a cloud connection, LAN/USB downloads it). With `target` `esp32` (or `esp32s3`, `esp32c3`, ...) the pod flashes an ESP32-family target over its UART ROM bootloader instead: `file` is a `.bin` or an ESP-IDF `flasher_args.json`, TXD0/RXD0 on `rx`/`tx` (default: the profile's `uart_rx`/`uart_tx`), IO0 on `boot`, EN on the pod's reset pin (`nreset`), a `.bin` at `load_address`. | `swclk`, `swdio`, `tck`, `tms`, `tdi`, `tdo`, `trst`, `target`, `file`, `nreset`, `load_address`, `target_power`, `verify=true`, `reset=true`, `connect_under_reset`, `extra_configs`, `extra_args`, `timeout_s=300`, `connect_attempts=5`, `build`, `repo`, `ref`, `artifact`, `server_side`, `rx`, `tx`, `boot` | +| `flash` | Program the DUT over SWD or JTAG through the pod's CMSIS-DAP probe (JTAG is picked when the wiring has `jtag_tck`, `jtag_tms`, `jtag_tdi` and `jtag_tdo` and there are no SWD pins, or the target is JTAG only: `esp32`, `esp32s2`, `gd32vf103`, `fe310`, `k210`, `riscv*`; the wiring profile's `debug_port` (`swd` or `jtag`) picks for a board wired for both, and JTAG or SWD pins passed in the call beat it; needs the pod's `jtag` feature): a local `file` (OpenOCD runs next to the server), or a build uploaded to embeddedci.com (`build` id or `latest`, `repo`, `ref`; embeddedci.com runs OpenOCD on a cloud connection, LAN/USB downloads it). With `target` `esp32` (or `esp32s3`, `esp32c3`, ...) the pod flashes an ESP32-family target over its UART ROM bootloader instead: `file` is a `.bin` or an ESP-IDF `flasher_args.json`, TXD0/RXD0 on `rx`/`tx` (default: the profile's `uart_rx`/`uart_tx`), IO0 on `boot`, EN on the pod's reset pin (`nreset`), a `.bin` at `load_address`. With `target` `avr-updi` (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD), `pic` (PIC16F1xxx, PIC16F18xxx, PIC18F Q), `efm8` (Silicon Labs EFM8, C8051F), `attiny-tpi` (ATtiny4/5/9/10/20/40/102/104) or `xmega` (also `updi`, `c2`, `tpi`, `pdi`) the pod flashes a chip over its own programming pins (pod firmware with `prog_flash`, the `xip_prog` blob installed): `file` is a `.hex`, `.elf` or `.bin`, the chip is identified by its ID and the image cut into its memories (flash, EEPROM, fuses, user row), `device` names the chip to check, pins come from `clk`, `data`, `reset_pin` or wiring signals named for the protocol (else `swd_swclk`/`swd_swdio`; the reset of `pic` and `attiny-tpi` is the pod's reset pin), `erase` is `chip` (default), `page` or `none`, `dry_run` only reads the chip's ID. The ATtiny4/5/9/10/20/40 need 5 V, which the pod cannot give. | `swclk`, `swdio`, `tck`, `tms`, `tdi`, `tdo`, `trst`, `target`, `file`, `nreset`, `load_address`, `target_power`, `verify=true`, `reset=true`, `connect_under_reset`, `extra_configs`, `extra_args`, `timeout_s=300`, `connect_attempts=5`, `build`, `repo`, `ref`, `artifact`, `server_side`, `rx`, `tx`, `boot`, `device`, `clk`, `data`, `reset_pin`, `erase=chip`, `dry_run=false` | | `usb_flash` | Flash the board on the pod's USB host port, the way a computer would (pod firmware 4.0.3+, LAN or cloud). The loader comes from the file and the board that mounted: a UF2 or drag-and-drop drive (Pico, Adafruit, DAPLink), DFU or the STM32 ROM loader, Teensy, Arduino AVR and SAMD, ESP32; `reason` in the result says why. `.hex` and `.dfu` files are converted to a binary with their address. A Pico (RP2040, RP2350) in BOOTSEL gets a `.bin` or `.hex` through PICOBOOT (every page read back); `verify` reads a drive back (`FAIL.TXT`, `CURRENT.UF2`) and the result's `note` says what it found. A drive flash sets the file's date from this computer's clock. Starts host mode when it is off. | **`file`**, `address`, `name`, `leave=true`, `mode`, `port`, `timeout_s`, `verify=false` | | `usb_check` | Check the board's own USB firmware on the pod's host port (pod firmware 4.0.3+, LAN or cloud): `enumerate` (power-on to pull-up, descriptor and mounted over `count` power cycles), `power` (current against `bMaxPower`), `suspend` (suspended current against 2.5 mA, resume, still answers), `reset` (port resets and the time to enumerate again), `replug` (VBUS dropouts of `off_ms`). The board's VBUS must come from the internal 5 V (efuse 1) rail, switched on (`power_on`). Returns when the check ends: `passed` is the verdict, `result` the numbers (uA, ms); a failing board is a normal result. Starts host mode when it is off. | **`test`**, `count`, `off_ms`, `timeout_ms`, `duration_ms`, `settle_ms`, `port`, `timeout_s` | | `usb_hid` | The HID interfaces of the board on the pod's host port and its input reports (keyboard keys, mouse, gamepad; pod firmware 4.0.3+, `usb_host` first): `list` the interfaces with their report descriptors, `start` a capture into a ring of 64 on the pod, `read` reports from it, `stop` it. The capture ends when the board detaches or host mode ends. | `action=list`, `count=1`, `timeout_s=2`, `instance` | diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py b/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py index f0eff7a..9348770 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py @@ -22,6 +22,7 @@ Typical flows: - Flash and boot: flash(file) then power_cycle_and_capture(until_regex) — with a wiring profile that is all; otherwise pass swclk, swdio, target, nreset and rx, tx. +- Flash a chip over its own programming pins (firmware with `prog_flash`, no SWD or bootloader needed): flash(target='avr-updi' | 'pic' | 'efm8' | 'attiny-tpi' | 'xmega', file=.hex/.elf/.bin). The pod runs UPDI (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD), PIC ICSP (PIC16F1xxx, PIC16F18xxx, PIC18F Q), C2 (Silicon Labs EFM8, C8051F), TPI (ATtiny4/5/9/10/20/40/102/104) or PDI (XMEGA) itself and the SDK splits the image into the chip's memories (flash, EEPROM, fuses, user row). Pins: a wiring-profile signal named for the protocol (UPDI, ICSPCLK/ICSPDAT, C2CK/C2D, TPICLK/TPIDATA, PDI_CLK/PDI_DATA, MCLR) or swd_swclk/swd_swdio, or pass clk, data, reset_pin; pic and attiny-tpi use the pod's reset pin (nreset). Run flash(..., dry_run=true) first: it only reads the chip's ID. erase is 'chip' by default (unlocks a locked chip, erases it); device names the chip when you want the check. ATtiny4/5/9/10/20/40 need 5 V, which the pod cannot give. A failure says what to check; the xip_prog blob (`benchpod install-blobs`) must be installed. - SPI flash (a 25-series chip on four LA pins, wiring spi_sclk/spi_mosi/spi_miso/spi_cs): spi_flash_info to see it answers, then spi_flash_program(file, addr); hold_reset=true keeps the DUT off the bus. spi_transfer talks to any other SPI device. - Flash over USB (firmware 4.0.3+, LAN or cloud, not connection 'usb'): the pod hosts the board's USB port (digital v3r4: its USB-A port; older pods: USB-C through a breakout). usb_host reads or starts host mode and reports the device that enumerated; usb_flash(file) starts host mode itself and picks the loader from the file and the board: UF2 or drag-and-drop drive (Pico, Adafruit, DAPLink), DFU and the STM32 ROM loader, Teensy, Arduino AVR and SAMD, ESP32 (`reason` says why; .hex and .dfu files are converted). There is no mode to choose; the board must already be in its bootloader where it needs a button (Pico BOOTSEL, STM32 BOOT0, Teensy). connected=false in usb_host means no D+/D- link; line_speed 'low' means D+/D- are swapped. A Pico in BOOTSEL gets a .bin or .hex through PICOBOOT (every page read back); verify=true reads a drive back (FAIL.TXT, CURRENT.UF2). The board's serial port is a UART like any other: uart_open(port='usb') or capture_uart(port='usb') (baud, dtr, rts; no pins) reads its boot log over the cable it was flashed through. usb_check(test) measures the board's own USB firmware with its VBUS on the internal 5 V (efuse 1) rail (power_on first): enumerate, power, suspend, reset, replug; passed false is a result. usb_hid(action) lists the board's HID interfaces and catches its input reports: list, start, read, stop. - I2C master (gateware v55+): set_pull(la=[sda, scl], pull="up"), i2c_open, then i2c_transfer(addr, write_hex, read) or i2c_scan; i2c_close. capture_la(send={...}) runs one I2C, SPI or gpio transaction right after the capture arms and triggers on it. la_dir marks DUT outputs so the pod never drives against them; connect and set_wiring send the wiring profile's directions, so this is on by default. diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py index c48fbb6..5b48e96 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py @@ -344,6 +344,14 @@ def _is_esp_target(target: str) -> bool: return bool(re.fullmatch(r"esp32(-?(s2|s3|c2|c3|c5|c6|h2|p4))?", str(target).strip().lower())) +#: ``flash(target=...)`` names for chips with their own programming pins (the SDK's prog.TARGETS). +_PROG_TARGETS = frozenset({"avr-updi", "updi", "pic", "efm8", "c2", "attiny-tpi", "tpi", "xmega", "pdi"}) + + +def _is_prog_target(target: str) -> bool: + return str(target).strip().lower() in _PROG_TARGETS + + def _channel(pod: Any, value: Any, key: str) -> int: """Like :func:`_la`, but an omitted channel comes from the profile's ``key`` role.""" if value is not None: @@ -1089,11 +1097,16 @@ async def flash( target: Annotated[str, Field(description=( "OpenOCD target config, e.g. target/stm32f4x.cfg; omit for the profile's swd_target. " "'esp32' (or esp32s3, esp32c3, ...) flashes an ESP32-family target over its UART ROM " - "bootloader instead of SWD."))] = "", + "bootloader instead of SWD. 'avr-updi' (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD), 'pic' " + "(PIC16F1xxx, PIC16F18xxx, PIC18F Q), 'efm8' (Silicon Labs EFM8, C8051F), 'attiny-tpi' " + "(ATtiny4/5/9/10/20/40/102/104) and 'xmega' flash a chip over its own programming pins " + "instead (updi, pic, c2, tpi and pdi work too)."))] = "", file: Annotated[str, Field(description=( "Firmware image path on the machine running this server. Leave empty to flash an uploaded " "build instead (build/repo/ref/artifact). For an ESP32: a .bin written at 0 (esptool " - "merge_bin) or an ESP-IDF build/flasher_args.json."))] = "", + "merge_bin) or an ESP-IDF build/flasher_args.json. For avr-updi, pic, efm8, attiny-tpi and " + "xmega: a .hex, .elf or .bin (a .bin goes at load_address into the flash). Empty is fine " + "with dry_run."))] = "", nreset: Annotated[Optional[bool], Field(description=( "The target's reset line is wired to the pod's reset pin: enables connect-under-reset. " "Omit for the profile's swd_nreset."))] = None, @@ -1129,6 +1142,27 @@ async def flash( boot: Annotated[Optional[LaRef], Field(description=( "ESP32 only: LA channel (or wiring name) wired to the target's IO0 (IO9 on the C3/C6); " "omit for a profile signal named BOOT, IO0 or IO9."))] = None, + device: Annotated[str, Field(description=( + "avr-updi, pic, efm8, attiny-tpi, xmega: the chip, e.g. 'ATtiny1616' or 'PIC16F18446'. " + "Omit: the chip's ID identifies it. Given, the ID must match."))] = "", + clk: Annotated[Optional[LaRef], Field(description=( + "pic, efm8, attiny-tpi, xmega: LA channel (or wiring name) wired to the chip's clock " + "(ICSPCLK, C2CK, TPICLK, PDI_CLK); omit for a profile signal of that name, else swd_swclk."))] = None, + data: Annotated[Optional[LaRef], Field(description=( + "avr-updi, pic, efm8, attiny-tpi, xmega: LA channel (or wiring name) wired to the chip's " + "data pin (UPDI, ICSPDAT, C2D, TPIDATA, PDI_DATA); omit for a profile signal of that name, " + "else swd_swdio."))] = None, + reset_pin: Annotated[Optional[LaRef], Field(description=( + "pic and attiny-tpi: LA channel (or wiring name) wired to the chip's reset (MCLR, RESET), " + "driven open drain; omit for the pod's reset pin (nreset) or a profile signal named MCLR " + "or RESET."))] = None, + erase: Annotated[Literal["chip", "page", "none"], Field(description=( + "avr-updi, pic, efm8, attiny-tpi, xmega: 'chip' (default, before the first write when the " + "image has flash; also unlocks a locked chip), 'page' (only the pages written; TPI chips " + "erase their whole code section) or 'none'."))] = "chip", + dry_run: Annotated[bool, Field(description=( + "avr-updi, pic, efm8, attiny-tpi, xmega: only enter programming mode and read the chip's " + "ID (a wiring test): stdout_tail names the chip, nothing is written."))] = False, ctx: Context = None, # type: ignore[assignment] ) -> m.FlashResult: """Program the DUT over SWD or JTAG through the pod's CMSIS-DAP probe. @@ -1152,6 +1186,21 @@ async def flash( (`nreset`); `file` is a .bin written at `load_address` (default 0) or an ESP-IDF flasher_args.json. No OpenOCD or esptool needed; works over the cloud too. stdout_tail names the chip and each region written; `reset` false leaves the target in its loader. + + A chip with its own programming pins and no SWD, JTAG or bootloader is flashed by the pod: + target 'avr-updi' (AVR tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD, one pin), 'pic' (PIC16F1xxx, + PIC16F18xxx, PIC18F Q-series, low-voltage entry), 'efm8' (Silicon Labs EFM8 and C8051F, C2), + 'attiny-tpi' (ATtiny4/5/9/10/20/40/102/104) or 'xmega' (XMEGA, PDI). `file` is a .hex, .elf or + .bin; the tool reads the chip's ID, finds it in its device table, cuts the image into the + chip's memories (flash, EEPROM, fuses or configuration words, user row or user ID) at their + usual hex addresses and writes and reads back each page. Pins come from `clk`, `data` and + `reset_pin`, else from wiring-profile signals named for the protocol (ICSPCLK, C2CK, UPDI, ...), + else the profile's swd_swclk and swd_swdio; pic and attiny-tpi also use the pod's reset pin + (`nreset`, the default) for MCLR or RESET. `erase` is 'chip' by default; `dry_run` only reads + the chip's ID (check the wiring first). ATtiny4/5/9/10/20/40 need 5 V, which the pod's 1.8 and + 3.3 V I/O cannot give: the call fails before anything is written. A failure is ok=false with + stderr_tail saying what to check (wiring, power, locked chip: erase 'chip' unlocks it). Needs + firmware with the `prog_flash` feature and the xip_prog blob (`benchpod install-blobs`). """ from_build = {k: v for k, v in (("build", build), ("repo", repo), ("ref", ref), ("artifact", artifact)) if v} @@ -1160,6 +1209,23 @@ async def flash( def op() -> m.FlashResult: pod = SESSION.require() + if _is_prog_target(target): + if from_build: + raise ValueError(f"{target} is flashed from a file (a .hex, .elf or .bin), not an " + "uploaded build") + if "dry_run" not in inspect.signature(type(pod).flash).parameters: + raise ValueError(f"flashing with target {target} needs a newer embeddedci SDK; " + "upgrade embeddedci") + r = pod.flash(target=target, file=file, load_address=load_address, nreset=nreset, + reset=reset, check=False, target_power=target_power, device=device, + clk=None if clk is None else _la(pod, clk), + data=None if data is None else _la(pod, data), + reset_pin=None if reset_pin is None else _la(pod, reset_pin), + erase=erase, dry_run=dry_run) + return m.FlashResult(ok=r.ok, returncode=r.returncode, + target_unreachable=r.target_unreachable, stalled=False, + stdout_tail=clip(r.stdout, 4000)[-4000:], + stderr_tail=clip(r.stderr, 4000)[-4000:]) if _is_esp_target(target or pod.wiring.swd_target): if from_build: raise ValueError("an ESP32 target is flashed from a file (a .bin or " diff --git a/packages/embeddedci-mcp/tests/test_tools.py b/packages/embeddedci-mcp/tests/test_tools.py index 4ea7982..086e2ff 100644 --- a/packages/embeddedci-mcp/tests/test_tools.py +++ b/packages/embeddedci-mcp/tests/test_tools.py @@ -399,6 +399,62 @@ def fake_flash(**kwargs): assert result["ok"] is True and "ESP32-S3" in result["stdout_tail"] +@pytest.mark.skipif("dry_run" not in inspect.signature(BenchPod.flash).parameters, + reason="needs embeddedci with the pin-programmer flash targets") +@pytest.mark.parametrize("target", ["avr-updi", "pic", "efm8", "attiny-tpi", "xmega", "updi", "c2", "tpi", "pdi"]) +def test_flash_a_pin_programmer_target(connected, monkeypatch, target): + seen = {} + + def fake_flash(**kwargs): + seen.update(kwargs) + return FlashResult(ok=True, returncode=0, stdout="ATtiny1616 (AVR UPDI), ID 1e9421\nflash at 0x0: 128 bytes", + stderr="") + + monkeypatch.setattr(SESSION.require(), "flash", fake_flash) + result = call("flash", target=target, file="build/app.hex", device="ATtiny1616", clk=3, data=4, + reset_pin=5, erase="page", reset=False, dry_run=True, target_power=1) + assert seen["target"] == target and seen["file"] == "build/app.hex" + assert (seen["device"], seen["clk"], seen["data"], seen["reset_pin"]) == ("ATtiny1616", 3, 4, 5) + assert seen["erase"] == "page" and seen["dry_run"] is True and seen["reset"] is False + assert seen["check"] is False and seen["target_power"] == 1 + assert "swclk" not in seen and "build" not in seen and "tck" not in seen + assert result["ok"] is True and "ATtiny1616" in result["stdout_tail"] + + +@pytest.mark.skipif("dry_run" not in inspect.signature(BenchPod.flash).parameters, + reason="needs embeddedci with the pin-programmer flash targets") +def test_pin_programmer_defaults_and_failures(connected, monkeypatch): + seen = {} + + def fake_flash(**kwargs): + seen.update(kwargs) + return FlashResult(ok=False, returncode=1, stdout="", target_unreachable=True, + stderr="avr-updi flash failed: no answer\nthe chip did not answer. Check the wiring") + + monkeypatch.setattr(SESSION.require(), "flash", fake_flash) + result = call("flash", target="avr-updi", file="app.hex") + assert seen["clk"] is None and seen["data"] is None and seen["reset_pin"] is None + assert seen["erase"] == "chip" and seen["dry_run"] is False and seen["device"] == "" + assert result["ok"] is False and result["target_unreachable"] is True + assert "Check the wiring" in result["stderr_tail"] + + +def test_pin_programmer_target_names_match_the_sdk(): + from embeddedci_mcp import server + try: + from embeddedci.benchpod import prog + except ImportError: + pytest.skip("needs embeddedci with the pin-programmer flash targets") + assert server._PROG_TARGETS == frozenset(prog.TARGETS) + + +def test_pin_programmer_refuses_a_build(connected): + if "dry_run" not in inspect.signature(BenchPod.flash).parameters: + pytest.skip("needs embeddedci with the pin-programmer flash targets") + with pytest.raises(Exception, match="not an uploaded build"): + call("flash", target="avr-updi", build="latest") + + # -- USB host mode and USB flashing ------------------------------------------------------ _USB_IFACE = {"number": 0, "alt": 0, "class": 8, "class_name": "msc", "subclass": 6, "protocol": 80, diff --git a/packages/embeddedci-mcp/tests/tools_surface.json b/packages/embeddedci-mcp/tests/tools_surface.json index a59995b..b4fe917 100644 --- a/packages/embeddedci-mcp/tests/tools_surface.json +++ b/packages/embeddedci-mcp/tests/tools_surface.json @@ -2553,6 +2553,29 @@ "title": "Build", "type": "string" }, + "clk": { + "anyOf": [ + { + "anyOf": [ + { + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "LA channel 1-14, or a name from the wiring profile \u2014 a signal ('READY') or a role ('uart_rx', 'i2c_sda', 'swd_swclk'). Call `wiring` to see the names. The gpio_* tools also take expander pins ('EXT1') once one is attached (expansion)." + }, + { + "type": "null" + } + ], + "default": null, + "description": "pic, efm8, attiny-tpi, xmega: LA channel (or wiring name) wired to the chip's clock (ICSPCLK, C2CK, TPICLK, PDI_CLK); omit for a profile signal of that name, else swd_swclk.", + "title": "Clk" + }, "connect_attempts": { "default": 5, "maximum": 20, @@ -2572,6 +2595,52 @@ "default": null, "title": "Connect Under Reset" }, + "data": { + "anyOf": [ + { + "anyOf": [ + { + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "LA channel 1-14, or a name from the wiring profile \u2014 a signal ('READY') or a role ('uart_rx', 'i2c_sda', 'swd_swclk'). Call `wiring` to see the names. The gpio_* tools also take expander pins ('EXT1') once one is attached (expansion)." + }, + { + "type": "null" + } + ], + "default": null, + "description": "avr-updi, pic, efm8, attiny-tpi, xmega: LA channel (or wiring name) wired to the chip's data pin (UPDI, ICSPDAT, C2D, TPIDATA, PDI_DATA); omit for a profile signal of that name, else swd_swdio.", + "title": "Data" + }, + "device": { + "default": "", + "description": "avr-updi, pic, efm8, attiny-tpi, xmega: the chip, e.g. 'ATtiny1616' or 'PIC16F18446'. Omit: the chip's ID identifies it. Given, the ID must match.", + "title": "Device", + "type": "string" + }, + "dry_run": { + "default": false, + "description": "avr-updi, pic, efm8, attiny-tpi, xmega: only enter programming mode and read the chip's ID (a wiring test): stdout_tail names the chip, nothing is written.", + "title": "Dry Run", + "type": "boolean" + }, + "erase": { + "default": "chip", + "description": "avr-updi, pic, efm8, attiny-tpi, xmega: 'chip' (default, before the first write when the image has flash; also unlocks a locked chip), 'page' (only the pages written; TPI chips erase their whole code section) or 'none'.", + "enum": [ + "chip", + "page", + "none" + ], + "title": "Erase", + "type": "string" + }, "extra_args": { "anyOf": [ { @@ -2604,7 +2673,7 @@ }, "file": { "default": "", - "description": "Firmware image path on the machine running this server. Leave empty to flash an uploaded build instead (build/repo/ref/artifact). For an ESP32: a .bin written at 0 (esptool merge_bin) or an ESP-IDF build/flasher_args.json.", + "description": "Firmware image path on the machine running this server. Leave empty to flash an uploaded build instead (build/repo/ref/artifact). For an ESP32: a .bin written at 0 (esptool merge_bin) or an ESP-IDF build/flasher_args.json. For avr-updi, pic, efm8, attiny-tpi and xmega: a .hex, .elf or .bin (a .bin goes at load_address into the flash). Empty is fine with dry_run.", "title": "File", "type": "string" }, @@ -2644,6 +2713,29 @@ "title": "Reset", "type": "boolean" }, + "reset_pin": { + "anyOf": [ + { + "anyOf": [ + { + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "LA channel 1-14, or a name from the wiring profile \u2014 a signal ('READY') or a role ('uart_rx', 'i2c_sda', 'swd_swclk'). Call `wiring` to see the names. The gpio_* tools also take expander pins ('EXT1') once one is attached (expansion)." + }, + { + "type": "null" + } + ], + "default": null, + "description": "pic and attiny-tpi: LA channel (or wiring name) wired to the chip's reset (MCLR, RESET), driven open drain; omit for the pod's reset pin (nreset) or a profile signal named MCLR or RESET.", + "title": "Reset Pin" + }, "rx": { "anyOf": [ { @@ -2728,7 +2820,7 @@ }, "target": { "default": "", - "description": "OpenOCD target config, e.g. target/stm32f4x.cfg; omit for the profile's swd_target. 'esp32' (or esp32s3, esp32c3, ...) flashes an ESP32-family target over its UART ROM bootloader instead of SWD.", + "description": "OpenOCD target config, e.g. target/stm32f4x.cfg; omit for the profile's swd_target. 'esp32' (or esp32s3, esp32c3, ...) flashes an ESP32-family target over its UART ROM bootloader instead of SWD. 'avr-updi' (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD), 'pic' (PIC16F1xxx, PIC16F18xxx, PIC18F Q), 'efm8' (Silicon Labs EFM8, C8051F), 'attiny-tpi' (ATtiny4/5/9/10/20/40/102/104) and 'xmega' flash a chip over its own programming pins instead (updi, pic, c2, tpi and pdi work too).", "title": "Target", "type": "string" }, diff --git a/packages/embeddedci/CHANGELOG.md b/packages/embeddedci/CHANGELOG.md index 8943518..c0253d4 100644 --- a/packages/embeddedci/CHANGELOG.md +++ b/packages/embeddedci/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog — `embeddedci` +## Unreleased + +For BenchPod firmware with the `prog_flash` feature (features table revision 17). + +- **Flash chips over their own programming pins.** `bp.flash(target=..., file=...)` now takes + `avr-updi` (AVR tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD), `pic` (PIC16F1xxx, PIC16F18xxx, PIC18F + Q-series), `efm8` (Silicon Labs EFM8 and C8051F), `attiny-tpi` (ATtiny4/5/9/10/20/40/102/104) and + `xmega`; the protocol names `updi`, `pic`, `c2`, `tpi` and `pdi` are accepted too. The pod runs the + protocol itself: the SDK reads the chip's ID, finds it in the new device table + (`embeddedci/benchpod/prog_devices.json`, documented in `prog_devices.README.md`), cuts a `.hex`, + `.elf` or `.bin` into the chip's memories (flash, EEPROM, fuses or configuration words, user row or + user ID), writes them one after the other and reads every page back. +- New `flash()` arguments for these targets: `device` (check against a named chip), `clk`, `data` and + `reset_pin` (LA pins; default a wiring-profile signal named for the protocol, else `swd_swclk` / + `swd_swdio`; the reset of `pic` and `attiny-tpi` is the pod's reset pin unless `reset_pin` or an `MCLR` / + `RESET` signal says otherwise), `erase` (`"chip"` by default, `"page"`, `"none"`) and `dry_run` + (enter programming mode and read the chip's ID, write nothing). `reset` lets the chip start its + program afterwards. No wiring-profile fields were added. +- New errors, all `FlashError`s: `ProgFlashError` (with `result`, `phase`, `mem`, `addr`, `at_addr`) and + its subclasses `ProgNoAnswerError` (also a `TargetUnreachableError`), `ProgLockedError`, + `ProgVerifyError` and `ProgDeviceError` (chip not in the table, not the `device` named, image does + not fit, voltage). Each message says what to check. The ATtiny4/5/9/10/20/40 program at 5 V only, + which the pod cannot give: they fail with `ProgDeviceError` before anything is written. +- `supports("prog_flash")` works; a pod without it raises `UnsupportedFeatureError`. The pin + programmers run from the pod's `xip_prog` blob, installed with the other blobs (`benchpod + install-blobs`); without it the pod refuses with `XipUnavailableError`. +- The bundled feature table is revision 17. + ## 4.0.4 For BenchPod firmware with the `jtag` feature (features table revision 16, gateware v61 or later). diff --git a/packages/embeddedci/README.md b/packages/embeddedci/README.md index c107382..053e7b7 100644 --- a/packages/embeddedci/README.md +++ b/packages/embeddedci/README.md @@ -1069,6 +1069,70 @@ bp.flash(target="esp32c3", file="build/app.bin", load_address="0x10000", boot=6, check power, the TX/RX crossing, the boot pin and EN); `check=False` returns the result. * Works over the LAN, USB and the cloud. Needs pod firmware with the `esp_flash` command. +### Flashing a chip over its own programming pins (UPDI, PIC, C2, TPI, PDI) + +Some chips have neither SWD, JTAG nor a bootloader: they are programmed over a one- or two-wire +protocol of their own. The pod runs that protocol itself, so there is no programmer, no OpenOCD and +no USB cable to the chip. It is the same `flash()` call, with one of these `target` names: + +| `target` | Also accepted | Chips | Wiring | +|---|---|---|---| +| `avr-updi` | `updi` | AVR tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD | UPDI on `data` | +| `pic` | | PIC16F1xxx, PIC16F18xxx, PIC18F Q-series (low-voltage entry) | ICSPCLK on `clk`, ICSPDAT on `data`, MCLR on the pod's reset pin or `reset_pin` | +| `efm8` | `c2` | Silicon Labs EFM8 and C8051F | C2CK on `clk`, C2D on `data` | +| `attiny-tpi` | `tpi` | ATtiny4/5/9/10/20/40/102/104 | TPICLK on `clk`, TPIDATA on `data`, RESET on the pod's reset pin or `reset_pin` | +| `xmega` | `pdi` | AVR XMEGA | PDI_CLK (the chip's RESET pin) on `clk`, PDI_DATA on `data` | + +```python +bp.flash(target="avr-updi", file="build/app.hex", dry_run=True) # wiring test: reads the chip's ID, writes nothing +bp.flash(target="avr-updi", file="build/app.hex") # data from the profile's swd_swdio +bp.flash(target="pic", file="build/app.hex", clk=3, data=4) # MCLR on the pod's reset pin +bp.flash(target="efm8", file="build/app.hex", device="EFM8BB10F8G", erase="page", reset=False) +``` + +* **The chip is found by its ID.** The SDK enters programming mode first and reads the chip's ID, + looks it up in its device table (`embeddedci/benchpod/prog_devices.json`, described in + `prog_devices.README.md` next to it: the chips, their memories and the hex-file address of each, + the protocol options and the voltage limits, every family with its datasheets) and cuts the image into the chip's memories. `device` + names the chip (`"ATtiny1616"`, `"PIC16F18446"`) when you want it checked: a different chip on + the board is an error before anything is erased, and so is a chip that is not in the table. +* **`file`** is a `.hex` (Intel HEX), an `.elf` (32-bit) or a `.bin` (written at `load_address` + into the flash, default 0). The regions use the toolchains' usual addresses: avr-gcc puts the + flash at 0, the EEPROM at 0x810000, the fuses at 0x820000 and the user row at 0x850000; XC8 puts the + PIC's configuration words, user ID and EEPROM where the table says. Flash comes first, EEPROM and user row next, the + configuration (fuses) last. A partial flash page is padded with 0xFF. Lock bits and signature + rows in the image are left out (the result says so); data that fits none of the chip's memories is + an error. +* **Pins.** `clk`, `data` and `reset_pin` are LA pins (`benchpod.PIN1`..`PIN14`, 1-14, or a profile + name); `avr-updi` takes `data` only. Omitted, a wiring-profile signal named for the protocol is + used (`UPDI`; `ICSPCLK`/`ICSPDAT` or `PGC`/`PGD`; `C2CK`/`C2D`; `TPICLK`/`TPIDATA`; + `PDI_CLK`/`PDI_DATA`; `MCLR` or `RESET` for the reset), else the profile's `swd_swclk` and `swd_swdio`. The reset of `pic` and `attiny-tpi` is + the pod's reset pin by default (`nreset=True`) or `reset_pin`. +* **`erase`** is `"chip"` (the default: erase the chip before the first write when the image has flash; this + also unlocks a locked chip and erases its EEPROM on some families), `"page"` (only the pages written; the TPI chips + can only erase their whole code section, once) or `"none"`. **`reset`** (default `True`) lets the + chip start its program afterwards; `False` keeps it in programming mode or reset. +* **`dry_run=True`** only enters programming mode and reads the ID: `FlashResult.stdout` names the chip. + Run it first on a new wiring. +* Every page written is read back and compared. `FlashResult.stdout` lists the chip and every + region written. +* **Voltage.** The pod's I/O is 1.8 or 3.3 V, the chip's supply. The ATtiny4/5/9/10/20/40 can be + programmed at 5 V only (4.75-5.5 V), which the pod cannot give: `flash()` raises + `ProgDeviceError` before anything is written. PIC bulk erase needs the supply above the chip's + brown-out level (about 2.7 V on most): `erase="chip"` at 1.8 V is refused for those chips. +* A failure raises `ProgFlashError` (a `FlashError`) with `result` (the pod's outcome), `phase`, + `mem`, `addr` and `at_addr`, and a message that says what to check: `ProgNoAnswerError` (also a + `TargetUnreachableError`: wiring, power, I/O voltage, a programming pin disabled by fuses), + `ProgLockedError` (`erase="chip"` unlocks), `ProgVerifyError`, a pin the wiring profile marks as a chip output + (the pod refuses to drive it, `BP0034`: mark it `bidir` with `la_dir` or fix the wiring; the SDK never overrides directions), `ProgDeviceError` (chip not in the + table, not the `device` named, image does not fit, voltage). `check=False` returns the + `FlashResult` instead. +* Works over the LAN, USB and the cloud. Needs pod firmware with the `prog_flash` feature + (`bp.supports("prog_flash")`; `UnsupportedFeatureError` otherwise) and the `xip_prog` blob, + installed with the other blobs (`benchpod install-blobs`): the pod refuses with a + `XipUnavailableError` without it. While a job runs the pod answers busy to captures, uploads + and DAP, SPI or I2C sessions, and a USB flash cannot start. + ## USB host mode and USB flashing Firmware 4.0.3 and later. The pod's USB port becomes a full-speed USB host for the board under test, @@ -2736,6 +2800,8 @@ Match a pod refusal on its code or class, not its text: see [Error codes](#error | `FirmwareError` | the pod replied with an error: a coded refusal (see [Error codes](#error-codes)), rendered from the catalog, or a refusal without a code, with the pod's text | `code`, `values`, `docs_url`, `firmware_message` (the pod's text, `""` for a coded refusal), `cmd` | | `FlashError` | OpenOCD failed, is missing, or lacks the TCP backend | | | `TargetUnreachableError` (a `FlashError`) | the probe worked but no target answered on SWD | | +| `ProgFlashError` (a `FlashError`) | a flash over programming pins (UPDI, PIC, C2, TPI, PDI) failed | `result`, `phase`, `mem`, `addr`, `at_addr` | +| `ProgNoAnswerError`, `ProgLockedError`, `ProgVerifyError`, `ProgDeviceError` (`ProgFlashError`s) | the chip did not answer (also a `TargetUnreachableError`), is locked, read back wrong, or is not in the table / not the `device` named / cannot be programmed at this voltage | as `ProgFlashError` | | `DeviceBusyError` | a device lease was not granted within `lease_wait` | | | `CloudAuthError` | no session token: API key rejected, OIDC unavailable, exchange failed | | | `ServerApiError` | an embeddedci server API call failed | `status` (HTTP) | @@ -2756,7 +2822,7 @@ Match a pod refusal on its code or class, not its text: see [Error codes](#error | `UsbSerialBusyError` (a `PodBusyError`) | the board's USB port is in use (`BP0086`): a `usb_flash` or `usb_check` runs | `why` | | `UsbCheckRefusedError` (a `FirmwareError`) | the pod cannot run the USB check (`BP0087`) | `why` | | `UsbCheckNoPowerError` (a `FirmwareError`) | the board is not powered from eFuse 1 (`BP0088`) | | -| `XipUnavailableError` (a `FirmwareError`) | the pod cannot run the USB flash code from its W25Q (`BP0083`): install the blobs of its firmware | `why` | +| `XipUnavailableError` (a `FirmwareError`) | the pod cannot run the USB flash or pin-programmer code from its W25Q (`BP0083`): install the blobs of its firmware | `why` | | `UsbFlashError` (a `FlashError`) | a USB flash failed, timed out or was aborted, or no loader fits the board | `result`, `phase`, `mode`, `state` | | `WiringError` (a `FirmwareError`) | a wiring-profile operation was refused (`BP0007` to `BP0015`): no such profile, a bad name, a revision conflict, the store is full, too large, not a JSON object, the default cannot be deleted, an upload out of order, the storage failed | `name`, `code`, `values` | | `ClientTooOldError` (a `FirmwareError`) | this SDK is too old for the pod's firmware: the pod announces a client API level above `CLIENT_API` (raised on connect), or refuses the SDK's level (`BP0030`). Update the SDK: `pip install -U embeddedci` | `client_api`, `api`, `min_client_api`, `firmware_version` | diff --git a/packages/embeddedci/src/embeddedci/benchpod/__init__.py b/packages/embeddedci/src/embeddedci/benchpod/__init__.py index f4ef042..3642541 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/__init__.py +++ b/packages/embeddedci/src/embeddedci/benchpod/__init__.py @@ -155,6 +155,7 @@ def test_boots(benchpod_target, firmware): # fixtures from the pytest plugin XipUnavailableError, ) from .flash import FlashResult +from .prog import ProgDeviceError, ProgFlashError, ProgLockedError, ProgNoAnswerError, ProgVerifyError from .expansion import ( EXPANSION_CHIPS, ExpansionChip, @@ -415,6 +416,11 @@ def test_boots(benchpod_target, firmware): # fixtures from the pytest plugin "UsbHostPortError", "UsbFlashRefusedError", "UsbFlashError", + "ProgDeviceError", + "ProgFlashError", + "ProgLockedError", + "ProgNoAnswerError", + "ProgVerifyError", "UsbSerialUnavailableError", "UsbSerialBusyError", "UsbCheckRefusedError", diff --git a/packages/embeddedci/src/embeddedci/benchpod/client.py b/packages/embeddedci/src/embeddedci/benchpod/client.py index 0c7f0a1..6d60e27 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/client.py +++ b/packages/embeddedci/src/embeddedci/benchpod/client.py @@ -50,6 +50,7 @@ from . import i2c as _i2c from . import i2c_master as _i2c_master from . import motor_emulator as _motor_emulator +from . import prog as _prog from . import spi as _spi from . import usb_host as _usb from . import uart as _uart @@ -103,7 +104,7 @@ coerce_pin, ) from .connection import resolve_connection -from .errors import (BenchPodError, ClientTooOldError, FirmwareError, FirmwareTooOldError, +from .errors import (BenchPodError, ClientTooOldError, DirectionConflictError, FirmwareError, FirmwareTooOldError, FlashError, PullDirectionError, UnsupportedFeatureError, UsbHostUnavailableError, UsbTimeout, classify_firmware_error, firmware_error) from .flash import FlashResult @@ -1871,6 +1872,12 @@ def flash( rx: Union[Pin, int, str, None] = None, tx: Union[Pin, int, str, None] = None, boot: Union[Pin, int, str, None] = None, + device: str = "", + clk: Union[Pin, int, str, None] = None, + data: Union[Pin, int, str, None] = None, + reset_pin: Union[Pin, int, str, None] = None, + erase: str = "chip", + dry_run: bool = False, ) -> FlashResult: """Flash a target over SWD or JTAG through the pod's CMSIS-DAP probe and report the result. @@ -1912,6 +1919,33 @@ def flash( each region against the chip's MD5 and, with ``reset``, starts the new image; ``stdout`` names the chip and every region written. Needs firmware with the ``esp_flash`` command. + A chip with its own programming pins and no SWD, JTAG or bootloader is flashed by the pod + itself: ``target="avr-updi"`` (AVR tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD), ``"pic"`` + (PIC16F1xxx, PIC16F18xxx, PIC18F Q-series, low-voltage entry), ``"efm8"`` (Silicon Labs EFM8 + and C8051F, C2), ``"attiny-tpi"`` (ATtiny4/5/9/10/20/40/102/104) or ``"xmega"`` (XMEGA, PDI); + the protocol names ``updi``, ``pic``, ``c2``, ``tpi`` and ``pdi`` work too. ``file`` is a + ``.hex``, ``.elf`` or ``.bin`` (a ``.bin`` goes at ``load_address``, default 0, into the + flash). The SDK reads the chip's ID first, finds it in its device table + (:mod:`embeddedci.benchpod.prog`), cuts the image into the chip's memories (flash, EEPROM, + fuses or configuration words, user row or user ID: a ``.hex`` from avr-gcc or XC8 already + has them at their usual addresses), writes and reads back every page. ``device`` names the + chip (``"ATtiny1616"``) when its ID is shared or you want the check; omitted, the ID decides. + ``erase`` is ``"chip"`` (the default, before the first write when the image has flash; it + also unlocks a locked chip), ``"page"`` (only the pages written; the TPI chips erase their + whole code section instead) or ``"none"``. ``reset`` says whether the chip runs its program + afterwards. Pins: ``clk`` and ``data`` are LA pins (``data`` only for ``avr-updi``; default: + a wiring-profile signal named for the protocol, ``ICSPCLK`` / ``ICSPDAT``, ``C2CK`` / + ``C2D``, ``TPICLK`` / ``TPIDATA``, ``PDI_CLK`` / ``PDI_DATA`` or ``UPDI``, else the profile's + ``swd_swclk`` / ``swd_swdio``). ``pic`` and ``attiny-tpi`` also drive the chip's reset + (MCLR, RESET): the pod's reset pin by default (``nreset=True``), or an LA pin as + ``reset_pin`` (default: a profile signal named ``MCLR`` or ``RESET``). ``dry_run=True`` + only enters programming mode and reads the chip's ID (a wiring test): ``stdout`` names the + chip, nothing is written. The ATtiny4/5/9/10/20/40 program at 5 V only, which the pod's I/O + cannot give (:class:`~embeddedci.benchpod.prog.ProgDeviceError`). A failure raises + :class:`~embeddedci.benchpod.prog.ProgFlashError` (or a subclass) with what to check. + Needs firmware with the ``prog_flash`` feature and the ``xip_prog`` blob (``benchpod + install-blobs``). + Local OpenOCD runs on THIS machine and needs the ``cmsis_dap_tcp`` backend (newer than 0.12.0). By default (``check=True``) a failed flash raises :class:`FlashError` / :class:`TargetUnreachableError`; pass ``check=False`` to get the :class:`FlashResult` and @@ -1921,6 +1955,21 @@ def flash( self._yield_expansion_bus() if from_build and file: raise ValueError("pass either file or a build (build/repo/ref/artifact), not both") + if _prog.is_prog_target(target): + if from_build: + raise ValueError(f"{target} is flashed from a file (a .hex, .elf or .bin), not an " + "uploaded build") + try: + return self._flash_prog( + target, file, device=device, clk=clk, data=data, reset_pin=reset_pin, + nreset=nreset, load_address=load_address, erase=erase, dry_run=dry_run, + run_after=reset, + power=coerce_efuse(target_power) if target_power is not None else None) + except _prog.ProgFlashError as exc: + if check: + raise + return FlashResult(ok=False, returncode=1, stdout="", stderr=str(exc), + target_unreachable=isinstance(exc, _prog.ProgNoAnswerError)) if _esp.is_esp_target(target or self.wiring.swd_target): if from_build: raise ValueError("an ESP32 target is flashed from a file (a .bin or flasher_args.json), " @@ -2063,6 +2112,132 @@ def by_signal(names: Sequence[str]) -> Optional[int]: return FlashResult(ok=r.ok, returncode=0 if r.ok else 1, stdout="\n".join(lines), stderr=r.error) + # -- chips with their own programming pins (UPDI, PIC, C2, TPI, PDI) ----------------------- + + def _require_prog(self) -> None: + """Refuse ahead, in words, when the pod's firmware lacks ``prog_flash``.""" + if self.supports("prog_flash"): + return + fw = self.capabilities.firmware_version or "unknown" + raise UnsupportedFeatureError( + f"flashing a chip over its programming pins needs newer pod firmware with the " + f"'prog_flash' feature (this pod runs firmware {fw}): update the pod and install its " + f"blobs (benchpod install-blobs)", feature="prog_flash", + firmware_version=self.capabilities.firmware_version) + + def _prog_pins(self, proto: str, clk: Any, data: Any, reset_pin: Any, + nreset: Optional[bool]) -> Tuple[Dict[str, Any], str]: + """The ``prog_flash`` pins of a flash and the same in words for error messages. A pin the + caller passes beats a wiring-profile signal named for the protocol, which beats the + profile's SWD pins.""" + def by_signal(names: Sequence[str]) -> Optional[int]: + for s in self.wiring.signals: + if s.name.upper() in names: + return s.la + return None + + def pick(value: Any, names: Sequence[str], role: str, what: str) -> int: + if value is not None: + return self._resolve_la(value, what)[0] + la = by_signal(tuple(names)) + if la is not None: + return la + la = getattr(self.wiring, role) + if la is None: + raise ValueError( + f"{what} was not given and the wiring profile has neither a signal named " + f"{' / '.join(names) if names else what.upper()} nor {role}: pass {what}= " + "(an LA pin)") + return la + + uart = proto == "updi" + pins: Dict[str, Any] = {} + pins["data"] = pick(data, _prog.DATA_SIGNALS[proto], "swd_swdio", "data") + text = [f"data on LA{pins['data']}"] + if not uart: + pins["clk"] = pick(clk, _prog.CLK_SIGNALS[proto], "swd_swclk", "clk") + text.insert(0, f"clk on LA{pins['clk']}") + if pins["clk"] == pins["data"]: + raise ValueError("clk and data must be different LA pins") + elif clk is not None: + raise ValueError("avr-updi uses one pin: pass data=, not clk=") + if proto in ("pic", "tpi"): + if reset_pin is not None: + pins["reset"] = self._resolve_la(reset_pin, "reset_pin")[0] + elif nreset is False or (nreset is None and by_signal(_prog.RESET_SIGNALS) is not None): + la = by_signal(_prog.RESET_SIGNALS) + if la is None: + raise ValueError( + f"the chip's reset needs the pod's reset pin (nreset=True) or an LA pin " + f"(reset_pin=, or a wiring-profile signal named MCLR or RESET)") + pins["reset"] = la + else: + pins["reset"] = "nrst" + if pins["reset"] in (pins.get("clk"), pins["data"]): + raise ValueError("reset_pin must be another pin than clk and data") + text.append("reset on " + ("the pod's reset pin" if pins["reset"] == "nrst" + else f"LA{pins['reset']}")) + return pins, ", ".join(text) + + def _flash_prog(self, target: str, file: str, *, device: str, clk: Any, data: Any, + reset_pin: Any, nreset: Optional[bool], load_address: str, erase: str, + dry_run: bool, run_after: bool, power: Optional[Efuse]) -> FlashResult: + """flash() for a chip with its own programming pins: the pod's prog_flash, see + :mod:`embeddedci.benchpod.prog`.""" + proto = _prog.protocol_for(target) + if erase not in ("chip", "page", "none"): + raise ValueError(f"erase must be 'chip', 'page' or 'none', not {erase!r}") + if not file and not dry_run: + raise ValueError(f"{target} needs file: a .hex, .elf or .bin (or pass dry_run=True to only " + "read the chip's ID)") + pins, pin_text = self._prog_pins(proto, clk, data, reset_pin, nreset) + fam = _prog.families()[proto] + segments: List[_prog.Segment] = [] + if file: + segments = _prog.load_image(file, load_address=_esp.parse_address(load_address)) + self._require_prog() + stage = getattr(self._transport, "stage_psram", None) + # The image is staged in PSRAM, which only the deep-replay gateware image writes (as for + # ESP32 flashing): a pod left on the emulation (or loop) image is switched first (~3 s). + self._ensure_image(FpgaImage.DEEP_REPLAY, needed_for="flashing over programming pins", + switch=True) + if power is not None: + self._transport.target_power(power, True) + time.sleep(_flash.TARGET_POWER_SETTLE) + try: + volts = self.get_la_voltage().voltage + except BenchPodError: + volts = None + vtext = f"{volts:g} V" if volts else "not set" + try: + chip_id = _prog.read_info(self.command, proto, pins, pin_text=pin_text, volts=vtext) + except DirectionConflictError as exc: + raise _prog.direction_error(exc, pin_text) from exc + dev = _prog.find_device(proto, chip_id=chip_id, name=device) + lines = [f"{dev.name} ({fam.title}), ID {chip_id}"] + _prog.check_voltage(dev, volts, erase=erase if file else "none") + if file: + _prog.check_erase(dev, erase) + if dry_run: + lines.append("dry run: nothing was written") + return FlashResult(ok=True, returncode=0, stdout="\n".join(lines), stderr="") + regions, notes = _prog.split_regions(segments, dev, ignore=fam.ignore) + if erase == "chip" and not any(r.mem == "flash" for r in regions): + erase = "page" # an image without flash must not wipe the chip's program + notes.append("the image has no flash: no chip erase, only the pages written are erased") + try: + r = _prog.run(self.command, stage, proto, dev, regions, pins=pins, erase=erase, + run_after=run_after, pin_text=pin_text, volts=vtext, chip_id=chip_id) + except DirectionConflictError as exc: + raise _prog.direction_error(exc, pin_text) from exc + lines += [f"{g.mem} at 0x{g.addr:x}: {g.length} bytes written and verified in " + f"{g.seconds:.1f} s" for g in r.regions] + lines += notes + lines.append(f"{len(r.regions)} region(s) in {r.seconds:.1f} s" + + ("; the chip runs its program" if run_after else "; the chip is held in reset")) + return FlashResult(ok=r.ok, returncode=0 if r.ok else 1, stdout="\n".join(lines), + stderr=r.error) + def _flash_pins(self, swclk: Any, swdio: Any, tck: Any, tms: Any, tdi: Any, tdo: Any, trst: Any, target: str) -> Dict[str, Any]: """The pins and port of a flash: ``swclk``, ``swdio``, ``tck``, ``tms``, ``tdi``, ``tdo``, diff --git a/packages/embeddedci/src/embeddedci/benchpod/errors.py b/packages/embeddedci/src/embeddedci/benchpod/errors.py index a47250f..a536949 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/errors.py +++ b/packages/embeddedci/src/embeddedci/benchpod/errors.py @@ -444,8 +444,8 @@ class UsbCheckNoPowerError(FirmwareError): class XipUnavailableError(FirmwareError): - """The pod cannot run code from its W25Q (``BP0083``): :attr:`why`. The USB flash protocols - run from there, so install the blobs that go with the firmware (``benchpod install-blobs``).""" + """The pod cannot run code from its W25Q (``BP0083``): :attr:`why`. The USB flash protocols and + the pin programmers (``prog_flash``) run from there, so install the blobs that go with the firmware (``benchpod install-blobs``).""" def __init__(self, message: str, *, cmd: Optional[str] = None, why: str = "") -> None: super().__init__(message, cmd=cmd) diff --git a/packages/embeddedci/src/embeddedci/benchpod/feature_map.json b/packages/embeddedci/src/embeddedci/benchpod/feature_map.json index 521a1a1..d87f270 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/feature_map.json +++ b/packages/embeddedci/src/embeddedci/benchpod/feature_map.json @@ -1,10 +1,10 @@ { "_generated": "GENERATED by tools/gen_features.py from features/features.toml. DO NOT EDIT: edit the table.", "schema": 1, - "revision": 16, + "revision": 17, "api": 2, "min_client_api": 2, - "table_sha256": "62774655c1b30b01bed9e205d16ea5688cc6bdd0d87987657897a896e624e873", + "table_sha256": "e8620749d5e461c9e24ac54465822a1423fb8076d2ca948264f8d1935b14cbe9", "floor": "3.9.2", "docs_base": "https://github.com/embeddedci-com/benchpod-firmware/blob/main/docs/", "facts": { @@ -846,6 +846,12 @@ "gateware": 61, "board": "any", "docs": "dap-over-tunnel.md#jtag" + }, + "prog_flash": { + "rev": 17, + "firmware": "next", + "board": "any", + "docs": "API.md#prog_flash--flash-a-chip-over-its-programming-pins" } } } diff --git a/packages/embeddedci/src/embeddedci/benchpod/prog.py b/packages/embeddedci/src/embeddedci/benchpod/prog.py new file mode 100644 index 0000000..28722e1 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/prog.py @@ -0,0 +1,712 @@ +"""Flash a chip over its own programming pins (the pod's ``prog_flash`` command). + +Five protocols that need neither SWD, JTAG nor a bootloader: AVR UPDI (``avr-updi``), PIC ICSP +with low-voltage entry (``pic``), Silicon Labs C2 (``efm8``), AVR TPI (``attiny-tpi``) and XMEGA +PDI (``xmega``). The pod runs the whole protocol next to the pins: each memory region is staged +in the pod's PSRAM (``load_bin``), written and read back by the pod in the background, and this +module polls its progress. It works the same over the LAN, USB and the cloud. + +The pod holds no device tables. It reads and reports the chip's ID bytes; the table in +``prog_devices.json`` (next to this module, described in ``prog_devices.README.md``) says which +chip that is, how its memories are laid out and which protocol options it needs. This module +reads a ``.hex``, ``.elf`` or ``.bin`` image, cuts it into the chip's memories (flash, EEPROM, +configuration or fuses, user row or user ID) and writes them one after the other. + +Use it through :meth:`BenchPod.flash ` with one of the +:data:`TARGETS` (``flash(target="avr-updi", file="app.hex")``); this module is its implementation. +""" + +from __future__ import annotations + +import json +import os +import struct +import time +from dataclasses import dataclass, field +from functools import lru_cache +from importlib import resources +from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union + +from .errors import FlashError, TargetUnreachableError + +#: ``flash(target=...)`` names and the ``prog_flash`` protocol each one runs. The protocol names +#: themselves are accepted too (``updi``, ``pic``, ``c2``, ``tpi``, ``pdi``). +TARGETS: Dict[str, str] = { + "avr-updi": "updi", "updi": "updi", + "pic": "pic", + "efm8": "c2", "c2": "c2", + "attiny-tpi": "tpi", "tpi": "tpi", + "xmega": "pdi", "pdi": "pdi", +} + +#: The memories the pod writes, in the order this module writes them: flash first, the +#: configuration (fuses, lock) last, because it can lock the chip or switch off its programming pin. +MEM_ORDER = ("flash", "eeprom", "user", "config") + +#: Wiring-profile signal names looked up when a pin is not given (case-insensitive), per protocol. +CLK_SIGNALS = { + "pic": ("ICSPCLK", "ICSP_CLK", "PGC"), "c2": ("C2CK",), "tpi": ("TPICLK", "TPI_CLK"), + "pdi": ("PDI_CLK",), +} +DATA_SIGNALS = { + "updi": ("UPDI",), "pic": ("ICSPDAT", "ICSP_DAT", "PGD"), "c2": ("C2D",), + "tpi": ("TPIDATA", "TPI_DATA"), "pdi": ("PDI_DATA",), +} +RESET_SIGNALS = ("MCLR", "RESET", "NRST", "PROG_RESET") + +POLL_INTERVAL = 0.2 +#: Entering programming mode and reading the ID: a few hundred milliseconds, 5 s is generous. +INFO_TIMEOUT = 10.0 + +#: Progress callback: pages (or blocks) done in the region being written, and the region's total. +Progress = Callable[[int, int], None] + + +# -- errors ---------------------------------------------------------------------------------- + +class ProgFlashError(FlashError): + """A pin-programmer flash did not succeed. :attr:`result` is the pod's outcome (or what the + SDK found), :attr:`phase` where it stopped (``enter``, ``erase``, ``write``, ``leave``), + :attr:`mem`/:attr:`addr` the region and :attr:`at_addr` the first address that read back + wrong. The message says what to check.""" + + def __init__(self, message: str, *, result: str = "", phase: str = "", mem: str = "", + addr: Optional[int] = None, at_addr: Optional[int] = None) -> None: + super().__init__(message) + self.result = result + self.phase = phase + self.mem = mem + self.addr = addr + self.at_addr = at_addr + + +class ProgNoAnswerError(ProgFlashError, TargetUnreachableError): + """The chip did not answer: wiring, power or the I/O voltage (also a + :class:`~embeddedci.benchpod.errors.TargetUnreachableError`).""" + + +class ProgLockedError(ProgFlashError): + """The chip is locked: only a chip erase (``erase="chip"``) unlocks it, and that erases it.""" + + +class ProgVerifyError(ProgFlashError): + """A page read back different from what was written (``at_addr``).""" + + +class ProgDeviceError(ProgFlashError): + """The chip is not in the device table, is not the ``device`` named, or cannot be programmed + at this I/O voltage.""" + + +# -- the device table -------------------------------------------------------------------------- + +@dataclass(frozen=True) +class ProgMemory: + """One memory of a chip. ``addr`` is where the pod addresses its first byte and ``hex`` where + it sits in a ``.hex`` / ``.elf`` image (avr-gcc: flash 0, EEPROM 0x810000, fuses 0x820000, + user row 0x850000). ``size`` is in bytes, ``page`` the write page or row in bytes, ``align`` + the unit a region starts and ends on, ``stride`` the hex bytes one byte of this memory takes + (2 when the image carries each byte in a 16-bit word).""" + + name: str + size: int + page: int + addr: int + hex: int + align: int = 1 + stride: int = 1 + + +@dataclass(frozen=True) +class ProgDevice: + """One chip of the device table.""" + + name: str + family: str + proto: str + id: str + mem: Mapping[str, ProgMemory] + opts: Mapping[str, int] = field(default_factory=dict) + vmin_mv: int = 0 + vmax_mv: int = 0 + erase_vmin_mv: int = 0 + vnote: str = "" + aliases: Tuple[str, ...] = () + notes: str = "" + #: The chip writes fewer words than it erases (PIC16F1827 and 193x: 8 latches, 32-word rows), so + #: a page erase of a part of a row would erase its neighbours: only ``erase="chip"`` is allowed. + chip_erase_only: bool = False + + def matches_id(self, chip_id: str) -> bool: + """Whether ``chip_id`` (the pod's ``status.id`` hex) is this chip's. The table's ``id`` is + hex bytes with ``??`` for bytes that vary (a revision); only its length is compared.""" + return id_matches(self.id, chip_id) + + @property + def expect_id(self) -> str: + """The ``expect_id`` the pod checks before it erases anything: the table's ``id`` up to + its first ``??``.""" + return self.id.split("??", 1)[0] + + +def _norm(name: str) -> str: + return "".join(c for c in str(name).lower() if c.isalnum()) + + +def id_matches(pattern: str, chip_id: str) -> bool: + """``chip_id`` starts with the hex bytes of ``pattern`` (``??`` matches any byte).""" + pat = str(pattern).lower().replace(" ", "") + got = str(chip_id).lower().replace(" ", "").replace("0x", "") + if not pat or len(got) < len(pat): + return False + return all(p == "?" or p == g for p, g in zip(pat, got)) + + +@dataclass(frozen=True) +class ProgFamily: + """A table family: the chips one ``target`` writes.""" + + proto: str + target: str + title: str + devices: Tuple[ProgDevice, ...] + #: Image regions to leave out without an error (the AVR lock bits and signature rows an + #: avr-gcc ``.elf`` carries): ``{"hex": int, "size": int, "name": str}``. + ignore: Tuple[Mapping[str, Any], ...] = () + + def find(self, name: str) -> Optional[ProgDevice]: + key = _norm(name) + for d in self.devices: + if key == _norm(d.name) or key in {_norm(a) for a in d.aliases}: + return d + return None + + +@lru_cache(maxsize=1) +def load_table() -> Dict[str, Any]: + """The raw ``prog_devices.json`` (schema in ``prog_devices.README.md``).""" + text = resources.files(__package__).joinpath("prog_devices.json").read_text("utf-8") + data = json.loads(text) + if data.get("schema") != 1: + raise ValueError("prog_devices.json: unknown schema " + repr(data.get("schema"))) + return data + + +def _device(raw: Mapping[str, Any], proto: str) -> ProgDevice: + mems = {} + for name, m in raw["mem"].items(): + page = int(m.get("page", 1)) + mems[name] = ProgMemory( + name=name, size=int(m["size"]), page=page, addr=int(m["addr"]), hex=int(m["hex"]), + align=int(m.get("align", page if name == "flash" else 1)), stride=int(m.get("stride", 1))) + return ProgDevice( + name=raw["name"], family=raw.get("family", ""), proto=proto, id=str(raw["id"]).lower(), + mem=mems, opts={k: int(v) for k, v in (raw.get("opts") or {}).items()}, + vmin_mv=int(raw.get("vmin_mv", 0)), vmax_mv=int(raw.get("vmax_mv", 0)), + erase_vmin_mv=int(raw.get("erase_vmin_mv", 0)), vnote=str(raw.get("vnote", "")), + aliases=tuple(raw.get("aliases", ())), notes=str(raw.get("notes", "")), + chip_erase_only=bool(raw.get("chip_erase_only", False))) + + +@lru_cache(maxsize=None) +def families() -> Mapping[str, ProgFamily]: + """The table's families by protocol (``updi``, ``pic``, ``c2``, ``tpi``, ``pdi``).""" + out: Dict[str, ProgFamily] = {} + for proto, fam in load_table()["families"].items(): + out[proto] = ProgFamily( + proto=proto, target=fam["target"], title=fam.get("title", proto), + devices=tuple(_device(d, proto) for d in fam["devices"]), + ignore=tuple(fam.get("ignore", ()))) + return out + + +def protocol_for(target: str) -> str: + """The ``prog_flash`` protocol of a ``flash(target=...)`` name (``"avr-updi"`` -> ``"updi"``). + Raises :class:`KeyError` for a name that is not one of :data:`TARGETS`.""" + return TARGETS[str(target).strip().lower()] + + +def is_prog_target(target: str) -> bool: + """``target`` names a pin-programmer target (:data:`TARGETS`, case-insensitive).""" + return str(target).strip().lower() in TARGETS + + +def find_device(proto: str, *, chip_id: str = "", name: str = "") -> ProgDevice: + """The table's chip for the pod's ``chip_id`` and/or a ``name`` the caller gave. + + A ``name`` must be in the table and, when ``chip_id`` is known, have that ID. Without a name + the ID picks the chip; several chips with one ID (an ATxmega16A4 and 16A4U, an EFM8 family) + must have the same memories, else the caller has to name it. Raises + :class:`ProgDeviceError`.""" + fam = families()[proto] + if name: + dev = fam.find(name) + if dev is None: + known = ", ".join(d.name for d in fam.devices[:8]) + raise ProgDeviceError( + f"device {name!r} is not in the {fam.title} table (it has {len(fam.devices)} chips, " + f"for example {known}); check the spelling, or leave device out to identify the chip " + "by its ID", result="unknown device") + if chip_id and not dev.matches_id(chip_id): + raise ProgDeviceError( + f"the chip answers with ID {chip_id}, which is not a {dev.name} (ID {dev.id}); " + "check the board, or leave device out to identify the chip by its ID", + result="wrong chip") + return dev + if not chip_id: + raise ProgDeviceError("no chip ID to look up: pass device= or read the chip first") + found = [d for d in fam.devices if d.matches_id(chip_id)] + if not found: + raise ProgDeviceError( + f"the chip answers with ID {chip_id}, which is not in the {fam.title} table " + f"({len(fam.devices)} chips). If it is a chip this programmer supports, pass device= " + "with its name when the table has it, or report the ID", result="unknown chip") + first = found[0] + if any(d.mem != first.mem or d.opts != first.opts for d in found[1:]): + raise ProgDeviceError( + f"ID {chip_id} fits {', '.join(d.name for d in found)}, which differ: pass device= with " + "the one on the board", result="ambiguous chip") + return first + + +def check_erase(dev: ProgDevice, erase: str) -> None: + """Refuse ``erase="page"`` on a chip that can only be chip-erased. Raises :class:`ProgDeviceError`.""" + if dev.chip_erase_only and erase == "page": + raise ProgDeviceError( + f"the {dev.name} erases 32-word rows but writes 8 words at a time, so erasing single pages " + "would wipe their neighbours: use erase=\"chip\" (the default) or erase=\"none\" on an " + "erased chip", result="erase mode") + + +def check_voltage(dev: ProgDevice, volts: Optional[float], *, erase: str = "none") -> None: + """Refuse a chip the pod's I/O voltage ``volts`` (1.8 or 3.3; ``None``: not known, no check) + cannot program, before anything is written. Raises :class:`ProgDeviceError`.""" + if not volts: + return + mv = int(round(volts * 1000)) + if dev.vmin_mv and mv < dev.vmin_mv: + if dev.vmin_mv >= 4000: + fix = (f"the {dev.name} can only be programmed at {dev.vmin_mv / 1000:g} V or more, and the " + f"pod's I/O is {volts:g} V: it cannot program this chip. Use the board's own 5 V with " + "a level shifter on the programming pins and a programmer that drives 5 V") + else: + fix = (f"the {dev.name} needs at least {dev.vmin_mv / 1000:g} V to be programmed and the pod's " + f"I/O is {volts:g} V: set the I/O voltage to the chip's supply (set_la_voltage)") + raise ProgDeviceError(fix + (f" ({dev.vnote})" if dev.vnote else ""), result="voltage") + if dev.vmax_mv and mv > dev.vmax_mv: + raise ProgDeviceError( + f"the {dev.name} takes at most {dev.vmax_mv / 1000:g} V and the pod's I/O is {volts:g} V: " + "set the I/O voltage to the chip's supply (set_la_voltage)", result="voltage") + if erase == "chip" and dev.erase_vmin_mv and mv < dev.erase_vmin_mv: + raise ProgDeviceError( + f"the {dev.name}'s chip erase needs the supply above {dev.erase_vmin_mv / 1000:g} V (its " + f"brown-out level) and the pod's I/O is {volts:g} V, so the erase can be ignored. Power " + "the chip and set the I/O voltage to 3.3 V, or pass erase=\"page\" for an already " + "erased chip", result="voltage") + + +# -- image files ----------------------------------------------------------------------------- + +#: One run of image bytes at ``addr`` (a ``.hex`` / ``.elf`` address). +Segment = Tuple[int, bytes] + + +def _merge(parts: Sequence[Segment]) -> List[Segment]: + """Sorted, with touching and overlapping runs joined (a later byte wins).""" + cells: Dict[int, int] = {} + for addr, data in parts: + for i, b in enumerate(data): + cells[addr + i] = b + out: List[Segment] = [] + start = prev = None + buf = bytearray() + for a in sorted(cells): + if prev is None or a != prev + 1: + if start is not None: + out.append((start, bytes(buf))) + start, buf = a, bytearray() + buf.append(cells[a]) + prev = a + if start is not None: + out.append((start, bytes(buf))) + return out + + +def parse_ihex(text: str) -> List[Segment]: + """The runs of an Intel HEX file (record types 0 data, 1 end, 2 and 4 extended address).""" + parts: List[Segment] = [] + base = 0 + for n, line in enumerate(text.splitlines(), 1): + line = line.strip() + if not line: + continue + if not line.startswith(":"): + raise ValueError(f"line {n}: not an Intel HEX record: {line[:20]!r}") + try: + raw = bytes.fromhex(line[1:]) + except ValueError: + raise ValueError(f"line {n}: not hex: {line[:20]!r}") from None + if len(raw) < 5 or len(raw) != raw[0] + 5: + raise ValueError(f"line {n}: the record length does not match its bytes") + if sum(raw) & 0xFF: + raise ValueError(f"line {n}: bad checksum") + count, off, rtype = raw[0], (raw[1] << 8) | raw[2], raw[3] + body = raw[4:4 + count] + if rtype == 0: + parts.append((base + off, bytes(body))) + elif rtype == 1: + break + elif rtype == 2 and count == 2: + base = ((body[0] << 8) | body[1]) << 4 + elif rtype == 4 and count == 2: + base = ((body[0] << 8) | body[1]) << 16 + # 3 and 5 (start address) say nothing about the contents + return _merge(parts) + + +def parse_elf(data: bytes) -> List[Segment]: + """The loadable segments of a 32-bit little-endian ELF at their load addresses (``p_paddr``: + avr-gcc puts the EEPROM at 0x810000 and the fuses at 0x820000 there).""" + if data[:4] != b"\x7fELF" or len(data) < 52: + raise ValueError("not an ELF file") + if data[4] != 1 or data[5] != 1: + raise ValueError("only 32-bit little-endian ELF files are supported (these chips' toolchains " + "write them); convert with objcopy -O ihex") + phoff, = struct.unpack_from(" List[Segment]: + """The runs of image bytes in a ``.hex`` (Intel HEX), ``.elf`` or ``.bin`` file. A ``.bin`` + goes at ``load_address``.""" + p = os.fspath(path) + with open(p, "rb") as fh: + raw = fh.read() + ext = os.path.splitext(p)[1].lower() + if raw[:4] == b"\x7fELF" or ext in (".elf", ".axf", ".out"): + segs = parse_elf(raw) + elif ext in (".hex", ".ihex", ".ihx", ".a43") or raw[:1] == b":": + segs = parse_ihex(raw.decode("ascii", errors="replace")) + else: + segs = [(load_address, raw)] if raw else [] + if not segs: + raise ValueError(f"{p} holds no image bytes") + return segs + + +# -- cutting an image into the chip's memories ------------------------------------------------- + +@dataclass +class Region: + """One ``prog_flash`` write: ``data`` into memory ``mem`` at the pod's address ``addr``.""" + + mem: str + addr: int + data: bytes + page: int + hex: int = 0 + + +def _align(v: int, unit: int, up: bool) -> int: + return -(-v // unit) * unit if up else v // unit * unit + + +def split_regions(segments: Sequence[Segment], dev: ProgDevice, *, + ignore: Sequence[Mapping[str, Any]] = ()) -> Tuple[List[Region], List[str]]: + """Cut ``segments`` into the chip's memories. Returns the regions in write order (flash, + EEPROM, user, config; each ascending) and notes about what was left out. + + A region starts and ends on its memory's ``align`` (flash: a page; a partial page is padded with + 0xFF); regions that touch after that are one. Bytes outside every memory of ``dev`` raise + :class:`ProgDeviceError` (the message says where the memories are), unless ``ignore`` names + them (lock bits and signature rows the toolchain adds). An image with no bytes for the chip + raises it too.""" + notes: List[str] = [] + placed: Dict[str, Dict[int, int]] = {m: {} for m in dev.mem} + for hexaddr, data in segments: + i = 0 + while i < len(data): + a = hexaddr + i + hit = next((m for m in dev.mem.values() if m.hex <= a < m.hex + m.size * m.stride), None) + if hit is None: + skip = next((g for g in ignore if int(g["hex"]) <= a < int(g["hex"]) + int(g["size"])), None) + if skip is not None: + n = min(len(data) - i, int(skip["hex"]) + int(skip["size"]) - a) + note = f"left out the {skip.get('name', 'region')} at 0x{a:x} ({n} bytes): the programmer does not write it" + if note not in notes: + notes.append(note) + i += n + continue + raise ProgDeviceError( + f"the image has data at 0x{a:x} that is not in any memory of the {dev.name}: " + + _layout(dev) + "; build for this chip, or pass device= for the right one", + result="image does not fit") + end = min(len(data) - i, hit.hex + hit.size * hit.stride - a) + for k in range(0, end): + off = a + k - hit.hex + if hit.stride > 1: + if off % hit.stride: + continue # the high byte of a 16-bit word: only the low byte is the value + placed[hit.name][off // hit.stride] = data[i + k] + else: + placed[hit.name][off] = data[i + k] + i += end + regions: List[Region] = [] + for name in MEM_ORDER: + cells = placed.get(name) + if not cells: + continue + m = dev.mem[name] + # runs of bytes, aligned out to the memory's unit, then joined when they touch + runs: List[List[int]] = [] + run_start = prev = None + for off in sorted(cells): + if prev is None or off != prev + 1: + if run_start is not None: + runs.append([run_start, prev + 1]) + run_start = off + prev = off + runs.append([run_start, prev + 1]) + joined: List[List[int]] = [] + for lo, hi in runs: + lo, hi = _align(lo, m.align, False), _align(hi, m.align, True) + if joined and lo <= joined[-1][1]: + joined[-1][1] = max(joined[-1][1], hi) + else: + joined.append([lo, hi]) + for lo, hi in joined: + hi = min(hi, m.size) # rounding a last page up never goes past the memory + buf = bytes(cells.get(o, 0xFF) for o in range(lo, hi)) + regions.append(Region(mem=name, addr=m.addr + lo, data=buf, page=m.page, + hex=m.hex + lo * m.stride)) + if not regions: + raise ProgDeviceError(f"the image has no bytes for the {dev.name}: " + _layout(dev), + result="image does not fit") + return regions, notes + + +def _layout(dev: ProgDevice) -> str: + parts = [f"{n} 0x{m.hex:x}..0x{m.hex + m.size * m.stride - 1:x}" for n, m in dev.mem.items()] + return "it has " + ", ".join(parts) + + +# -- results from the pod ---------------------------------------------------------------------- + +#: What each ``result`` of the pod's ``prog_flash`` status means for the user, by the start of the +#: pod's text. (kind, fix.) The pod's own words are kept in :attr:`ProgFlashError.result`. +_FIXES = ( + ("no answer", "no_answer", + "the chip did not answer. Check the wiring ({pins}), the chip's power (target_power, or its own " + "supply) with a common ground, that the pod's I/O voltage ({volts}) is the chip's, and that the " + "chip's programming pin is not disabled by its fuses or program"), + ("wrong chip", "wrong_chip", + "a different chip than the one expected answered (ID {id}); check the board, or pass device= " + "for the chip that is there"), + ("locked", "locked", + "the chip is locked: it refuses reads and writes until its memory is erased. Flash with " + "erase=\"chip\" (that erases the chip, including the lock) or erase it with the vendor's tool"), + ("verify failed", "verify", + "a page read back different from what was written (at {at}). Check the supply voltage and the " + "wiring, lower the load on the pins, and try again; a worn or write-protected region fails " + "like this too"), + ("timeout", "timeout", + "the chip stayed busy: its supply is too low for erase and write (see the chip's minimum VDD), " + "or the chip is damaged"), + ("protocol error", "protocol", + "the chip's answer broke the protocol: check the wiring, long wires or a pull-up that is too " + "weak (keep the lines short), the I/O voltage and the chip's supply"), + ("memory, address", "args", + "the pod refused this memory, address, length or page size for the chip: the device table " + "and the image disagree with the chip's firmware options; pass device= for the exact chip"), + ("could not read the staged", "stage", + "the pod could not read the image it was given: try again, and report it if it repeats"), + ("not supported", "unsupported", + "this chip, memory or protocol is not supported by the pod's firmware; update the pod, or " + "check that the chip is one the table lists"), + ("aborted", "aborted", "the write was aborted"), +) + + +def direction_error(exc: Exception, pins: str) -> ProgFlashError: + """A refusal to drive a pin the wiring profile marks as a DUT output (``BP0034``), in words.""" + la = getattr(exc, "la", 0) + return ProgFlashError( + f"the pod refused to drive LA{la or '?'}: the wiring profile marks it as an output of the " + f"chip ({pins}), and a programming pin is driven by the pod. If the pin is wired to the " + "chip's programming pin, mark it bidirectional (bp.la_dir(..., 'bidir') or the profile's " + "dut_dirs); otherwise fix the wiring (clk, data, reset_pin). The SDK does not override " + "pin directions.", result="direction conflict") + + +def result_error(res: str, *, st: Mapping[str, Any], region: Optional[Region], proto: str, + pins: str, volts: str, id_hex: str) -> ProgFlashError: + """The exception for a failed ``result`` of the pod's status.""" + kind, fix = "failed", "" + for prefix, k, text in _FIXES: + if res.startswith(prefix): + kind, fix = k, text + break + at = st.get("at_addr") + phase = str(st.get("phase") or "") + where = "" + if region is not None: + where = f" writing {region.mem} at 0x{region.addr:x} ({len(region.data)} bytes)" + fix = fix.format(pins=pins, volts=volts, id=id_hex or "unknown", + at=f"0x{int(at):x}" if at is not None else "an unknown address") + msg = f"{proto} flash failed{where}: {res}" + (f" (phase {phase})" if phase else "") + if fix: + msg += "\n" + fix + kw = dict(result=res, phase=phase, mem=region.mem if region else "", + addr=region.addr if region else None, + at_addr=int(at) if at is not None else None) + cls = {"no_answer": ProgNoAnswerError, "locked": ProgLockedError, + "verify": ProgVerifyError}.get(kind, ProgFlashError) + return cls(msg, **kw) # type: ignore[arg-type] + + +# -- the run --------------------------------------------------------------------------------- + +@dataclass +class ProgRegionResult: + """One region written: its memory, the pod's address, length in bytes and seconds.""" + + mem: str + addr: int + length: int + seconds: float = 0.0 + + +@dataclass +class ProgFlashResult: + """Outcome of :func:`run`.""" + + ok: bool + device: str = "" + chip_id: str = "" + regions: List[ProgRegionResult] = field(default_factory=list) + notes: List[str] = field(default_factory=list) + seconds: float = 0.0 + error: str = "" + + +def start_request(proto: str, pins: Mapping[str, Any], *, region: Region, dev: ProgDevice, + erase: str, run_after: bool) -> Dict[str, Any]: + """The ``prog_flash`` ``start`` command for one region.""" + req: Dict[str, Any] = {"cmd": "prog_flash", "op": "start", "proto": proto, **pins, + "mem": region.mem, "addr": region.addr, "len": len(region.data), + "page": region.page, "erase": erase, "run": bool(run_after)} + if dev.expect_id: + req["expect_id"] = dev.expect_id + for key in ("flags", "cp_addr"): + if dev.opts.get(key): + req[key] = dev.opts[key] + return req + + +def read_info(command: Callable[[Dict[str, Any]], Any], proto: str, pins: Mapping[str, Any], *, + poll_interval: float = POLL_INTERVAL, sleep: Callable[[float], None] = time.sleep, + clock: Callable[[], float] = time.monotonic, pin_text: str = "", + volts: str = "") -> str: + """Enter programming mode and read the chip's ID (nothing is written): the pod's ``info``. + Returns the ID as hex. Raises :class:`ProgNoAnswerError` and the other + :class:`ProgFlashError` subclasses on a failure.""" + command({"cmd": "prog_flash", "op": "info", "proto": proto, **pins}) + deadline = clock() + INFO_TIMEOUT + while True: + sleep(poll_interval) + st = command({"cmd": "prog_flash", "op": "status"}) or {} + if not st.get("running"): + break + if clock() > deadline: + command({"cmd": "prog_flash", "op": "abort"}) + raise ProgNoAnswerError( + f"the {proto} chip did not finish answering in {INFO_TIMEOUT:g} s. Check the wiring " + f"({pin_text}) and power.", result="timeout", phase=str(st.get("phase") or "")) + res = str(st.get("result") or "") + cid = str(st.get("id") or "") + if res != "ok": + raise result_error(res, st=st, region=None, proto=proto, pins=pin_text, volts=volts, id_hex=cid) + return cid + + +def run( + command: Callable[[Dict[str, Any]], Any], + stage: Optional[Callable[[bytes], Any]], + proto: str, + dev: ProgDevice, + regions: Sequence[Region], + *, + pins: Mapping[str, Any], + erase: str = "chip", + run_after: bool = True, + progress: Optional[Progress] = None, + poll_interval: float = POLL_INTERVAL, + sleep: Callable[[float], None] = time.sleep, + clock: Callable[[], float] = time.monotonic, + pin_text: str = "", + volts: str = "", + chip_id: str = "", +) -> ProgFlashResult: + """Write ``regions`` one after the other: stage, ``prog_flash`` start, poll ``status`` until + done. ``command`` sends one JSON command and returns its ``data``; ``stage`` is the transport's + ``stage_psram``. ``erase`` ("chip", "page" or "none") is meant for the first region only when + it is a chip erase (the later regions then erase nothing). Raises :class:`ProgFlashError` + (or a subclass) at the first failed region.""" + if stage is None: + raise FlashError("flashing a chip over its programming pins needs a network, USB or cloud " + "connection (the image is uploaded into the pod's memory first), not the " + "serial console") + if erase not in ("chip", "page", "none"): + raise ValueError(f"erase must be 'chip', 'page' or 'none', not {erase!r}") + out = ProgFlashResult(ok=False, device=dev.name, chip_id=chip_id) + t_all = clock() + chip_erased = False + for i, reg in enumerate(regions): + t0 = clock() + stage(reg.data) + mode = erase + if erase == "chip": + mode = "none" if chip_erased else "chip" + last = i == len(regions) - 1 + command(start_request(proto, pins, region=reg, dev=dev, erase=mode, + run_after=run_after and last)) + chip_erased = chip_erased or mode == "chip" + # Erase plus the pages at the slowest of the five (EEPROM bytes at 10 ms each), plus a margin. + deadline = t0 + 60.0 + len(reg.data) / 200.0 + st: Mapping[str, Any] = {} + while True: + sleep(poll_interval) + st = command({"cmd": "prog_flash", "op": "status"}) or {} + if progress: + progress(int(st.get("done", 0) or 0), int(st.get("total", 0) or 0)) + if not st.get("running"): + break + if clock() > deadline: + command({"cmd": "prog_flash", "op": "abort"}) + out.seconds = clock() - t_all + raise ProgFlashError( + f"the write of the {reg.mem} at 0x{reg.addr:x} did not finish in time (stopped " + f"in phase {st.get('phase')}): check the chip's supply and the wiring", + result="timeout", phase=str(st.get("phase") or ""), mem=reg.mem, addr=reg.addr) + res = str(st.get("result") or "") + out.chip_id = str(st.get("id") or out.chip_id) + if res != "ok": + out.seconds = clock() - t_all + raise result_error(res, st=st, region=reg, proto=proto, pins=pin_text, volts=volts, + id_hex=out.chip_id) + out.regions.append(ProgRegionResult(mem=reg.mem, addr=reg.addr, length=len(reg.data), + seconds=clock() - t0)) + if progress: + progress(int(st.get("total", 0) or 0), int(st.get("total", 0) or 0)) + out.ok = True + out.seconds = clock() - t_all + return out diff --git a/packages/embeddedci/src/embeddedci/benchpod/prog_devices.README.md b/packages/embeddedci/src/embeddedci/benchpod/prog_devices.README.md new file mode 100644 index 0000000..b199059 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/prog_devices.README.md @@ -0,0 +1,159 @@ +# prog_devices.json + +The device table of the pin programmers (`BenchPod.flash(target="avr-updi" | "pic" | "efm8" | +"attiny-tpi" | "xmega")`, the pod's `prog_flash` command). The pod holds no device tables: it reads +the chip's ID bytes and the host passes the geometry. This file is that table, plain JSON, one chip +per line, so other clients (the CLI) can copy it unchanged. The SDK reads it in +`embeddedci/benchpod/prog.py`. + +## Schema (`"schema": 1`) + +``` +{ "schema": 1, "about": "...", + "families": { "": { "target": "...", "title": "...", "ignore": [...], "devices": [...] } } } +``` + +`` is the pod's `proto`: `updi`, `pic`, `c2`, `tpi`, `pdi`. `target` is the +`flash(target=...)` name of the family (`avr-updi`, `pic`, `efm8`, `attiny-tpi`, `xmega`); the +protocol names are accepted as aliases too. + +`ignore` lists image regions to leave out without an error: `{"hex": address, "size": bytes, +"name": text}` (the AVR lock bits and signature row that an avr-gcc `.elf` carries). + +A device: + +| Key | Meaning | +|---|---| +| `name` | The chip, or the family of chips that share the ID and memories. Matched ignoring case, spaces and dashes. | +| `aliases` | (optional) other names for the same ID, for example `ATxmega16A4` next to `ATxmega16A4U`. | +| `id` | Hex bytes, in the order of the pod's `status.id`. `??` is a byte that varies (a revision). The ID is matched as a prefix of what the pod reports: the pod's `expect_id` is `id` up to its first `??`. | +| `family` | Free text, for messages. | +| `mem` | The chip's memories, keys `flash`, `eeprom`, `config` (AVR fuses, PIC configuration words, C2 lock byte) and `user` (AVR user row, PIC user ID); each omitted when the chip has none or the pod cannot write it. | +| `opts` | Extra fields of every `start` command: `flags` (protocol options) and `cp_addr` (PIC only: the byte address, as `addr` counts, of the configuration word that holds the code-protect bit; the bit number is in `flags`). | +| `vmin_mv`, `vmax_mv` | The supply range the chip can be programmed in, in millivolts, at the pod's I/O voltage (1800 or 3300). A chip whose `vmin_mv` is above the pod's voltage is refused with `vnote` as the reason. | +| `erase_vmin_mv` | (optional) the supply the chip erase needs: below it the erase can be ignored, so a `chip` erase is refused. | +| `vnote` | (optional) the voltage remark of the datasheet. | +| `notes` | (optional) other remarks. | + +A memory (`mem.`): + +| Key | Meaning | +|---|---| +| `size` | Bytes. | +| `page` | The write page or row in bytes: the `page` of `start`. | +| `addr` | The `addr` of `start` for the memory's first byte (the pod's address space: AVR memories start at 0; PIC addresses are the spec's byte address, 2 per word). | +| `hex` | The address of the memory's first byte in a `.hex` / `.elf` image (avr-gcc: flash 0, EEPROM 0x810000, fuses 0x820000, user row 0x850000; PIC: see below). | +| `align` | (optional) region start and end unit in bytes; default: `page` for flash, 1 otherwise. A partial unit is padded with 0xFF. | +| `stride` | (optional) hex bytes one byte of this memory takes; default 1. | + +To write an image: read the chip's ID with `info`, find the device whose `id` matches, and for every +image run of bytes find the memory whose `hex` range holds it. The pod address of image byte `a` +is `mem.addr + (a - mem.hex) / stride`. Start the regions flash first, `config` last, each as one +`start` with `mem`, `addr`, `len`, `page`, `expect_id`, the `opts`, and `erase: "chip"` on the +first one only (later ones `none`). + +## Sources + +Every family's numbers come from the vendor documents below; where a vendor's tools were used to +cross-check, that is said. Nothing here was run on hardware yet. + +### AVR UPDI (`updi`): tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD + +* Reference datasheets: ATtiny1614/1616/1617 DS40002204 (chapters NVMCTRL and UPDI) and AVR128DA + DS40002183 (the same chapters for NVM version 2); the other chips' datasheets of each family give + the signature (SIGROW), flash, EEPROM and user row sizes and pages. +* The IDs, sizes and pages were read from avrdude's `avrdude.conf` (`src/avrdude.conf.in`, + github.com/avrdudes/avrdude), which carries them from the Atmel/Microchip device packs, and + checked against the datasheets above. +* The flash base in the AVR data space (`opts.flags`) follows the firmware: 0x8000 for tinyAVR + 0/1/2, 0x4000 for megaAVR 0, 0x800000 for the NVM version 2 parts (DA, DB, DD). +* Left out: AVR DU, EA, EB, LA, SD and the "S" variants (other NVM versions, not handled by the pod + firmware yet). +* Voltage: 1.8-5.5 V for the whole range (the datasheets' operating range; NVM writes are specified + over it). + +### AVR TPI (`tpi`): ATtiny4/5/9/10/20/40/102/104 + +* ATtiny4/5/9/10 DS40002060, ATtiny20 8235, ATtiny40 8263, ATtiny102/104 42505: signatures, flash + size and page, the TPI programming chapters (memory map: lock bits 0x3F00, configuration 0x3F40, + signature 0x3FC0, flash 0x4000), the number of words per flash write (ATtiny20: 2, ATtiny40: 4) + and the page erase of the ATtiny102/104. +* IDs and sizes cross-checked with avrdude's `avrdude.conf`. +* **Voltage:** the ATtiny4/5/9/10, 20 and 40 can be programmed at 5 V only (datasheets: "Apply 5V", + 4.75-5.5 V in the programming tables). The pod's I/O is 1.8 or 3.3 V, so these are marked + `vmin_mv: 4750` and refused with a message. The ATtiny102/104 datasheet gives 1.8-5.5 V in one + section and 5 V in another: they are allowed and the note says to try it. + +### XMEGA PDI (`pdi`) + +* XMEGA AU manual 8331 and the ATxmega datasheets (A4U 8387 and the other chips'): + signatures, flash (application + boot as one space from 0), EEPROM, fuse bytes, user signature row, + the NVM controller. IDs, sizes and pages cross-checked with avrdude's `avrdude.conf`; parts that + share an ID are one entry with `aliases`. +* Voltage: 1.8 to 3.6 V as the table says; the pod's 3.3 V is fine, 1.8 V works when BODLEVEL is + below VCC (datasheet), which the chip's fuses decide. + +### PIC (`pic`) + +Every value was read from Microchip's memory programming specifications (not from memory); most PDFs +came from third-party mirrors, none was cross-checked against an MPLAB DFP or gputils. + +| Family | Specification | Command set (`opts.flags`) | +|---|---|---| +| PIC16F150x | DS41573 | 6-bit, DEV in bits 13:5 of the word at 0x8006 | +| PIC16F151x/152x | DS41442 | 6-bit, packed ID | +| PIC16F170x | DS40001683 | 6-bit, separate REVID word (`id` is the whole DEVID word) | +| PIC16F171x | DS40001714 | 6-bit, separate REVID word | +| PIC16F182x, PIC16F1847 | DS41390 (182x), DS41439 (1847) | 6-bit, packed ID, data EEPROM | +| PIC16F193x | DS41397 | 6-bit, packed ID, data EEPROM | +| PIC16F183xx | DS40001738 | 6-bit (not the 8-bit set), separate REVID word | +| PIC16F184xx | DS40001970 | 8-bit, MSb first | +| PIC16F188xx | DS40001753 | 8-bit | +| PIC18F Q10 | DS40001874 | 8-bit, byte PC, Q10 erase and config words | +| PIC18F Q40 | DS40002185 | 8-bit, byte PC | +| PIC18F Q43 | DS40002079 | 8-bit, byte PC | +| PIC18F Q83, Q84 | DS40002137 | 8-bit, byte PC | + +The LF parts have their own device IDs and are separate entries. `flags` bit values are in +`stm32h563/src/prog_pic.h` of benchpod-firmware. `opts.cp_addr` is the byte address of the +configuration word that holds the code-protect bit (the pod reads it to tell a locked chip), and bits +8..11 of `flags` its bit number; the polarity is 0 = protected on every chip here. +Addresses: flash, configuration words and user ID are the spec's absolute word address times 2 +(PIC16: word 0x8007 is 0x1000E, user ID 0x10000); PIC18 uses the spec's byte addresses (0x200000 user +ID, 0x300000 configuration, 0x380000 EEPROM, 0x310000 on Q10). `hex` equals `addr` for all of them. + +`id` is what the pod reports in `status.id`: the device ID little endian (2 bytes); on the packed 6-bit +chips DEV<8:0> (the DEVID word shifted right by 5) because the revision shares the word. + +Known gaps, so that nothing is written wrongly: + +* **No data EEPROM for PIC16F18xxx and the PIC16F1xxx that have one** (`notes` says so): where an + XC8 `.hex` puts it (0x1E000, two hex bytes per EEPROM byte on PIC16F1xxx per DS41439/41390/41397; not + stated for 184xx/188xx) is not verified, and a wrong layout would be written without any error. + PIC18 EEPROM (hex address = programming address, one byte each) is included. +* **PIC16F1827 and PIC16F193x write 8 words per row but erase 32:** `chip_erase_only` is set and + `page` is the write size, so `erase="page"` is refused. +* **PIC18F Q41, PIC16F150x/151x/152x/170x/171x high-endurance flash and calibration words** are not + covered. PIC18 Q43/Q83/Q84 user ID size is 32 bytes (the spec's range end is inconsistent: 0x20001F + or 0x20003F). +* The LVP key bit order of the 6-bit chips follows the spec text (LSb first, 33 clocks); the firmware + review flagged the same, and it is the first thing to check on a first 6-bit chip. +* `erase_vmin_mv`: bulk erase needs the supply above the chip's brown-out level (2.7 V on the 6-bit + chips and the F18 specs, about 1.9 V on Q10 and Q40, 2.85 V on Q43/Q83/Q84). + +### Silicon Labs C2 (`c2`) + +From the EFM8 reference manuals (BB1, BB2, SB1, SB2, UB1, UB2: Memory Map, Device Identification +Registers, Security Options), read on a Keil-hosted mirror, and the BB1/BB2/UB2 datasheets (flash +table: VPROG 2.2-3.6 V, UB2 2.7-3.6 V). AN127 itself could not be read (silabs.com refused the fetch), so +its device table rows are second-hand. + +* Covered: EFM8BB1 (ID 0x30: BB10F8G, F4G, F2G), BB2 (0x32), SB1 (0x25), SB2 (0x16), UB1 (0x32), UB2 + (0x28). Chips that share an ID differ in size, so the SDK asks for `device=` (BB1's three sizes, BB2 + against UB1). The pod's derivative-ID read is not documented in the reference manuals, so the + derivative ID is not used. +* `flash.size` stops below the flash lock byte (0x1FFF on an 8 KB BB1, 0xFBFF on 64 KB parts): the + lock byte, the lock page's neighbours and the reserved area are never written, and an image with data there is refused. + There is no `config` memory. +* Not covered, because their IDs or maps could not be confirmed: EFM8BB3, LB1 (both read 0x34), UB3, and all C8051F parts. +* FPDAT (0xB4, or 0xAD on EFM8UB2) is picked by the pod from the device ID; the table does not set it. diff --git a/packages/embeddedci/src/embeddedci/benchpod/prog_devices.json b/packages/embeddedci/src/embeddedci/benchpod/prog_devices.json new file mode 100644 index 0000000..8d81dd8 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/prog_devices.json @@ -0,0 +1,327 @@ +{ +"schema":1, +"about":"BenchPod prog_flash device table: see prog_devices.README.md for the schema and the sources of every family.", +"families":{ +"updi":{ +"target":"avr-updi", +"title":"AVR UPDI (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD)", +"ignore":[{"hex":8585216,"size":65536,"name":"lock bits"},{"hex":8650752,"size":65536,"name":"signature row"}], +"devices":[ +{"name":"AVR32DA28","id":"1e9534","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DA32","id":"1e9533","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DA48","id":"1e9532","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DA28","id":"1e9615","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DA32","id":"1e9614","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DA48","id":"1e9613","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DA64","id":"1e9612","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DA28","id":"1e970a","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DA32","id":"1e9709","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DA48","id":"1e9708","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DA64","id":"1e9707","family":"AVR DA","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DB28","id":"1e9537","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DB32","id":"1e9536","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DB48","id":"1e9535","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DB28","id":"1e9619","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DB32","id":"1e9618","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DB48","id":"1e9617","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DB64","id":"1e9616","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DB28","id":"1e970e","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DB32","id":"1e970d","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DB48","id":"1e970c","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR128DB64","id":"1e970b","family":"AVR DB","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":131072,"page":512,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR16DD14","id":"1e9434","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":16384,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR16DD20","id":"1e9433","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":16384,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR16DD28","id":"1e9432","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":16384,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR16DD32","id":"1e9431","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":16384,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DD14","id":"1e953b","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DD20","id":"1e953a","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DD28","id":"1e9539","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR32DD32","id":"1e9538","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":32768,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DD14","id":"1e961d","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DD20","id":"1e961c","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DD28","id":"1e961b","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"AVR64DD32","id":"1e961a","family":"AVR DD","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8388608},"mem":{"flash":{"size":65536,"page":512,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":16,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATmega808","id":"1e9326","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATmega809","id":"1e932a","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATmega1608","id":"1e9427","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATmega1609","id":"1e9426","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATmega3208","id":"1e9530","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":64,"page":64,"addr":0,"hex":8716288}}}, +{"name":"ATmega3209","id":"1e9531","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":64,"page":64,"addr":0,"hex":8716288}}}, +{"name":"ATmega4808","id":"1e9650","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":49152,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":64,"page":64,"addr":0,"hex":8716288}}}, +{"name":"ATmega4809","id":"1e9651","family":"megaAVR 0","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":16384},"mem":{"flash":{"size":49152,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":64,"page":64,"addr":0,"hex":8716288}}}, +{"name":"ATtiny202","id":"1e9123","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":2048,"page":64,"addr":0,"hex":0},"eeprom":{"size":64,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny204","id":"1e9122","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":2048,"page":64,"addr":0,"hex":0},"eeprom":{"size":64,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny212","id":"1e9121","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":2048,"page":64,"addr":0,"hex":0},"eeprom":{"size":64,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny214","id":"1e9120","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":2048,"page":64,"addr":0,"hex":0},"eeprom":{"size":64,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny402","id":"1e9227","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny404","id":"1e9226","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny406","id":"1e9225","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny412","id":"1e9223","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny414","id":"1e9222","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny416","id":"1e9221","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny417","id":"1e9220","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny424","id":"1e922c","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny426","id":"1e922b","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny427","id":"1e922a","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny804","id":"1e9325","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny806","id":"1e9324","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny807","id":"1e9323","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny814","id":"1e9322","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny816","id":"1e9321","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny817","id":"1e9320","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny824","id":"1e9329","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny826","id":"1e9328","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny827","id":"1e9327","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0},"eeprom":{"size":128,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1604","id":"1e9425","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1606","id":"1e9424","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1607","id":"1e9423","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1614","id":"1e9422","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1616","id":"1e9421","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1617","id":"1e9420","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1624","id":"1e942a","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1626","id":"1e9429","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny1627","id":"1e9428","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0},"eeprom":{"size":256,"page":32,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny3216","id":"1e9521","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":64,"page":64,"addr":0,"hex":8716288}}}, +{"name":"ATtiny3217","id":"1e9522","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":64,"page":64,"addr":0,"hex":8716288}}}, +{"name":"ATtiny3224","id":"1e9528","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny3226","id":"1e9527","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}}, +{"name":"ATtiny3227","id":"1e9526","family":"tinyAVR 0/1/2","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":32768},"mem":{"flash":{"size":32768,"page":128,"addr":0,"hex":0},"eeprom":{"size":256,"page":64,"addr":0,"hex":8454144},"config":{"size":10,"page":1,"addr":0,"hex":8519680},"user":{"size":32,"page":32,"addr":0,"hex":8716288}}} +] +}, +"pic":{ +"target":"pic", +"title":"PIC ICSP, low-voltage entry (PIC16F1xxx, PIC16F18xxx, PIC18F Q10/Q40/Q43/Q83/Q84)", +"devices":[ +{"name":"PIC16F1847","id":"a400","family":"PIC16F1847","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1847","id":"a500","family":"PIC16F1847","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1823","id":"3901","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1823","id":"4101","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1824","id":"3a01","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1824","id":"4201","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1825","id":"3b01","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1825","id":"4301","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1827","id":"3d01","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1827","id":"4501","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1828","id":"3e01","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1828","id":"4601","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1829","id":"3f01","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1829","id":"4701","family":"PIC16F182x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1933","id":"1801","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1933","id":"2001","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1934","id":"1a01","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1934","id":"2201","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1936","id":"1b01","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1936","id":"2301","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1937","id":"1c01","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1937","id":"2401","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1938","id":"1d01","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1938","id":"2501","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1939","id":"1e01","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16LF1939","id":"2601","family":"PIC16F193x","vmin_mv":2100,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1796,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":16,"addr":0,"hex":0,"align":16},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"chip_erase_only":true,"notes":"data EEPROM is not written: how an XC8 .hex lays it out (0x1E000) is not verified"}, +{"name":"PIC16F1503","id":"6701","family":"PIC16F150x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1503","id":"6d01","family":"PIC16F150x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1507","id":"6801","family":"PIC16F150x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1507","id":"6e01","family":"PIC16F150x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1508","id":"6901","family":"PIC16F150x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1508","id":"6f01","family":"PIC16F150x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1509","id":"6a01","family":"PIC16F150x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1509","id":"7001","family":"PIC16F150x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1516","id":"b400","family":"PIC16F151x/152x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1516","id":"bc00","family":"PIC16F151x/152x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1517","id":"b500","family":"PIC16F151x/152x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1517","id":"bd00","family":"PIC16F151x/152x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1518","id":"b600","family":"PIC16F151x/152x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1518","id":"be00","family":"PIC16F151x/152x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1519","id":"b700","family":"PIC16F151x/152x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1519","id":"bf00","family":"PIC16F151x/152x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1526","id":"ac00","family":"PIC16F151x/152x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1526","id":"ae00","family":"PIC16F151x/152x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1527","id":"ad00","family":"PIC16F151x/152x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1527","id":"af00","family":"PIC16F151x/152x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1792,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1703","id":"6130","family":"PIC16F170x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1703","id":"6330","family":"PIC16F170x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1704","id":"4330","family":"PIC16F170x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1704","id":"4530","family":"PIC16F170x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1705","id":"5530","family":"PIC16F170x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1705","id":"5730","family":"PIC16F170x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1707","id":"6030","family":"PIC16F170x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1707","id":"6230","family":"PIC16F170x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":4096,"page":32,"addr":0,"hex":0,"align":32},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1708","id":"4230","family":"PIC16F170x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1708","id":"4430","family":"PIC16F170x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1709","id":"5430","family":"PIC16F170x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1709","id":"5630","family":"PIC16F170x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1713","id":"4930","family":"PIC16F171x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1713","id":"4b30","family":"PIC16F171x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1716","id":"4830","family":"PIC16F171x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1716","id":"4a30","family":"PIC16F171x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1717","id":"5c30","family":"PIC16F171x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1717","id":"5f30","family":"PIC16F171x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1718","id":"5b30","family":"PIC16F171x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1718","id":"5e30","family":"PIC16F171x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F1719","id":"5a30","family":"PIC16F171x","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16LF1719","id":"5d30","family":"PIC16F171x","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1824,"cp_addr":65550},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":4,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}}}, +{"name":"PIC16F18313","id":"6630","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18313","id":"6830","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18323","id":"6730","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18323","id":"6930","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18324","id":"3a30","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18324","id":"3c30","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18344","id":"3b30","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18344","id":"3d30","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18325","id":"3e30","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18325","id":"4030","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18345","id":"3f30","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18345","id":"4130","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18326","id":"a430","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18326","id":"a630","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18346","id":"a530","family":"PIC16F183xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18346","id":"a730","family":"PIC16F183xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":36,"cp_addr":65556},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":8,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18424","id":"ca30","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18424","id":"cb30","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18425","id":"cc30","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18425","id":"cd30","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18426","id":"d230","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18426","id":"d330","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18444","id":"ce30","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18444","id":"cf30","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18445","id":"d030","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18445","id":"d130","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18446","id":"d430","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18446","id":"d530","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18455","id":"d730","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18455","id":"d830","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18456","id":"d930","family":"PIC16F184xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18456","id":"da30","family":"PIC16F184xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18854","id":"6a30","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18854","id":"6b30","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":8192,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18855","id":"6c30","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18855","id":"6e30","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18875","id":"6d30","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18875","id":"6f30","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":16384,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18856","id":"7030","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18856","id":"7230","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18876","id":"7130","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18876","id":"7330","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":32768,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18857","id":"7430","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":65536,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18857","id":"7630","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":65536,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16F18877","id":"7530","family":"PIC16F188xx","vmin_mv":2300,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":65536,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC16LF18877","id":"7730","family":"PIC16F188xx","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2700,"opts":{"flags":1,"cp_addr":65558},"mem":{"flash":{"size":65536,"page":64,"addr":0,"hex":0,"align":64},"config":{"size":10,"page":2,"addr":65550,"hex":65550,"align":2},"user":{"size":8,"page":2,"addr":65536,"hex":65536,"align":2}},"notes":"data EEPROM is not written: its hex-file address is not verified"}, +{"name":"PIC18F24Q10","id":"c071","family":"PIC18-Q10","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":19,"cp_addr":3145736},"mem":{"flash":{"size":16384,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":256,"page":1,"addr":3211264,"hex":3211264,"align":1},"config":{"size":12,"page":2,"addr":3145728,"hex":3145728,"align":2},"user":{"size":256,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F25Q10","id":"a071","family":"PIC18-Q10","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":19,"cp_addr":3145736},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3211264,"hex":3211264,"align":1},"config":{"size":12,"page":2,"addr":3145728,"hex":3145728,"align":2},"user":{"size":256,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F26Q10","id":"8071","family":"PIC18-Q10","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":19,"cp_addr":3145736},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3211264,"hex":3211264,"align":1},"config":{"size":12,"page":2,"addr":3145728,"hex":3145728,"align":2},"user":{"size":256,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F45Q10","id":"4071","family":"PIC18-Q10","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":19,"cp_addr":3145736},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3211264,"hex":3211264,"align":1},"config":{"size":12,"page":2,"addr":3145728,"hex":3145728,"align":2},"user":{"size":256,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F46Q10","id":"2071","family":"PIC18-Q10","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":19,"cp_addr":3145736},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3211264,"hex":3211264,"align":1},"config":{"size":12,"page":2,"addr":3145728,"hex":3145728,"align":2},"user":{"size":256,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F04Q40","id":"4076","family":"PIC18-Q40","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":3,"cp_addr":3145736},"mem":{"flash":{"size":16384,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":512,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":9,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F05Q40","id":"0076","family":"PIC18-Q40","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":3,"cp_addr":3145736},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":512,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":9,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F06Q40","id":"c075","family":"PIC18-Q40","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":3,"cp_addr":3145736},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":512,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":9,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F14Q40","id":"2076","family":"PIC18-Q40","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":3,"cp_addr":3145736},"mem":{"flash":{"size":16384,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":512,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":9,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F15Q40","id":"e075","family":"PIC18-Q40","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":3,"cp_addr":3145736},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":512,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":9,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F16Q40","id":"a075","family":"PIC18-Q40","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":1900,"opts":{"flags":3,"cp_addr":3145736},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":512,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":9,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F24Q43","id":"6073","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":16384,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F25Q43","id":"c073","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F26Q43","id":"2074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F27Q43","id":"8074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F44Q43","id":"8073","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":16384,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F45Q43","id":"e073","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F46Q43","id":"4074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F47Q43","id":"a074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F54Q43","id":"a073","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":16384,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F55Q43","id":"0074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":32768,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F56Q43","id":"6074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F57Q43","id":"c074","family":"PIC18-Q43","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":10,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F26Q83","id":"0699","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F27Q83","id":"0999","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F46Q83","id":"0799","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F47Q83","id":"0a99","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F56Q83","id":"0899","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F57Q83","id":"0b99","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F26Q84","id":"0099","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F27Q84","id":"0399","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F46Q84","id":"0199","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F47Q84","id":"0499","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F56Q84","id":"0299","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":65536,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}}, +{"name":"PIC18F57Q84","id":"0599","family":"PIC18-Q83/Q84","vmin_mv":1800,"vmax_mv":5500,"erase_vmin_mv":2850,"opts":{"flags":3,"cp_addr":3145737},"mem":{"flash":{"size":131072,"page":256,"addr":0,"hex":0,"align":256},"eeprom":{"size":1024,"page":1,"addr":3670016,"hex":3670016,"align":1},"config":{"size":35,"page":1,"addr":3145728,"hex":3145728,"align":1},"user":{"size":32,"page":2,"addr":2097152,"hex":2097152,"align":2}}} +] +}, +"c2":{ +"target":"efm8", +"title":"Silicon Labs C2 (EFM8)", +"devices":[ +{"name":"EFM8BB10F8G","id":"30","family":"EFM8 Busy Bee 1","mem":{"flash":{"size":8191,"page":512,"addr":0,"hex":0,"align":1}},"vmin_mv":2200,"vmax_mv":3600,"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8BB10F4G","id":"30","family":"EFM8 Busy Bee 1","mem":{"flash":{"size":4095,"page":512,"addr":0,"hex":0,"align":1}},"vmin_mv":2200,"vmax_mv":3600,"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8BB10F2G","id":"30","family":"EFM8 Busy Bee 1","mem":{"flash":{"size":2047,"page":512,"addr":0,"hex":0,"align":1}},"vmin_mv":2200,"vmax_mv":3600,"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8BB21F16G","id":"32","family":"EFM8 Busy Bee 2","mem":{"flash":{"size":16384,"page":512,"addr":0,"hex":0,"align":1}},"vmin_mv":2200,"vmax_mv":3600,"notes":"BB22F16G is the same; shares ID 0x32 with the EFM8UB1: pass device=","aliases":["EFM8BB22F16G"]}, +{"name":"EFM8UB10F16G","id":"32","family":"EFM8 Universal Bee 1","mem":{"flash":{"size":16384,"page":512,"addr":0,"hex":0,"align":1}},"notes":"UB11F16G is the same; shares ID 0x32 with the EFM8BB2: pass device=","aliases":["EFM8UB11F16G"]}, +{"name":"EFM8UB10F8G","id":"32","family":"EFM8 Universal Bee 1","mem":{"flash":{"size":8192,"page":512,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8SB10F8G","id":"25","family":"EFM8 Sleepy Bee 1","mem":{"flash":{"size":8191,"page":512,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8SB10F4G","id":"25","family":"EFM8 Sleepy Bee 1","mem":{"flash":{"size":4095,"page":512,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8SB10F2G","id":"25","family":"EFM8 Sleepy Bee 1","mem":{"flash":{"size":2047,"page":512,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8SB20F64G","id":"16","family":"EFM8 Sleepy Bee 2","mem":{"flash":{"size":64511,"page":1024,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8SB20F32G","id":"16","family":"EFM8 Sleepy Bee 2","mem":{"flash":{"size":32767,"page":1024,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8SB20F16G","id":"16","family":"EFM8 Sleepy Bee 2","mem":{"flash":{"size":16383,"page":1024,"addr":0,"hex":0,"align":1}},"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8UB20F64G","id":"28","family":"EFM8 Universal Bee 2","mem":{"flash":{"size":64511,"page":512,"addr":0,"hex":0,"align":1}},"vmin_mv":2700,"vmax_mv":3600,"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"}, +{"name":"EFM8UB20F32G","id":"28","family":"EFM8 Universal Bee 2","mem":{"flash":{"size":32767,"page":512,"addr":0,"hex":0,"align":1}},"vmin_mv":2700,"vmax_mv":3600,"notes":"flash up to the lock byte; the lock byte, the reserved area and the lock page are never written"} +] +}, +"tpi":{ +"target":"attiny-tpi", +"title":"AVR TPI (ATtiny4/5/9/10/20/40/102/104)", +"ignore":[{"hex":8585216,"size":65536,"name":"lock bits"},{"hex":8650752,"size":65536,"name":"signature row"}], +"devices":[ +{"name":"ATtiny4","id":"1e8f0a","family":"ATtiny TPI","vmin_mv":4750,"vmax_mv":5500,"opts":{"flags":0},"mem":{"flash":{"size":512,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":2,"addr":0,"hex":8519680}},"vnote":"programs at 5 V only (datasheet: apply 5 V, 4.75-5.5 V); the pod's 1.8 and 3.3 V I/O cannot"}, +{"name":"ATtiny5","id":"1e8f09","family":"ATtiny TPI","vmin_mv":4750,"vmax_mv":5500,"opts":{"flags":0},"mem":{"flash":{"size":512,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":2,"addr":0,"hex":8519680}},"vnote":"programs at 5 V only (datasheet: apply 5 V, 4.75-5.5 V); the pod's 1.8 and 3.3 V I/O cannot"}, +{"name":"ATtiny9","id":"1e9008","family":"ATtiny TPI","vmin_mv":4750,"vmax_mv":5500,"opts":{"flags":0},"mem":{"flash":{"size":1024,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":2,"addr":0,"hex":8519680}},"vnote":"programs at 5 V only (datasheet: apply 5 V, 4.75-5.5 V); the pod's 1.8 and 3.3 V I/O cannot"}, +{"name":"ATtiny10","id":"1e9003","family":"ATtiny TPI","vmin_mv":4750,"vmax_mv":5500,"opts":{"flags":0},"mem":{"flash":{"size":1024,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":2,"addr":0,"hex":8519680}},"vnote":"programs at 5 V only (datasheet: apply 5 V, 4.75-5.5 V); the pod's 1.8 and 3.3 V I/O cannot"}, +{"name":"ATtiny20","id":"1e910f","family":"ATtiny TPI","vmin_mv":4750,"vmax_mv":5500,"opts":{"flags":2},"mem":{"flash":{"size":2048,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":4,"addr":0,"hex":8519680}},"vnote":"programs at 5 V only (datasheet: apply 5 V, 4.75-5.5 V); the pod's 1.8 and 3.3 V I/O cannot"}, +{"name":"ATtiny40","id":"1e920e","family":"ATtiny TPI","vmin_mv":4750,"vmax_mv":5500,"opts":{"flags":4},"mem":{"flash":{"size":4096,"page":64,"addr":0,"hex":0},"config":{"size":1,"page":8,"addr":0,"hex":8519680}},"vnote":"programs at 5 V only (datasheet: apply 5 V, 4.75-5.5 V); the pod's 1.8 and 3.3 V I/O cannot"}, +{"name":"ATtiny102","id":"1e900c","family":"ATtiny TPI","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8},"mem":{"flash":{"size":1024,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":2,"addr":0,"hex":8519680}},"vnote":"datasheet gives 1.8-5.5 V in one section and 5 V in another; try it at 3.3 V"}, +{"name":"ATtiny104","id":"1e900b","family":"ATtiny TPI","vmin_mv":1800,"vmax_mv":5500,"opts":{"flags":8},"mem":{"flash":{"size":1024,"page":16,"addr":0,"hex":0},"config":{"size":1,"page":2,"addr":0,"hex":8519680}},"vnote":"datasheet gives 1.8-5.5 V in one section and 5 V in another; try it at 3.3 V"} +] +}, +"pdi":{ +"target":"xmega", +"title":"XMEGA PDI", +"ignore":[{"hex":8585216,"size":65536,"name":"lock bits"},{"hex":8650752,"size":65536,"name":"signature row"}], +"devices":[ +{"name":"ATxmega8E5","id":"1e9341","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":10240,"page":128,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":7,"page":1,"addr":0,"hex":8519680},"user":{"size":128,"page":128,"addr":0,"hex":8716288}}}, +{"name":"ATxmega16A4U","id":"1e9441","family":"XMEGA","aliases":["ATxmega16A4"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":20480,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega16C4","id":"1e9443","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":20480,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega16D4","id":"1e9442","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":20480,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega16E5","id":"1e9445","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":20480,"page":128,"addr":0,"hex":0},"eeprom":{"size":512,"page":32,"addr":0,"hex":8454144},"config":{"size":7,"page":1,"addr":0,"hex":8519680},"user":{"size":128,"page":128,"addr":0,"hex":8716288}}}, +{"name":"ATxmega32A4U","id":"1e9541","family":"XMEGA","aliases":["ATxmega32A4"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":36864,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega32C3","id":"1e9549","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":36864,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega32C4","id":"1e9544","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":36864,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega32D3","id":"1e954a","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":36864,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega32D4","id":"1e9542","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":36864,"page":256,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega32E5","id":"1e954c","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":36864,"page":128,"addr":0,"hex":0},"eeprom":{"size":1024,"page":32,"addr":0,"hex":8454144},"config":{"size":7,"page":1,"addr":0,"hex":8519680},"user":{"size":128,"page":128,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64A1","id":"1e964e","family":"XMEGA","aliases":["ATxmega64A1U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64A3","id":"1e9642","family":"XMEGA","aliases":["ATxmega64A3U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64A4U","id":"1e9646","family":"XMEGA","aliases":["ATxmega64A4"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64B1","id":"1e9652","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64B3","id":"1e9651","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64C3","id":"1e9649","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64D3","id":"1e964a","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega64D4","id":"1e9647","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":69632,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128A1","id":"1e974c","family":"XMEGA","aliases":["ATxmega128A1U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128A1revD","id":"1e9741","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128A3","id":"1e9742","family":"XMEGA","aliases":["ATxmega128A3U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128A4","id":"1e9746","family":"XMEGA","aliases":["ATxmega128A4U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128B1","id":"1e974d","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128B3","id":"1e974b","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":256,"page":256,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128C3","id":"1e9752","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128D3","id":"1e9748","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega128D4","id":"1e9747","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":139264,"page":256,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega192A1","id":"1e974e","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":204800,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega192A3","id":"1e9744","family":"XMEGA","aliases":["ATxmega192A3U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":204800,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega192C3","id":"1e9751","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":204800,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega192D3","id":"1e9749","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":204800,"page":512,"addr":0,"hex":0},"eeprom":{"size":2048,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega256A3","id":"1e9842","family":"XMEGA","aliases":["ATxmega256A3U"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":270336,"page":512,"addr":0,"hex":0},"eeprom":{"size":4096,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega256A3B","id":"1e9843","family":"XMEGA","aliases":["ATxmega256A3BU"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":270336,"page":512,"addr":0,"hex":0},"eeprom":{"size":4096,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega256C3","id":"1e9846","family":"XMEGA","aliases":["ATxmega256A1"],"vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":270336,"page":512,"addr":0,"hex":0},"eeprom":{"size":4096,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega256D3","id":"1e9844","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":270336,"page":512,"addr":0,"hex":0},"eeprom":{"size":4096,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega384C3","id":"1e9845","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":401408,"page":512,"addr":0,"hex":0},"eeprom":{"size":4096,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}}, +{"name":"ATxmega384D3","id":"1e9847","family":"XMEGA","vmin_mv":1800,"vmax_mv":3600,"opts":{"flags":0},"mem":{"flash":{"size":401408,"page":512,"addr":0,"hex":0},"eeprom":{"size":4096,"page":32,"addr":0,"hex":8454144},"config":{"size":6,"page":1,"addr":0,"hex":8519680},"user":{"size":512,"page":512,"addr":0,"hex":8716288}}} +] +} +} +} diff --git a/packages/embeddedci/tests/api_surface.json b/packages/embeddedci/tests/api_surface.json index 7f2cf20..a0d838e 100644 --- a/packages/embeddedci/tests/api_surface.json +++ b/packages/embeddedci/tests/api_surface.json @@ -131,7 +131,7 @@ "enable_pullup": "(self, *las: 'Union[Pin, int]') -> 'None'", "enabled_pulls": "(self) -> 'List[int]'", "expansion": "(self, chip: 'Optional[str]' = '', *, addr: 'Union[int, Sequence[int], None]' = None, sda: 'Union[Pin, int, str, None]' = None, scl: 'Union[Pin, int, str, None]' = None, spi: 'Union[Sequence[Union[Pin, int, str]], Mapping[str, Union[Pin, int, str]], None]' = None, load: 'Union[Pin, int, str, None]' = None, count: 'Optional[int]' = None, hz: 'Optional[int]' = None, pullups: 'Optional[str]' = None, names: 'Union[Mapping[Any, str], Sequence[Optional[str]], None]' = None) -> \"'_expansion.ExpansionStatus'\"", - "flash": "(self, *, swclk: 'Union[Pin, int, str, None]' = None, swdio: 'Union[Pin, int, str, None]' = None, tck: 'Union[Pin, int, str, None]' = None, tms: 'Union[Pin, int, str, None]' = None, tdi: 'Union[Pin, int, str, None]' = None, tdo: 'Union[Pin, int, str, None]' = None, trst: 'Union[Pin, int, str, None]' = None, nreset: 'Optional[bool]' = None, target: 'str' = '', file: 'str' = '', load_address: 'str' = '', target_power: 'Optional[Union[Efuse, int]]' = None, verify: 'bool' = True, reset: 'bool' = True, connect_under_reset: 'Optional[bool]' = None, clear_reset_events: 'bool' = True, openocd_bin: 'Optional[str]' = None, extra_configs: 'Sequence[str]' = (), extra_args: 'Sequence[str]' = (), timeout: 'float' = 300.0, connect_attempts: 'int' = 5, check: 'bool' = True, build: 'str' = '', repo: 'str' = '', ref: 'str' = '', artifact: 'str' = '', server_side: 'Optional[bool]' = None, rx: 'Union[Pin, int, str, None]' = None, tx: 'Union[Pin, int, str, None]' = None, boot: 'Union[Pin, int, str, None]' = None) -> 'FlashResult'", + "flash": "(self, *, swclk: 'Union[Pin, int, str, None]' = None, swdio: 'Union[Pin, int, str, None]' = None, tck: 'Union[Pin, int, str, None]' = None, tms: 'Union[Pin, int, str, None]' = None, tdi: 'Union[Pin, int, str, None]' = None, tdo: 'Union[Pin, int, str, None]' = None, trst: 'Union[Pin, int, str, None]' = None, nreset: 'Optional[bool]' = None, target: 'str' = '', file: 'str' = '', load_address: 'str' = '', target_power: 'Optional[Union[Efuse, int]]' = None, verify: 'bool' = True, reset: 'bool' = True, connect_under_reset: 'Optional[bool]' = None, clear_reset_events: 'bool' = True, openocd_bin: 'Optional[str]' = None, extra_configs: 'Sequence[str]' = (), extra_args: 'Sequence[str]' = (), timeout: 'float' = 300.0, connect_attempts: 'int' = 5, check: 'bool' = True, build: 'str' = '', repo: 'str' = '', ref: 'str' = '', artifact: 'str' = '', server_side: 'Optional[bool]' = None, rx: 'Union[Pin, int, str, None]' = None, tx: 'Union[Pin, int, str, None]' = None, boot: 'Union[Pin, int, str, None]' = None, device: 'str' = '', clk: 'Union[Pin, int, str, None]' = None, data: 'Union[Pin, int, str, None]' = None, reset_pin: 'Union[Pin, int, str, None]' = None, erase: 'str' = 'chip', dry_run: 'bool' = False) -> 'FlashResult'", "fpga_image": "(self, image: 'Union[FpgaImage, int]') -> 'FpgaImageInfo'", "generate": "(self, waveform: 'Waveshape' = 'sine', *, freq_hz: 'float', amplitude: 'float', offset: 'Optional[float]' = None, dac_path: 'Optional[DacPath]' = None, duration: 'Optional[float]' = None, sample_rate_hz: 'Optional[float]' = None, on_capture: 'bool' = False, route: 'bool' = True) -> 'DacHandle'", "get_la_voltage": "(self) -> 'LaVoltage'", @@ -1007,6 +1007,13 @@ "from_reply": "(cls, reply: 'Any') -> \"'PowerStatus'\"", "rail": "(self, efuse: \"'Efuse | int'\") -> 'RailPower'" }, + "ProgDeviceError": {}, + "ProgFlashError": { + "__init__": "(self, message: 'str', *, result: 'str' = '', phase: 'str' = '', mem: 'str' = '', addr: 'Optional[int]' = None, at_addr: 'Optional[int]' = None) -> 'None'" + }, + "ProgLockedError": {}, + "ProgNoAnswerError": {}, + "ProgVerifyError": {}, "PullConflictError": { "__init__": "(self, message: 'str', *, cmd: 'Optional[str]' = None, la: 'int' = 0) -> 'None'" }, @@ -1709,6 +1716,11 @@ "PowerProfile", "PowerProfileSession", "PowerStatus", + "ProgDeviceError", + "ProgFlashError", + "ProgLockedError", + "ProgNoAnswerError", + "ProgVerifyError", "PullConflictError", "PullDirectionError", "PullState", diff --git a/packages/embeddedci/tests/conftest.py b/packages/embeddedci/tests/conftest.py index c602db2..0c381f6 100644 --- a/packages/embeddedci/tests/conftest.py +++ b/packages/embeddedci/tests/conftest.py @@ -22,6 +22,9 @@ def pytest_configure(config): "markers", "bench_needs(*names): the e2e test uses these optional bench resources (free " "LA channels and the like, e2e/e2e_bench.py NEEDS); it skips when the bench sets them to " "'none'") + config.addinivalue_line( + "markers", "prog: the e2e test flashes a chip over its programming pins (UPDI, PIC, C2, TPI, " + "PDI; needs BENCHPOD_E2E_PROG and firmware with the prog_flash feature, else it skips)") config.addinivalue_line( "markers", "firmware_3: the test's fake pod is firmware 3.x on purpose (no api in its " "status): conftest does not read it as firmware 4.0") diff --git a/packages/embeddedci/tests/e2e/README.md b/packages/embeddedci/tests/e2e/README.md index c451957..597fc40 100644 --- a/packages/embeddedci/tests/e2e/README.md +++ b/packages/embeddedci/tests/e2e/README.md @@ -37,6 +37,7 @@ its `args` for the DUT tier. | rev3 | `test_e2e_rev3.py` | `--benchpod-connection` on a rev3 pod; `BENCHPOD_E2E_NRST_LA` for the wire checks | board strap (v3, ~3.0 V), 1.8 V bank read back from the mux status pin, pulls at 1.8 V (kept across the switch, a pull-up and a pull-down engaged at 1.8 V; firmware before `la_pull_1v8`: released and refused), GPIO + capture on the 1.8 V bank, reset pin hold/release/pulse, pulses capped at 1 s, and with the jumper: the reset line open-drain to the bank rail at 3.3 V and 1.8 V and the pulse width on the wire; USB-C CC report consistency (and a cable seen with `BENCHPOD_E2E_USB_CC=1`) | | dut | `test_e2e_dut.py` | + `--benchpod-firmware` and the wired board | SWD flash, boot banner via power cycle, power monitor + eFuse see the board, interactive console (help/status/reset), firmware detects the emulated BMP280, firmware reports a missing sensor, the emulated sensor's bus capture sees the boot probe, a 4 s logic capture of the boot decodes the chip-id read (and every transaction the pod served) and the UART banner; power profiles of a boot, of a delayed power-on and of an unpowered rail; with `BENCHPOD_E2E_NRESET=1` (rev3): flash under reset, a reset pulse reboots the DUT with the rail up, a held reset keeps it quiet until released | | digital | `test_e2e_digital.py` | `--benchpod-connection` on a digital-only pod (skips on the analog board) | status says `analog: false` and drops the analog capabilities; every analog call (DAC, ADC, 4-20 mA, ADC capture, correlated capture with ADC samples, generate, replay) fails fast with `UnsupportedFeatureError` (`feature="analog"`), raw commands carry the pod's own refusal, `dac_stop` still works and the pod still answers and captures LA data afterwards | +| prog | `test_e2e_prog.py` | `BENCHPOD_E2E_PROG` (target and pins of the wired chip), firmware with `prog_flash`; `BENCHPOD_E2E_PROG_FILE` to write | `flash(target="avr-updi" \| "pic" \| "efm8" \| "attiny-tpi" \| "xmega", dry_run=True)` names the chip and writes nothing; with a file: erase, write and read back every page; a wrong `device` is refused before anything is erased | | usb | `test_e2e_usb.py` | `BENCHPOD_E2E_USB` | the text console: status/ping/LA voltage/power, fail-fast hints for everything else | | cloud | `test_e2e_cloud.py` | `BENCHPOD_E2E_CLOUD_DEVICE` + `BENCHPOD_API_KEY` | lease, command channel, tunnel captures, commands during a UART session, waveform library save → replay → delete | diff --git a/packages/embeddedci/tests/e2e/test_e2e_prog.py b/packages/embeddedci/tests/e2e/test_e2e_prog.py new file mode 100644 index 0000000..3cf9d95 --- /dev/null +++ b/packages/embeddedci/tests/e2e/test_e2e_prog.py @@ -0,0 +1,76 @@ +"""Tier "prog": flashing a chip over its own programming pins (UPDI, PIC, C2, TPI, PDI). + + BENCHPOD_E2E_PROG=avr-updi,data=12 BENCHPOD_E2E_PROG_FILE=app.hex \ + pytest packages/embeddedci/tests/e2e/test_e2e_prog.py --benchpod-connection= + +Needs a chip of one of the pin-programmer families wired to the pod, powered at the LA voltage. +BENCHPOD_E2E_PROG is the ``flash(target=...)`` name followed by the pins as ``name=LA`` pairs +(``clk``, ``data``, ``reset_pin``): ``pic,clk=3,data=4`` or ``attiny-tpi,clk=3,data=4,reset_pin=5``. +Without it the whole tier skips. BENCHPOD_E2E_PROG_DEVICE names the chip to check (optional) and +BENCHPOD_E2E_PROG_FILE is a ``.hex``, ``.elf`` or ``.bin`` for the chip: the write tests skip +without it and ERASE and WRITE the chip. Also skips on firmware without ``prog_flash``. +BENCHPOD_E2E_PROG_REQUIRED=1 turns "no chip answers" into a failure. +""" + +from __future__ import annotations + +import os + +import pytest + +from embeddedci.benchpod import ProgNoAnswerError + +pytestmark = [pytest.mark.hardware, pytest.mark.prog] + + +def _spec(): + raw = os.environ.get("BENCHPOD_E2E_PROG") + if not raw: + pytest.skip("set BENCHPOD_E2E_PROG=,=,... to run the pin-programmer tier " + "(for example avr-updi,data=12)") + target, *pins = [p.strip() for p in raw.split(",") if p.strip()] + kw = {} + for p in pins: + k, _, v = p.partition("=") + kw[k] = int(v) + if os.environ.get("BENCHPOD_E2E_PROG_DEVICE"): + kw["device"] = os.environ["BENCHPOD_E2E_PROG_DEVICE"] + return target, kw + + +@pytest.fixture(scope="module") +def prog_chip(pod): + target, kw = _spec() + if not pod.supports("prog_flash"): + pytest.skip("the pod's firmware has no prog_flash (features table revision 17)") + try: + res = pod.flash(target=target, dry_run=True, **kw) + except ProgNoAnswerError as exc: + why = f"no chip answers on {target} {kw}: {exc}" + if os.environ.get("BENCHPOD_E2E_PROG_REQUIRED") == "1": + pytest.fail(why) + pytest.skip(why + ". Set BENCHPOD_E2E_PROG_REQUIRED=1 to fail instead") + return target, kw, res + + +def test_dry_run_names_the_chip_and_writes_nothing(prog_chip): + _target, _kw, res = prog_chip + assert res.ok and "nothing was written" in res.stdout and "ID " in res.stdout + + +def test_write_the_image_and_read_it_back(pod, prog_chip): + path = os.environ.get("BENCHPOD_E2E_PROG_FILE") + if not path: + pytest.skip("set BENCHPOD_E2E_PROG_FILE to a .hex, .elf or .bin for the chip (it is erased and written)") + target, kw, _res = prog_chip + res = pod.flash(target=target, file=path, **kw) # the pod reads every page back + assert res.ok and "written and verified" in res.stdout + + +def test_wrong_device_is_refused_before_erasing(pod, prog_chip): + target, kw, _res = prog_chip + kw = {k: v for k, v in kw.items() if k != "device"} + from embeddedci.benchpod import ProgDeviceError + + with pytest.raises(ProgDeviceError): + pod.flash(target=target, dry_run=True, device="NoSuchChip-9999", **kw) diff --git a/packages/embeddedci/tests/test_prog_flash.py b/packages/embeddedci/tests/test_prog_flash.py new file mode 100644 index 0000000..52576b7 --- /dev/null +++ b/packages/embeddedci/tests/test_prog_flash.py @@ -0,0 +1,801 @@ +"""Flashing chips over their programming pins (embeddedci.benchpod.prog) against a fake pod.""" + +import json +import struct +from typing import Any, Dict, List, Optional + +import pytest + +from embeddedci.benchpod import BenchPod, prog +from embeddedci.benchpod.errors import (FlashError, PodBusyError, TargetUnreachableError, + UnsupportedFeatureError) +from embeddedci.benchpod.transport.base import Transport +from embeddedci.benchpod.wiring import Wiring + + +# -- a fake pod ---------------------------------------------------------------------------------- + +class FakePod: + """The pod's ``prog_flash`` command: ``info`` and ``start`` run for ``polls`` status calls, then + finish with ``result`` (``info`` reports ``chip_id``).""" + + def __init__(self, chip_id: str = "1e9421", result: str = "ok", polls: int = 2, + info_result: str = "ok", at_addr: Optional[int] = None) -> None: + self.chip_id = chip_id + self.result = result + self.info_result = info_result + self.polls = polls + self.at_addr = at_addr + self.cmds: List[Dict[str, Any]] = [] + self.staged: List[bytes] = [] + self._left = 0 + self._job: Dict[str, Any] = {} + self.fail_command: Optional[Exception] = None + + def stage(self, data: bytes) -> int: + self.staged.append(bytes(data)) + return len(data) + + def command(self, req: Dict[str, Any]) -> Any: + self.cmds.append(dict(req)) + if req.get("cmd") == "la_voltage": + return {"mv": self.mv} if getattr(self, "mv", None) else {} + if req.get("cmd") != "prog_flash": + return {} + if self.fail_command is not None and req["op"] in ("info", "start"): + raise self.fail_command + op = req["op"] + if op in ("start", "info"): + self._job = dict(req) + self._left = self.polls + return {"started": True, "op": op, "proto": req["proto"]} + if op == "abort": + self._left = 0 + return {"running": False, "result": "aborted"} + self._left -= 1 + running = self._left > 0 + info = self._job["op"] == "info" + total = 1 if info else max(1, self._job["len"] // max(1, self._job["page"])) + res = self.info_result if info else self.result + st = {"running": running, "op": self._job["op"], "proto": self._job["proto"], + "phase": "write" if running else "done", "done": 0 if running else total, + "total": total, "id": self.chip_id, "ms": 10, "protos": ["updi", "pic", "c2", "tpi", "pdi"], + "result": None if running else res} + if not running and self.at_addr is not None and res.startswith("verify"): + st["at_addr"] = self.at_addr + return st + + def starts(self) -> List[Dict[str, Any]]: + return [c for c in self.cmds if c.get("cmd") == "prog_flash" and c["op"] == "start"] + + def infos(self) -> List[Dict[str, Any]]: + return [c for c in self.cmds if c.get("cmd") == "prog_flash" and c["op"] == "info"] + + +class FakeTransport(Transport): + def __init__(self, pod: FakePod, features_rev: int = 17) -> None: + self.pod = pod + self.features_rev = features_rev + self.powered: List[Any] = [] + + def command(self, req: Dict[str, Any]) -> Any: + return self.pod.command(req) + + def stage_psram(self, data: bytes) -> int: + return self.pod.stage(data) + + def close(self) -> None: + pass + + def status(self) -> Any: + return {"fpga_image": "deep", "api": 2, "min_client_api": 2, "gateware": 61, + "features_rev": self.features_rev, "version": "4.0.4"} + + def target_power(self, efuse: int, on: bool, delay_ms: int = 0) -> None: + self.powered.append((efuse, on)) + + def uart_proxy_start(self, *a: Any, **k: Any) -> Any: + raise NotImplementedError + + +def make_pod(pod: FakePod, signals=(), **wiring_kw) -> BenchPod: + wiring = {"swd_swclk": 11, "swd_swdio": 12, "signals": list(signals), **wiring_kw} + return BenchPod(transport=FakeTransport(pod), lease=False, wiring=wiring) + + +@pytest.fixture(autouse=True) +def no_sleep(monkeypatch): + monkeypatch.setattr(prog.time, "sleep", lambda s: None) + monkeypatch.setattr("embeddedci.benchpod.client.time.sleep", lambda s: None) + + +# -- image builders ------------------------------------------------------------------------------ + +def ihex(*runs) -> str: + """Intel HEX text for (address, bytes) runs (extended linear address records as needed).""" + out, hi = [], None + + def rec(rtype, addr, data=b""): + raw = bytes([len(data), addr >> 8, addr & 0xFF, rtype]) + bytes(data) + out.append(":" + (raw + bytes([(-sum(raw)) & 0xFF])).hex().upper()) + + for addr, data in runs: + for i in range(0, len(data), 16): + a = addr + i + if (a >> 16) != hi: + hi = a >> 16 + rec(4, 0, struct.pack(">H", hi)) + rec(0, a & 0xFFFF, data[i:i + 16]) + rec(1, 0) + return "\n".join(out) + "\n" + + +def elf32(*segs) -> bytes: + """A minimal 32-bit little-endian ELF with one PT_LOAD per (paddr, bytes).""" + phoff = 52 + hdr = bytearray(52) + hdr[0:4] = b"\x7fELF" + hdr[4], hdr[5], hdr[6] = 1, 1, 1 + struct.pack_into(" str: + p = tmp_path / name + p.write_bytes(content if isinstance(content, bytes) else content.encode()) + return str(p) + + +# -- the table ----------------------------------------------------------------------------------- + +def test_table_loads_every_family(): + fams = prog.families() + assert set(fams) == {"updi", "pic", "c2", "tpi", "pdi"} + for proto, fam in fams.items(): + assert fam.devices, proto + assert prog.TARGETS[fam.target] == proto + + +def test_table_entries_are_consistent(): + for proto, fam in prog.families().items(): + seen = set() + for d in fam.devices: + assert d.id and d.id == d.id.lower() and len(d.expect_id) % 2 == 0, d.name + assert len(d.expect_id) <= 16, d.name + key = (d.id, tuple(sorted(d.mem)), d.name) + assert key not in seen, d.name + seen.add(key) + assert "flash" in d.mem, d.name + spans = [] + for name, m in d.mem.items(): + assert name in prog.MEM_ORDER, (d.name, name) + assert m.size > 0 and m.page > 0 and m.addr >= 0 and m.hex >= 0, (d.name, name) + assert m.size <= 0x400000, (d.name, name) + if name == "flash": + if proto != "c2": # C2 flash stops below the lock byte + assert m.size % m.page == 0, d.name + assert m.align % m.page == 0 or m.page % m.align == 0, d.name + spans.append((m.hex, m.hex + m.size * m.stride, name)) + spans.sort() + for (a0, a1, n0), (b0, _b1, n1) in zip(spans, spans[1:]): + assert a1 <= b0, f"{d.name}: {n0} and {n1} overlap in the image" + assert d.vmin_mv <= d.vmax_mv or not d.vmax_mv, d.name + # names and aliases never collide inside a family + names = [prog._norm(n) for d in fam.devices for n in (d.name, *d.aliases)] + assert len(names) == len(set(names)), proto + + +def test_tpi_five_volt_chips_are_marked(): + tpi = {d.name: d for d in prog.families()["tpi"].devices} + for name in ("ATtiny4", "ATtiny5", "ATtiny9", "ATtiny10", "ATtiny20", "ATtiny40"): + assert tpi[name].vmin_mv >= 4750, name + for name in ("ATtiny102", "ATtiny104"): + assert tpi[name].vmin_mv <= 1800 and tpi[name].opts["flags"] & 8, name + assert tpi["ATtiny20"].opts["flags"] & 7 == 2 and tpi["ATtiny40"].opts["flags"] & 7 == 4 + + +def test_updi_flash_bases(): + by = {d.name: d for d in prog.families()["updi"].devices} + assert by["ATtiny1616"].opts["flags"] == 0x8000 + assert by["ATmega4809"].opts["flags"] == 0x4000 # megaAVR 0: the flash is at 0x4000 + assert by["AVR128DA48"].opts["flags"] == 0x800000 + assert by["ATtiny1616"].id == T1616 and by["ATtiny1616"].mem["flash"].size == 16384 + + +def test_id_matching_with_wildcards(): + assert prog.id_matches("1e9421", "1e9421") + assert prog.id_matches("8014", "80140102") # a longer ID from the pod: a prefix match + assert prog.id_matches("30??0a", "3001 0a".replace(" ", "")) + assert not prog.id_matches("30??0a", "300100") + assert not prog.id_matches("1e9421", "1e94") + assert not prog.id_matches("", "1e") + + +def test_find_device_by_id_name_and_alias(): + dev = prog.find_device("updi", chip_id=T1616) + assert dev.name == "ATtiny1616" and dev.expect_id == T1616 + assert prog.find_device("updi", name="attiny-1616").name == "ATtiny1616" + assert prog.find_device("updi", name="ATtiny1616", chip_id=T1616).name == "ATtiny1616" + xm = prog.find_device("pdi", name="ATxmega16A4U") # ATxmega16A4 shares its ID + assert xm.id == "1e9441" and prog.find_device("pdi", name="ATxmega16A4") is xm + assert prog.find_device("pdi", chip_id="1e9441") is xm + with pytest.raises(prog.ProgDeviceError, match="not in the AVR UPDI"): + prog.find_device("updi", chip_id="1effff") + with pytest.raises(prog.ProgDeviceError, match="device 'ATtiny9999' is not in the AVR UPDI"): + prog.find_device("updi", name="ATtiny9999") + with pytest.raises(prog.ProgDeviceError, match="not a ATtiny1616"): + prog.find_device("updi", name="ATtiny1616", chip_id="1e9220") + with pytest.raises(prog.ProgDeviceError, match="no chip ID"): + prog.find_device("updi") + + +def test_target_aliases(): + for name, proto in (("avr-updi", "updi"), ("updi", "updi"), ("pic", "pic"), ("efm8", "c2"), + ("c2", "c2"), ("attiny-tpi", "tpi"), ("TPI", "tpi"), ("xmega", "pdi"), + ("pdi", "pdi")): + assert prog.protocol_for(name) == proto and prog.is_prog_target(name) + assert not prog.is_prog_target("esp32") and not prog.is_prog_target("target/stm32f4x.cfg") + with pytest.raises(KeyError): + prog.protocol_for("esp32") + + +# -- image files --------------------------------------------------------------------------------- + +def test_ihex_parse_joins_runs_and_extended_addresses(): + segs = prog.parse_ihex(ihex((0, b"\x01\x02\x03"), (3, b"\x04"), (0x810000, b"\xaa\xbb"))) + assert segs == [(0, b"\x01\x02\x03\x04"), (0x810000, b"\xaa\xbb")] + + +def test_ihex_errors(): + good = ihex((0, b"\x01\x02")) + with pytest.raises(ValueError, match="checksum"): + prog.parse_ihex(good.replace(":02000000", ":02000000", 1).replace("0102", "0103", 1)) + with pytest.raises(ValueError, match="not an Intel HEX"): + prog.parse_ihex("hello\n") + with pytest.raises(ValueError, match="record length"): + prog.parse_ihex(":0100000000\n") + with pytest.raises(ValueError, match="not hex"): + prog.parse_ihex(":zz\n") + + +def test_elf_parse_uses_load_addresses(): + segs = prog.parse_elf(elf32((0, b"\x10\x20"), (0x810000, b"\x30"))) + assert segs == [(0, b"\x10\x20"), (0x810000, b"\x30")] + with pytest.raises(ValueError, match="not an ELF"): + prog.parse_elf(b"nope") + big = bytearray(elf32((0, b"\x01"))) + big[4] = 2 # ELFCLASS64 + with pytest.raises(ValueError, match="32-bit"): + prog.parse_elf(bytes(big)) + with pytest.raises(ValueError, match="no loadable"): + prog.parse_elf(elf32()) + + +def test_load_image_by_content(tmp_path): + assert prog.load_image(write(tmp_path, "a.hex", ihex((4, b"\x01")))) == [(4, b"\x01")] + assert prog.load_image(write(tmp_path, "a.elf", elf32((8, b"\x02")))) == [(8, b"\x02")] + assert prog.load_image(write(tmp_path, "a.bin", b"\x03\x04"), load_address=0x20) == [(0x20, b"\x03\x04")] + with pytest.raises(ValueError, match="no image bytes"): + prog.load_image(write(tmp_path, "e.bin", b"")) + + +# -- cutting an image into memories -------------------------------------------------------------- + +def test_split_updi_flash_eeprom_fuses_user_and_ignored_lock(): + dev = prog.find_device("updi", chip_id=T1616) + fam = prog.families()["updi"] + segs = prog.parse_ihex(ihex( + (0, bytes(range(100))), (0x810000, b"\x11\x22"), (0x820000, b"\x00\x01\x02"), + (0x830000, b"\xff"), (0x850000, b"\x55"))) + regions, notes = prog.split_regions(segs, dev, ignore=fam.ignore) + assert [(r.mem, r.addr, len(r.data)) for r in regions] == [ + ("flash", 0, 128), ("eeprom", 0, 2), ("user", 0, 1), ("config", 0, 3)] + assert regions[0].data[:100] == bytes(range(100)) and regions[0].data[100:] == b"\xff" * 28 + assert regions[0].page == 64 and regions[1].page == 32 + assert any("lock bits" in n for n in notes) + + +def test_split_aligns_pages_and_joins_neighbours(): + dev = prog.find_device("updi", chip_id=T1616) + segs = [(10, b"\x01" * 10), (70, b"\x02" * 4), (130, b"\x03")] + regions, _ = prog.split_regions(segs, dev) + assert [(r.addr, len(r.data)) for r in regions] == [(0, 192)] # pages 0, 1 and 2 touch + segs = [(0, b"\x01"), (1024, b"\x02")] + regions, _ = prog.split_regions(segs, dev) + assert [(r.addr, len(r.data)) for r in regions] == [(0, 64), (1024, 64)] # a gap stays a gap + + +def test_split_refuses_data_outside_the_chip(): + dev = prog.find_device("updi", chip_id=T1616) + with pytest.raises(prog.ProgDeviceError, match="0x4000 that is not in any memory.*flash 0x0"): + prog.split_regions([(0x4000, b"\x01")], dev) + with pytest.raises(prog.ProgDeviceError, match="not in any memory"): + prog.split_regions([(0x860000, b"\x01")], dev) + with pytest.raises(prog.ProgDeviceError, match="no bytes"): + prog.split_regions([(0x830000, b"\x01")], dev, ignore=prog.families()["updi"].ignore) + + +def test_split_flash_at_the_end_of_the_chip(): + dev = prog.find_device("updi", chip_id=T1616) + regions, _ = prog.split_regions([(16383, b"\x07")], dev) + assert (regions[0].addr, len(regions[0].data)) == (16384 - 64, 64) + + +def test_split_tpi_config_is_one_word(): + dev = prog.find_device("tpi", name="ATtiny10") + regions, _ = prog.split_regions([(0, b"\x01\x02"), (0x820000, b"\xf7")], dev, + ignore=prog.families()["tpi"].ignore) + cfg = [r for r in regions if r.mem == "config"][0] + assert cfg.addr == 0 and cfg.data == b"\xf7" # the pod pads it to the chip's word + + +def test_split_xmega_regions(): + dev = prog.find_device("pdi", name="ATxmega32A4U") + regions, _ = prog.split_regions( + [(0x0, b"\x01" * 300), (0x810000, b"\x02" * 40), (0x820000, b"\xff\xff\xff\xff\xff\xf7"), + (0x850000, b"\x03" * 10)], dev, ignore=prog.families()["pdi"].ignore) + assert [(r.mem, r.addr, len(r.data), r.page) for r in regions] == [ + ("flash", 0, 512, 256), ("eeprom", 0, 40, 32), ("user", 0, 10, 256), ("config", 0, 6, 1)] + + +# -- the flow through BenchPod.flash ------------------------------------------------------------- + +def app_hex(tmp_path, size=100, extra=()): + return write(tmp_path, "app.hex", ihex((0, bytes(i & 0xFF for i in range(size))), *extra)) + + +def test_flash_updi_full_flow(tmp_path): + pod = FakePod() + bp = make_pod(pod) + res = bp.flash(target="avr-updi", file=app_hex(tmp_path, extra=((0x810000, b"\x01\x02"),))) + assert res.ok and res.returncode == 0 + assert "ATtiny1616" in res.stdout and "flash at 0x0: 128 bytes" in res.stdout + assert "eeprom at 0x0: 2 bytes" in res.stdout and "the chip runs its program" in res.stdout + info = pod.infos()[0] + assert info == {"cmd": "prog_flash", "op": "info", "proto": "updi", "data": 12} + s1, s2 = pod.starts() + assert {k: s1[k] for k in ("proto", "data", "mem", "addr", "len", "page", "erase", "expect_id", + "flags", "run")} == { + "proto": "updi", "data": 12, "mem": "flash", "addr": 0, "len": 128, "page": 64, + "erase": "chip", "expect_id": T1616, "flags": 0x8000, "run": False} + assert (s2["mem"], s2["erase"], s2["run"], s2["len"], s2["page"]) == ("eeprom", "none", True, 2, 32) + assert "clk" not in s1 + assert len(pod.staged) == 2 and len(pod.staged[0]) == 128 and pod.staged[1] == b"\x01\x02" + + +def test_flash_aliases_and_protocol_names(tmp_path): + for target, chip, proto, device in (("updi", T1616, "updi", ""), ("tpi", "1e900c", "tpi", "ATtiny102"), + ("pdi", "1e9441", "pdi", "ATxmega16A4U")): + pod = FakePod(chip_id=chip) + make_pod(pod).flash(target=target, file=app_hex(tmp_path, 10), device=device) + assert pod.starts()[0]["proto"] == proto + assert pod.starts()[0]["data"] == 12 + + +def test_flash_pins_from_arguments_beat_profile_signals(tmp_path): + pod = FakePod(chip_id="1e9441") + bp = make_pod(pod, signals=[{"name": "PDI_CLK", "la": 8}, {"name": "PDI_DATA", "la": 9}]) + bp.flash(target="xmega", file=app_hex(tmp_path, 10)) + assert (pod.starts()[0]["clk"], pod.starts()[0]["data"]) == (8, 9) + bp.flash(target="xmega", file=app_hex(tmp_path, 10), clk=7, data="PDI_DATA") + assert (pod.starts()[1]["clk"], pod.starts()[1]["data"]) == (7, 9) + + +def test_flash_updi_pin_from_signal_and_clk_is_refused(tmp_path): + pod = FakePod() + bp = make_pod(pod, signals=[{"name": "UPDI", "la": 3}]) + bp.flash(target="avr-updi", file=app_hex(tmp_path, 10)) + assert pod.starts()[0]["data"] == 3 + with pytest.raises(ValueError, match="one pin"): + bp.flash(target="avr-updi", file=app_hex(tmp_path, 10), clk=4) + + +def test_flash_missing_pins_say_what_to_set(tmp_path): + bp = BenchPod(transport=FakeTransport(FakePod()), lease=False, wiring=Wiring()) + with pytest.raises(ValueError, match="data was not given.*swd_swdio"): + bp.flash(target="avr-updi", file=app_hex(tmp_path, 10)) + bp = BenchPod(transport=FakeTransport(FakePod()), lease=False, wiring=Wiring(swd_swdio=2)) + with pytest.raises(ValueError, match="clk was not given.*ICSPCLK.*swd_swclk"): + bp.flash(target="pic", file=app_hex(tmp_path, 10)) + with pytest.raises(ValueError, match="different LA pins"): + make_pod(FakePod()).flash(target="xmega", file=app_hex(tmp_path, 10), clk=3, data=3) + + +def test_flash_pic_and_tpi_reset_pin(tmp_path): + pod = FakePod(chip_id="1e900c") + bp = make_pod(pod) + bp.flash(target="attiny-tpi", file=app_hex(tmp_path, 10)) + assert pod.infos()[0]["reset"] == "nrst" # the pod's reset pin by default + bp.flash(target="attiny-tpi", file=app_hex(tmp_path, 10), reset_pin=9) + assert pod.infos()[1]["reset"] == 9 and pod.starts()[1]["reset"] == 9 + bp = make_pod(pod, signals=[{"name": "MCLR", "la": 8}]) + bp.flash(target="attiny-tpi", file=app_hex(tmp_path, 10)) + assert pod.starts()[2]["reset"] == 8 + bp.flash(target="attiny-tpi", file=app_hex(tmp_path, 10), nreset=True) # the pod's pin wins + assert pod.starts()[3]["reset"] == "nrst" + with pytest.raises(ValueError, match="reset_pin must be another"): + bp.flash(target="attiny-tpi", file=app_hex(tmp_path, 10), reset_pin=11) + with pytest.raises(ValueError, match="needs the pod's reset pin"): + make_pod(pod).flash(target="attiny-tpi", file=app_hex(tmp_path, 10), nreset=False) + + +def test_flash_page_erase_and_none_apply_to_every_region(tmp_path): + for erase in ("page", "none"): + pod = FakePod() + make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path, extra=((0x810000, b"\x01"),)), + erase=erase) + assert [s["erase"] for s in pod.starts()] == [erase, erase] + + +def test_flash_chip_erase_only_when_the_image_has_flash(tmp_path): + pod = FakePod() + f = write(tmp_path, "ee.hex", ihex((0x810000, b"\x01\x02"))) + res = make_pod(pod).flash(target="avr-updi", file=f) + assert pod.starts()[0]["erase"] == "page" and "no chip erase" in res.stdout + + +def test_flash_reset_false_holds_the_chip(tmp_path): + pod = FakePod() + res = make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path), reset=False) + assert pod.starts()[-1]["run"] is False and "held in reset" in res.stdout + + +def test_flash_elf_and_bin(tmp_path): + pod = FakePod() + bp = make_pod(pod) + bp.flash(target="avr-updi", file=write(tmp_path, "a.elf", elf32((0, b"\x01" * 70), (0x820000, b"\x02")))) + assert [(s["mem"], s["len"]) for s in pod.starts()] == [("flash", 128), ("config", 1)] + pod2 = FakePod() + make_pod(pod2).flash(target="avr-updi", file=write(tmp_path, "a.bin", b"\x05" * 10), load_address="0x40") + s = pod2.starts()[0] + assert (s["addr"], s["len"]) == (64, 64) and pod2.staged[0] == b"\x05" * 10 + b"\xff" * 54 + + +def test_flash_dry_run_only_reads_the_chip(tmp_path): + pod = FakePod() + res = make_pod(pod).flash(target="avr-updi", dry_run=True) + assert res.ok and "ATtiny1616" in res.stdout and "nothing was written" in res.stdout + assert pod.starts() == [] and pod.staged == [] and len(pod.infos()) == 1 + # with a file too: the file is still not written + res = make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path), dry_run=True) + assert res.ok and pod.starts() == [] + + +def test_flash_power_on_first(tmp_path): + pod = FakePod() + bp = make_pod(pod) + bp.flash(target="avr-updi", file=app_hex(tmp_path), target_power=1) + assert bp._transport.powered == [(1, True)] + + +# -- refusals before anything is written --------------------------------------------------------- + +def test_flash_requires_a_file_unless_dry_run(): + with pytest.raises(ValueError, match="needs file"): + make_pod(FakePod()).flash(target="avr-updi") + + +def test_flash_bad_erase_and_build_are_refused(tmp_path): + bp = make_pod(FakePod()) + with pytest.raises(ValueError, match="erase must be"): + bp.flash(target="avr-updi", file=app_hex(tmp_path), erase="all") + with pytest.raises(ValueError, match="not an uploaded build"): + bp.flash(target="avr-updi", build="latest") + + +def test_flash_needs_the_feature(): + pod = FakePod() + bp = BenchPod(transport=FakeTransport(pod, features_rev=16), lease=False, + wiring={"swd_swclk": 11, "swd_swdio": 12}) + with pytest.raises(UnsupportedFeatureError, match="prog_flash.*install-blobs") as exc: + bp.flash(target="avr-updi", dry_run=True) + assert exc.value.feature == "prog_flash" and pod.starts() == [] and pod.infos() == [] + assert not bp.supports("prog_flash") + assert make_pod(FakePod()).supports("prog_flash") + + +def test_flash_needs_a_stream_connection(tmp_path): + class Serial(FakeTransport): + stage_psram = None # type: ignore[assignment] + + bp = BenchPod(transport=Serial(FakePod()), lease=False, wiring={"swd_swclk": 11, "swd_swdio": 12}) + with pytest.raises(FlashError, match="network, USB or cloud"): + bp.flash(target="avr-updi", file=app_hex(tmp_path)) + + +def test_flash_unknown_chip_wrong_device_and_ambiguous(tmp_path): + f = app_hex(tmp_path) + with pytest.raises(prog.ProgDeviceError, match="1effff.*not in the AVR UPDI"): + make_pod(FakePod(chip_id="1effff")).flash(target="avr-updi", file=f) + with pytest.raises(prog.ProgDeviceError, match="not a ATtiny1614"): + make_pod(FakePod()).flash(target="avr-updi", file=f, device="ATtiny1614") + with pytest.raises(prog.ProgDeviceError, match="not in the AVR UPDI"): + make_pod(FakePod()).flash(target="avr-updi", file=f, device="ATtiny0") + pod = FakePod() + with pytest.raises(FlashError): + make_pod(pod).flash(target="avr-updi", file=f, device="ATtiny0") + assert pod.starts() == [] + + +def test_flash_image_that_does_not_fit_is_refused_before_writing(tmp_path): + pod = FakePod() + f = write(tmp_path, "big.hex", ihex((0x7000, b"\x01" * 16))) # an ATtiny1616 has 16 KB + with pytest.raises(prog.ProgDeviceError, match="not in any memory"): + make_pod(pod).flash(target="avr-updi", file=f) + assert pod.starts() == [] and pod.staged == [] + + +def test_flash_five_volt_chips_fail_at_3v3(tmp_path): + pod = FakePod(chip_id="1e9003") # ATtiny10 + pod.mv = 3300 + with pytest.raises(prog.ProgDeviceError, match="ATtiny10.*4.75|only be programmed at 4.75 V") as exc: + make_pod(pod).flash(target="attiny-tpi", file=app_hex(tmp_path, 10)) + assert exc.value.result == "voltage" and "level shifter" in str(exc.value) + assert pod.starts() == [] + pod = FakePod(chip_id="1e900c") # ATtiny102: the datasheet is unclear, so it is allowed + pod.mv = 3300 + assert make_pod(pod).flash(target="attiny-tpi", file=app_hex(tmp_path, 10)).ok + pod = FakePod(chip_id="1e9003") + pod.mv = 1800 + with pytest.raises(prog.ProgDeviceError, match="5 V"): + make_pod(pod).flash(target="attiny-tpi", file=app_hex(tmp_path, 10), dry_run=True) + + +def test_flash_voltage_unknown_is_not_checked(tmp_path): + pod = FakePod(chip_id="1e9003") # no la_voltage answer: the pod decides + assert make_pod(pod).flash(target="attiny-tpi", file=app_hex(tmp_path, 10)).ok + + +def test_check_voltage_limits(): + xm = prog.find_device("pdi", name="ATxmega32A4U") + prog.check_voltage(xm, 3.3) + with pytest.raises(prog.ProgDeviceError, match="at most 3.6 V"): + prog.check_voltage(xm, 5.0) + dev = prog.ProgDevice(name="X", family="x", proto="pic", id="01", mem={}, vmin_mv=1800, + vmax_mv=5500, erase_vmin_mv=2700) + with pytest.raises(prog.ProgDeviceError, match="chip erase needs the supply above 2.7 V"): + prog.check_voltage(dev, 1.8, erase="chip") + prog.check_voltage(dev, 1.8, erase="page") + prog.check_voltage(dev, 3.3, erase="chip") + low = prog.ProgDevice(name="Y", family="y", proto="pic", id="01", mem={}, vmin_mv=2000, vmax_mv=5500) + with pytest.raises(prog.ProgDeviceError, match="at least 2 V"): + prog.check_voltage(low, 1.8) + + +# -- the pod's results --------------------------------------------------------------------------- + +@pytest.mark.parametrize("result, exc, text", [ + ("no answer (wiring, power or I/O voltage)", prog.ProgNoAnswerError, "Check the wiring"), + ("wrong chip (the ID is not expect_id)", prog.ProgFlashError, "pass device="), + ("locked (erase the chip to unlock it)", prog.ProgLockedError, 'erase="chip"'), + ("verify failed", prog.ProgVerifyError, "at 0x40"), + ("timeout (the chip stayed busy)", prog.ProgFlashError, "minimum VDD"), + ("protocol error (an answer the protocol does not allow)", prog.ProgFlashError, "keep the lines short"), + ("memory, address, length or page size not valid here", prog.ProgFlashError, "pass device="), + ("could not read the staged image", prog.ProgFlashError, "try again"), + ("not supported (this chip, memory or protocol)", prog.ProgFlashError, "update the pod"), + ("aborted", prog.ProgFlashError, "aborted"), + ("something new the pod says", prog.ProgFlashError, "something new"), +]) +def test_flash_maps_every_result(tmp_path, result, exc, text): + pod = FakePod(result=result, at_addr=0x40) + with pytest.raises(exc, match=text) as ei: + make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path)) + e = ei.value + assert isinstance(e, FlashError) and e.result == result and e.mem == "flash" and e.addr == 0 + assert e.phase == "done" + if result.startswith("verify"): + assert e.at_addr == 0x40 + if result.startswith("no answer"): + assert isinstance(e, TargetUnreachableError) + assert "data on LA12" in str(e) + + +def test_flash_failure_stops_at_the_first_region(tmp_path): + pod = FakePod(result="verify failed") + with pytest.raises(prog.ProgVerifyError): + make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path, extra=((0x810000, b"\x01"),))) + assert len(pod.starts()) == 1 + + +def test_flash_check_false_returns_the_failure(tmp_path): + pod = FakePod(result="no answer (wiring, power or I/O voltage)") + res = make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path), check=False) + assert not res.ok and res.returncode == 1 and res.target_unreachable + assert "did not answer" in res.stderr + pod = FakePod(result="locked (erase the chip to unlock it)") + res = make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path), check=False) + assert not res.ok and not res.target_unreachable and "erase" in res.stderr + + +def test_flash_info_failure_is_reported_before_staging(tmp_path): + pod = FakePod(info_result="no answer (wiring, power or I/O voltage)") + with pytest.raises(prog.ProgNoAnswerError): + make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path)) + assert pod.staged == [] and pod.starts() == [] + + +def test_flash_refusals_from_the_pod_pass_through(tmp_path): + pod = FakePod() + pod.fail_command = PodBusyError("pod busy") + with pytest.raises(PodBusyError): + make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path)) + + +def test_run_times_out_and_aborts(monkeypatch): + class Stuck(FakePod): + def command(self, req): + r = super().command(req) + if req.get("op") == "status" and self._job["op"] == "start": + r["running"] = True + r["result"] = None + r["phase"] = "erase" + return r + + pod = Stuck() + now = [0.0] + + def clock(): + now[0] += 30.0 + return now[0] + + dev = prog.find_device("updi", chip_id=T1616) + reg = prog.Region(mem="flash", addr=0, data=b"\x00" * 64, page=64) + with pytest.raises(prog.ProgFlashError, match="did not finish in time.*erase") as ei: + prog.run(pod.command, pod.stage, "updi", dev, [reg], pins={"data": 3}, clock=clock, + sleep=lambda s: None) + assert ei.value.result == "timeout" and pod.cmds[-1]["op"] == "abort" + + +def test_read_info_times_out(monkeypatch): + class Stuck(FakePod): + def command(self, req): + r = super().command(req) + if req.get("op") == "status": + r["running"] = True + return r + + pod = Stuck() + now = [0.0] + + def clock(): + now[0] += 6.0 + return now[0] + + with pytest.raises(prog.ProgNoAnswerError, match="Check the wiring"): + prog.read_info(pod.command, "updi", {"data": 3}, clock=clock, sleep=lambda s: None, + pin_text="data on LA3") + assert pod.cmds[-1]["op"] == "abort" + + +def test_run_progress_and_erase_validation(): + pod = FakePod(polls=3) + dev = prog.find_device("updi", chip_id=T1616) + reg = prog.Region(mem="flash", addr=0, data=b"\x00" * 128, page=64) + seen = [] + r = prog.run(pod.command, pod.stage, "updi", dev, [reg], pins={"data": 3}, + progress=lambda d, t: seen.append((d, t)), sleep=lambda s: None) + assert r.ok and seen[-1] == (2, 2) and seen[0][0] == 0 + with pytest.raises(ValueError, match="erase must be"): + prog.run(pod.command, pod.stage, "updi", dev, [reg], pins={"data": 3}, erase="x") + with pytest.raises(FlashError, match="network, USB or cloud"): + prog.run(pod.command, None, "updi", dev, [reg], pins={"data": 3}) + + +def test_start_request_options(): + dev = prog.find_device("updi", chip_id=T1616) + reg = prog.Region(mem="config", addr=0, data=b"\x01", page=1) + req = prog.start_request("updi", {"data": 3}, region=reg, dev=dev, erase="none", run_after=True) + assert req == {"cmd": "prog_flash", "op": "start", "proto": "updi", "data": 3, "mem": "config", + "addr": 0, "len": 1, "page": 1, "erase": "none", "run": True, + "expect_id": T1616, "flags": 0x8000} + + +def test_table_json_is_valid_and_documented(): + data = prog.load_table() + assert data["schema"] == 1 + json.dumps(data) + import pathlib + readme = pathlib.Path(prog.__file__).with_name("prog_devices.README.md") + assert readme.exists() and "prog_devices.json" in readme.read_text() + + +# -- PIC and C2 ------------------------------------------------------------------------------ + +def test_pic_ids_and_flags(): + pic = prog.families()["pic"] + d = prog.find_device("pic", chip_id="a4000102") # PIC16F1847: DEV<8:0> of the packed word, then REV + assert d.name == "PIC16F1847" and d.expect_id == "a400" + assert d.opts["flags"] & 4 and (d.opts["flags"] >> 8) & 15 == 7 and d.opts["cp_addr"] == 0x1000E + f18 = prog.find_device("pic", chip_id="d430") # PIC16F18446: separate 8-bit set + assert f18.name == "PIC16F18446" and f18.opts["flags"] == 1 and f18.opts["cp_addr"] == 0x800B * 2 + q = prog.find_device("pic", name="PIC18F27Q43") + assert q.id == "8074" and q.opts["flags"] == 3 and q.opts["cp_addr"] == 0x300009 + assert q.mem["eeprom"].addr == 0x380000 == q.mem["eeprom"].hex + q10 = prog.find_device("pic", name="PIC18F26Q10") + assert q10.opts["flags"] == 3 | 16 and q10.erase_vmin_mv == 1900 + six = prog.find_device("pic", name="PIC16F18313") + assert six.opts["flags"] & 1 == 0 and six.opts["flags"] & 32 # the 6-bit set, separate REVID + assert prog.find_device("pic", name="PIC16LF1847").id != d.id # LF parts have their own IDs + assert len({x.id for x in pic.devices}) == len(pic.devices) + + +def test_pic_split_config_user_and_chip_erase_only(tmp_path): + dev = prog.find_device("pic", name="PIC16F1847") + regions, _ = prog.split_regions( + [(0, b"\x01\x02" * 40), (0x1000E, b"\xff\x3f\xff\x3f"), (0x10000, b"\x01\x00")], dev) + assert [(r.mem, r.addr, len(r.data)) for r in regions] == [ + ("flash", 0, 128), ("user", 0x10000, 2), ("config", 0x1000E, 4)] + low = prog.find_device("pic", name="PIC16F1827") + assert low.chip_erase_only + with pytest.raises(prog.ProgDeviceError, match='erase="chip"'): + prog.check_erase(low, "page") + prog.check_erase(low, "chip") + prog.check_erase(dev, "page") + pod = FakePod(chip_id="3d01") + pod.mv = 3300 + f = write(tmp_path, "p.hex", ihex((0, b"\x01" * 4))) + with pytest.raises(prog.ProgDeviceError, match="wipe their neighbours"): + make_pod(pod).flash(target="pic", file=f, device="PIC16F1827", erase="page", clk=3, data=4) + + +def test_pic_flash_flow_sends_flags_and_cp_address(tmp_path): + pod = FakePod(chip_id="a400") + pod.mv = 3300 + f = write(tmp_path, "p.hex", ihex((0, b"\x01\x02" * 8), (0x1000E, b"\xff\x3f\xff\x3f"))) + assert make_pod(pod).flash(target="pic", file=f, clk=3, data=4).ok + s0, s1 = pod.starts() + assert s0["flags"] == 4 | (7 << 8) and s0["cp_addr"] == 0x1000E and "baud" not in s0 and s0["reset"] == "nrst" + assert (s0["mem"], s0["page"], s0["erase"]) == ("flash", 64, "chip") + assert (s1["mem"], s1["addr"], s1["len"], s1["erase"]) == ("config", 0x1000E, 4, "none") + + +def test_pic_chip_erase_below_brownout_is_refused(tmp_path): + pod = FakePod(chip_id="8071") # PIC18F26Q10: programs at 1.8 V, its bulk erase needs 1.9 V + pod.mv = 1800 + f = write(tmp_path, "p.hex", ihex((0, b"\x01\x02"))) + with pytest.raises(prog.ProgDeviceError, match="chip erase needs the supply above 1.9 V"): + make_pod(pod).flash(target="pic", file=f, clk=3, data=4) + assert make_pod(pod).flash(target="pic", file=f, clk=3, data=4, erase="none").ok + + +def test_c2_family_never_writes_the_lock_byte(tmp_path): + bb1 = prog.find_device("c2", name="EFM8BB10F8G") + assert bb1.mem["flash"].size == 0x1FFF + with pytest.raises(prog.ProgDeviceError, match="not in any memory"): + prog.split_regions([(0x1FFF, b"\x00")], bb1) + with pytest.raises(prog.ProgDeviceError, match="differ: pass device="): + prog.find_device("c2", chip_id="3001") # BB1 F8G, F4G and F2G share ID 0x30 + regions, _ = prog.split_regions([(0, b"\x01" * 600)], bb1) + assert [(r.addr, len(r.data), r.page) for r in regions] == [(0, 600, 512)] + pod = FakePod(chip_id="300201") + f = write(tmp_path, "c.hex", ihex((0, b"\x01" * 600))) + assert make_pod(pod).flash(target="efm8", file=f, clk=3, data=4, device="EFM8BB10F8G").ok + st = pod.starts()[0] + assert st["proto"] == "c2" and st["expect_id"] == "30" and "flags" not in st and "reset" not in st + + +def test_direction_conflict_becomes_a_message(tmp_path): + from embeddedci.benchpod.errors import DirectionConflictError + + for when in ("info", "start"): + pod = FakePod() + orig = pod.command + + def command(req, orig=orig, when=when, pod=pod): + if req.get("cmd") == "prog_flash" and req.get("op") == when: + raise DirectionConflictError("la_dut_output", cmd="prog_flash", la=12) + return orig(req) + + pod.command = command + with pytest.raises(prog.ProgFlashError, match="LA12.*bidirectional.*fix the wiring") as ei: + make_pod(pod).flash(target="avr-updi", file=app_hex(tmp_path)) + assert isinstance(ei.value.__cause__, DirectionConflictError)