Repository navigation
prog_flash: flash UPDI, PIC, C2, TPI and PDI chips from the SDK and MCP - #147
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… routing for prog_flash targets Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…reset_pin, erase, dry_run); server instructions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e (WIP) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ash targets Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r the feature) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… DUT output gets a message Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the pod's
prog_flash(AVR UPDI, PIC ICSP, Silicon Labs C2, AVR TPI, XMEGA PDI) to the SDK and the MCP server, through the existingflash(). No new modes; no release cut. Pod firmware main with features revision 17 and thexip_progblob are needed on the pod.What changes
supports("prog_flash")works.flash(file, target="avr-updi" | "pic" | "efm8" | "attiny-tpi" | "xmega", ...)(aliasesupdi,pic,c2,tpi,pdi). It reads the chip ID with the pod'sinfo, matches it in the device table, cuts a.hex/.elf/.bininto the chip's memories (flash first, config last, partial pages padded with 0xFF), stages each withload_binpsram, starts each withexpect_id(chip erase before the first region only when the image has flash), polls status with progress and maps every pod result and refusal to an error with a fix (ProgFlashError,ProgNoAnswerError,ProgLockedError,ProgVerifyError,ProgDeviceError).flash()arguments, documented in README and the MCP README:device,clk,data,reset_pin,erase(chipdefault,page,none),dry_run(enter programming mode and read the ID only). No new wiring-profile keys: pins come from arguments, then profile signals named for the protocol (UPDI,ICSPCLK/ICSPDAT,C2CK/C2D,TPICLK/TPIDATA,PDI_CLK/PDI_DATA,MCLR/RESET), thenswd_swclk/swd_swdio;picandattiny-tpireset on the pod's reset pin by default.flashtool takes the targets and the new arguments; description, server instructions, README, tool snapshot updated.XipUnavailableErrortext now coversxip_prog.prog_devices.README.md, unreleased entries in both CHANGELOGs, API surface snapshot.Device table for the CLI:
prog_devices.jsonPath:
packages/embeddedci/src/embeddedci/benchpod/prog_devices.json(package data, plain JSON, one chip per line). Schema and sources:prog_devices.README.mdnext to it.Pod address of image byte
a=mem.addr + (a - mem.hex) / stride. 79 UPDI, 8 TPI, 38 XMEGA, 149 PIC (F and LF) and 14 C2 entries.Tested
pytest packages/embeddedci(1558 passed),packages/embeddedci-mcp(258 passed),scripts(12 passed): unit tests on the repo's fake transport cover table loading and consistency, Intel HEX/ELF/bin parsing, splitting per family, the whole start/status flow, pins from arguments and the profile, and every error path (each pod result string, no answer, locked, verify, timeouts, unknown or wrong chip, 5 V-only chips, brown-out erase, missing feature, serial console). The OpenHTF package could not be run here. The e2e tiertest_e2e_prog.py(markerprog) skips without a chip or the feature. No lint or type tooling is configured in the repo.Needs a pod and a chip (nothing here ran on hardware)
prog_devices.README.md: no data EEPROM for PIC16 (hex layout unverified, a wrong layout would write silently), PIC16F1827/193x erase only by chip, C2 limited to EFM8 BB1/BB2/SB1/SB2/UB1/UB2 (BB3, LB1, UB3, C8051F not covered), the C2 derivative ID is not used, PIC Q41 and AVR DU/EA/EB/LA/SD left out.🤖 Generated with Claude Code