🛡️ Secure your IP with 100% Air-Gapped Labs & Signed NDAs
WhatsApp: +86 18928482768 | sales@pcbdesignlab.com

Summary

A buyer's guide to PCB-level built-in self-test: scope, startup versus on-demand modes, firmware hooks, logging, watchdogs, security, and a design review checklist.

A built-in self-test is only useful when it answers a question the line or the field actually asks: is this assembly healthy, and if not, which block failed? Many boards ship with a routine that blinks an LED or prints “OK” on a serial port. That is a sign of life, not a test. A production-grade BIST covers the memory, peripherals, buses, and power rails that dominate field failures, runs inside a startup budget the product can afford, writes a result that ties to a serial number, and stays out of the way after deployment. This guide sets out what to cover, when to run it, and how to keep it from becoming a production bottleneck.

What BIST should cover on an assembly

Scope BIST by the failure modes the assembly can actually produce. A firmware routine cannot find an open solder joint under a BGA, but it can prove that the RAM holds a pattern, the flash image is intact, each bus device answers, and every rail sits inside its design window. Treat the list as a coverage contract between firmware and test engineering, not as a menu.

Block What BIST can prove What it cannot prove Limit source
Processor core and RAM Address and data lines, stuck bits, coupling between cells, stack integrity Marginal timing over temperature Design timing analysis and device data sheet
Flash and configuration memory Blank state, image CRC, read-back of critical regions, option bytes Retention over the product life Image signature and programming specification
Peripherals Register access, internal loopback, device IDs, interrupt delivery Analog accuracy at the pin Device data sheet and board schematic
Buses (I2C, SPI, UART, CAN, USB) Device presence, protocol response, loopback paths Signal integrity margin Bus specification and layout constraints
Power rails Presence, sequence order, ADC readings against design limits, brownout behavior Load transient response Power design budget
Clocks and reset Clock presence, PLL lock, reset cause, watchdog reset Long-term drift in the field Clock tree and reset design

Two rules keep the table honest. Every row needs a limit source that exists before the test is written, and every row needs a named owner. A test with no limit becomes a print statement. Keep those limits traceable to the assembly specification and to IPC acceptance guidance where it applies. Where the table stops, other methods take over: boundary scan for pin-level interconnect, in-circuit test for component values, and functional test for performance at the connectors. The design rules in this guide to boundary scan and JTAG show where BIST and boundary scan meet.

Startup self-test or on-demand: decide by consequence

Both modes should call the same test library with a different profile. Duplicated test code drifts, and a production test that no longer matches the field test is worse than no field test at all.

Mode Trigger Scope Time rule Result handling
Startup core Every power-up Rails, clock, reset cause, RAM, flash CRC, watchdog Must fit the product startup budget; if it does not, cut scope, not the budget Summary code and first failing block; enter safe mode on fail
Startup extended Power-up with a flag set, or after a fault Adds peripherals and buses Runs after the application is ready, in the background where possible Appends to the log; does not block normal operation
On-demand Service command, production station, remote request Full suite including loopback and margin checks No startup budget; bounded by the station cycle Full per-test record
Continuous Low-priority task in the field Selected rails, bus health, watchdog Fixed share of idle time Rolling counters, not per-run records

Set the startup budget from the product requirement, not from the test suite. Write it down before firmware work starts: the time from power-on to ready. Then allocate a share of it to self-test and hold the test library to that share on the slowest supported board. A test that fits only on the fastest build will fail qualification on the coldest unit.

Test hooks the firmware must expose

Hooks are cheap at design time and expensive after release. Add them in the first firmware architecture review; a test that needs a new transport cannot be retrofitted to a board already in the field.

Hook Purpose Design rule
Test entry command Starts on-demand mode from a station or service tool Authenticated in field mode; local only in production
Machine-readable output Lets the station parse results without screenshots One record per test with a stable ID, result, and measured value
Build and test-library IDs Ties a result to the exact firmware Read-only, included in every log record
Serial number API Binds the run to the unit Read and write with verification; refuse blank or duplicate values
Bus loopback control Proves the transceiver and connector path Route loopback through the connector where the design allows
Rail measurement map Converts ADC channels to named rails Store the channel map in firmware, not in the station
Watchdog suspend and resume Prevents resets during long tests Bounded window with automatic resume on exit
Fault injection Proves the test detects a known bad state Available in production mode only, never in the field
Manufacturing mode flag Separates destructive tests from field tests One-way lock before shipment

Fault injection deserves its own line because it is the only way to know the test works. Inject a bad CRC, a stuck bus, or a rail outside its window, and confirm the correct test fails with the correct code. A self-test that has never failed on purpose is a self-test nobody has verified.

Order of operations: rails, clocks, buses, functions

A test sequence that starts with the bus will report a bus failure when the real fault is a missing rail. Fix the order once, in the library, and make every profile follow it.

Stage Gate before moving on On failure
1. Power rails Every rail present and inside its design window Stop, record the rail name and measured value, enter safe mode
2. Clocks and reset Clock present, PLL locked, reset cause captured Stop, record the clock source, do not start buses
3. Core memory RAM and flash CRC pass Stop, record the failing region or address
4. Peripherals and buses Device IDs and loopback pass Continue with remaining buses, mark dependent tests blocked
5. Application functions Only after the blocks above pass Report the first failing function and keep earlier results

