PIC18F2550 Read-Out: USB Firmware Is Still Just Flash

There is a persistent belief that a USB microcontroller stores its identity somewhere other than program flash — a protected descriptor block, a vendor area, a one-time region the toolchain burns. On the PIC18F2550 there is no such thing. The device descriptor, the configuration descriptor, the string descriptors, the endpoint buffer descriptors and the class code all sit in the same 32 KB array as the rest of the firmware, and the SIE reads them out of ordinary memory at enumeration time.

What The USB Block Actually Owns

The full-speed module brings its own 1 KB dual-access RAM and its own transceiver with an on-chip regulator. That RAM is volatile. It holds packet buffers at run time and is repopulated by firmware on every enumeration; nothing in it survives a power cycle and nothing in it is worth extracting. The persistent content — what the host sees as VID, PID, serial number and interface class — is a table of constants compiled into flash.

The practical consequence is that a recovered image contains the device identity as plainly as it contains the main loop. If the goal is to understand what a USB peripheral claims to be, a hex dump answers it in minutes: search for the descriptor signature, then walk the four bytes of length, type and the two-byte fields that follow.

Array Geometry

32 KB from 0x0000 to 0x7FFF, 16,384 instructions, protected in four 8 KB quarters plus CPB over the boot block. 2,048 bytes of SRAM and 256 bytes of data EEPROM at 0xF00000. Configuration words at 0x300000.

Region Range Notes
CP0 0x0000 – 0x1FFF 8 KB, holds vectors
CP1 0x2000 – 0x3FFF 8 KB
CP2 0x4000 – 0x5FFF 8 KB
CP3 0x6000 – 0x7FFF 8 KB

Because the USB stack is large by PIC18 standards — a minimal HID implementation runs 6 to 8 KB — designs frequently cross a quarter boundary, and a partially protected 2550 often returns the descriptor tables but not the enumeration state machine, or the reverse. That asymmetry is useful during triage: it tells the customer which parts of their product behaviour can be audited and which cannot.

The Self-Programming Angle

This part supports flash self-programming, which is how most USB bootloaders on it work. The firmware reserves a block, writes new application code into it, and jumps to it after a reset. A recovered image from such a device typically contains two entry sequences — the bootloader’s and the application’s — and the configuration words may point the reset vector at either. Reading those eight bytes at 0x300000 is therefore not optional: without them the image does not tell you which half runs first.

The 256-byte EEPROM often holds a USB serial number that was programmed on the production line and never appears in the code. Customers who clone a board and find that two units present the same serial number are usually looking at a copied EEPROM.

Enumeration itself leaves a readable signature. The firmware writes a device descriptor, waits for a setup packet, then writes a configuration descriptor, and the state machine that does this is a switch on the request code. A recovered image therefore contains the standard request codes as literal comparisons — 0x06 for get descriptor, 0x09 for set configuration, 0x0B for set interface. Finding those constants confirms the image contains a real USB stack rather than a serial port that happens to run over the same connector, which is a distinction customers sometimes get wrong when describing a board.

Access Notes

28-pin PDIP, SOIC and QFN. The 28-pin packages do not bring out a dedicated ICSP/ICD port, so programming pins are shared with PORTB, which is the usual reason a recovered board needs the part lifted rather than probed in circuit.

Protected devices are handled only with ownership documentation, arranged through the service desk. The firmware extraction overview describes what a standard deliverable contains, and the analysis workflow covers verification.

The 12-bit converter variant of this exact die is the PIC18F2553; the flash map is identical, which is why the two are often confused on a bench.

Service scope and next steps

Before we quote a PIC job we confirm the silicon revision and the protection configuration, because both decide whether the on-chip programming area can be read directly or needs a different approach. The full scope of what we handle, how a project runs from electrical integrity test to delivered file, and the payment terms are described on our service capabilities page.

Ready to extract this PIC firmware?

Send us the part number and a short description of what you need. Free evaluation, fixed quotation, and a reply within one business day.

Request a quotation

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *