An RP2040 board programs and verifies over SWD. Then you unplug the debug probe, hold BOOTSEL, and connect USB. The computer never shows RPI-RP2. Check the clock that starts the processor and the 12 MHz reference the on-chip USB bootloader needs later in that same power-up. If the product relies on factory BOOTSEL for production or field recovery, make the cold-start clock at XIN part of the board acceptance criteria. Raspberry Pi RP2040 Datasheet, sections 1.4.2, 2.7 and 2.8
Why programming over SWD can still work
At power-up, the processors initially execute the boot ROM using the on-chip ring oscillator, or ROSC. Its frequency varies with silicon process, supply voltage and temperature. The debug probe communicates with a dedicated debug port over SWCLK and SWDIO. With target power, reset, the debug connection and the necessary system clocks in a usable state, the probe can attach, inspect registers or write and verify external flash. USB still needs the ROM to set up accurate timing and the transceiver to communicate with the host. Raspberry Pi RP2040 Datasheet, sections 2.3.4, 2.7, 2.13 and 2.15
On a typical board, holding BOOTSEL pulls flash chip select low. When the ROM samples it after reset, it skips flash boot. The ROM also tries USB boot if it finds no valid second-stage loader in flash. On either cold-start USB path, the application's clock configuration has yet to run. Test the application's USB interface and the ROM's RPI-RP2 mode as separate features. Raspberry Pi RP2040 Datasheet, sections 2.8.1 and 2.8.4
How the ROM turns 12 MHz into 48 MHz
In Raspberry Pi's published RP2040 B2 boot ROM, the USB startup routine enables XOSC and waits for it to report stable. The routine then configures the system PLL and waits for lock before routing its output to both clk_sys and clk_usb. It uses a reference divider of 1 and a feedback divider of 100, giving 12 ÷ 1 × 100 = 1,200 MHz. Two output dividers give 1,200 ÷ 5 ÷ 5 = 48 MHz. Each tick of that 48 MHz clock lasts about 20.83 ns. On the full-speed USB bus, each nominal bit interval is about 83.33 ns, corresponding to 12 Mb/s. The board reference frequency, the USB controller clock and the bus bit rate are three distinct quantities. Raspberry Pi B2 boot ROM, _usb_clock_setup() · Hardware design with RP2040, section 2.4
With a 10 MHz reference, the ROM's fixed settings would give 40 MHz if the PLL locks, or 25 ns per tick. Application firmware can use different dividers. For example, 10 × 120 ÷ 5 ÷ 5 = 48 MHz illustrates a different ratio that produces the nominal USB clock. Validate the oscillator, PLL limits and firmware settings on the board. If blank boards must accept firmware by factory BOOTSEL, design for the ROM's specified 12 MHz reference. Raspberry Pi Pico SDK clock settings
What to check when the timing part changes
Passive crystal. A 12 MHz crystal goes across XIN and XOUT. Put the full orderable part number, footprint and pinout, load capacitance, maximum equivalent series resistance, drive level and temperature limits on the substitution review. In the official example, two 15 pF load capacitors give 7.5 pF in series. An assumed 3 pF of stray capacitance brings the effective load to about 10.5 pF, close to the crystal's rated 10 pF. If the crystal, layout or IOVDD changes, review the load capacitors and series resistor with the new design. Test repeated cold starts at the specified temperature and supply limits. Hardware design with RP2040, section 2.3
External CMOS clock. Feed the single-ended 12 MHz output into XIN and leave XOUT open. Check the levels against IOVDD, and confirm that the source receives power, is enabled and starts in time in the actual recovery power arrangement. If another IC generates the reference, capture its supply, output-enable and clock-output signals with the RP2040's RUN signal on the same cold start. Compare that trace with the host's USB events. If the clock only appears after the application programs the generator, an operating waveform leaves the cold-start timing untested. Raspberry Pi RP2040 Datasheet, section 1.4.2
Three observations that narrow down the failure
- Control the host and cable. Get a known-good RP2040 board to show
RPI-RP2using a known data-capable cable and a fixed host port. Repeat with the board under test after removing external supplies and any debug connection that could affect the power cycle. Follow that board's BOOTSEL procedure. Plugging the cable back in may leave an externally powered board running, so verify that reset or a full power cycle actually occurred. If the control board also fails, check the host, cable and button timing first. Raspberry Pi Pico-series BOOTSEL instructions - Look for a USB event before looking for a drive. If the operating system never identifies the device, check reset release, the BOOTSEL level when the ROM samples flash chip select, the XIN reference and the USB PHY supply. Inspect D+ and D− from the connector to the chip, including the two 27 Ω series resistors near the chip. If the host detects a connection but logs a descriptor error, save that record and keep clock, power and signal integrity in the investigation. If the host identifies the BOOTSEL device and only the volume is missing, check disk management, mount policy and the mass-storage interface. Hardware design with RP2040, sections 2.2 and 2.4
- Find the clock stage the ROM reached. On the bench, SWD can help inspect the XOSC stable and PLL_SYS lock flags if the debug setup preserves the state of the failed attempt. Check whether the attach script resets the chip or changes the clocks. The flags narrow down oscillator startup and PLL lock. Check the frequency independently. For a crystal circuit, start with the fitted part number, solder joints and surrounding components. If a direct measurement is needed, use a suitable low-capacitance probe and record where it was connected. Probe loading can change the oscillator's behaviour and may stop a marginal circuit from starting. Raspberry Pi B2 boot ROM clock initialisation
For production acceptance, use a sample with blank flash and the power arrangement specified for field recovery. Record the cold-start appearance of RPI-RP2, the transfer of a known-good UF2 built for that board, the automatic reboot and the expected application behaviour. Repeat recovery with the physical BOOTSEL control on a board with firmware already installed. Record the board identifier, PCB revision, clock part number, supply, temperature and host events. Log SWD programming and USB recovery separately so a clock substitute can be checked under the same conditions. Raspberry Pi RP2040 Datasheet, section 2.8.4