Populated AD58230 control board with connectors and mixed surface-mount devices used for bench self-test

The blocked result matters. If the I2C bus fails, the EEPROM test did not fail; it never ran. Recording blocked tests as failures inflates the failure count and sends repair down the wrong path. A three-state result, pass, fail, or blocked, is more useful than a boolean, and it costs one field in the log format.

Logging, serial number binding, and records

A BIST result without an identity is a diagnostic message. Bind every run to the unit serial number, the build ID, the test-library version, the station ID, and the time. Write the record once, then never edit it. Production stations should read the record to release the unit; service tools should read it to see the history. A change to the self-test library or its limits needs the release discipline described in this guide to PCB test program maintenance. The record structure and retention rules for rebuilt-board traceability apply directly to self-test logs.

Keep the first failing test in a separate field. A summary that says “self-test failed” hides the one fact repair needs. Store the measured value next to the limit for analog checks, and store the failing address or device ID for memory and bus checks.

Watchdogs, resets, and failure behavior

The watchdog is part of the test, not an obstacle to it. A board that resets during self-test and comes back with a green result has hidden a fault. Follow four rules.

  • Record the reset cause before clearing it, and include it in the log.
  • Allow watchdog suspend only inside a bounded test window, with automatic resume on every exit path.
  • Limit automatic retries and fall back to a safe mode with a visible fault code after the limit.
  • Keep the watchdog enabled in field mode, including during on-demand tests.

A boot loop is a failure mode, not a recovery strategy. If the core test fails repeatedly, the firmware should stop retrying, publish the fault code, and stay in a state that a service tool can reach.

Security and debug access

Every hook that helps production also helps someone else. Treat debug access as a controlled resource with a lifecycle, not a jumper left open for convenience.

Lifecycle stage Debug port Test commands Log access
Prototype Open Full, including fault injection Read and clear
Production Open only at the test station Full, station-authenticated Read and append
Pre-shipment Locked or disabled Manufacturing mode removed Read only
Field Locked Read-only health checks Read only, no clear

Four rules close the common gaps. Authenticate manufacturing mode with a challenge that is unique per unit or per batch, not a fixed password compiled into every image. Keep secrets out of logs; a test that prints a key to a serial port has published the key. Make the lock one-way where the hardware allows it, and record the lock event in the unit record. If a later failure needs debug access, the recovery path should require a signed image or a controlled unlock, not a documented backdoor.

Production mode and field mode are different products

Production runs destructive tests: flash erase, calibration writes, serial number programming, fault injection. Field runs must be read-only and short.

Build two profiles over one library. The production profile can run the full sequence, write calibration and identity, and verify the lock. The field profile runs rails, clocks, memory, and bus health, reads the log, and never writes. Gate the profile with the manufacturing flag, and clear that flag as the last production step, after the final test record is written. Then verify the gate on a sample unit by trying to enter production mode after shipment.

A BIST design review checklist

  • Every covered block has a limit source and a named owner.
  • Startup budget is written down and tested on the slowest supported build.
  • Production and field profiles call the same test library.
  • Results use pass, fail, and blocked, with a first-failing-test field.
  • Serial number and build ID are in every record, and duplicates are rejected.
  • Reset cause and watchdog events are logged.
  • Fault injection proves each critical test can fail.
  • Debug lock is verified before shipment and recorded.
  • Logs are written once, retained, and readable by service tools.
  • Test duration is measured at the station, not estimated.

Frequently Asked Questions

What should a PCB-level self-test check first?

Check the power rails and clocks before anything else, then core memory and the flash image. A bus or peripheral test that runs before its rail is proven will report a misleading failure. This order also gives the repair technician the first useful clue: which rail or clock was missing when the board started.

Should self-test run at every power-up?

Run a short core subset at every power-up and the full suite on demand. The core subset should cover rails, clocks, reset cause, RAM, and flash integrity, and it must fit the startup budget. Extended peripheral and bus tests can run after the application is ready, or at the service station, so normal startup stays predictable.

How does BIST relate to JTAG boundary scan?

BIST exercises functional blocks through firmware, while boundary scan tests the pin-level interconnect from outside the device. They find different faults. Boundary scan can catch an open trace between two devices; BIST can catch a flash image that will not boot. Use both where the board supports them, and let each method cover what the other cannot reach.

How do we keep self-test from slowing production?

Give the production station one full run with a stable, machine-readable output, and keep the field profile short. Measure duration on the line instead of estimating it, remove tests that repeat a check already proven by another station, and run long memory tests in parallel with programming where the hardware allows. A test that adds no detection should be cut.

Conclusion

  • Define BIST scope by failure mode, and give every covered block a limit source and an owner.
  • Set the startup budget before writing tests, then hold the library to it on the slowest build.
  • Bind every run to a serial number, build ID, and test version, and write the record once.
  • Prove the test with fault injection, lock debug before shipment, and keep field mode read-only.

Get Weekly PCB Engineering Insights!

Practical insights on PCB design, PCB reverse engineering, IC unlocking and hardware development from PCBDesign Lab.

One email each week. Unsubscribe anytime. Read our privacy policy for more info.

Get Started

PCBDesign Lab Has Helped 100+ Customers Build Their Products

Free Consulting