UNPKG

jlink-mcp

Version:

MCP server for SEGGER J-Link debug probes — LLM-driven embedded debugging with RTT, GDB server, and Trice/Pigweed support

67 lines 3.14 kB
export interface JLinkCommandResult { success: boolean; /** Raw full output from JLinkExe */ rawOutput: string; /** Cleaned output with connection boilerplate stripped */ output: string; error?: string; } /** Strip JLink connection boilerplate from output, returning only meaningful data */ export declare function stripBoilerplate(raw: string): string; /** Parse register dump into structured JSON */ export declare function parseRegisters(raw: string): Record<string, string> | null; /** Format registers as a compact, LLM-friendly summary */ export declare function formatRegistersCompact(regs: Record<string, string>): string; /** Parse memory dump lines into hex string */ export declare function parseMemoryDump(raw: string): { address: string; hex: string; ascii: string; }[]; /** Decode ARM Cortex-M fault status registers */ export declare function decodeFaultRegisters(cfsr: number, hfsr: number, mmfar: number, bfar: number): string; /** * Executes J-Link Commander commands by spawning JLinkExe with a script. * Each call opens a new connection, runs the commands, and exits. */ export declare function executeJLinkCommands(commands: string[], deviceOverride?: string): Promise<JLinkCommandResult>; /** Connect and get device info - returns a compact summary */ export declare function getDeviceInfo(): Promise<JLinkCommandResult>; /** Halt the CPU */ export declare function haltDevice(): Promise<JLinkCommandResult>; /** Resume (go) the CPU */ export declare function resumeDevice(): Promise<JLinkCommandResult>; /** Reset the device */ export declare function resetDevice(halt?: boolean): Promise<JLinkCommandResult>; /** Read memory at address */ export declare function readMemory(address: number, numBytes: number): Promise<JLinkCommandResult>; /** Write memory (32-bit words) */ export declare function writeMemory(address: number, value: number): Promise<JLinkCommandResult>; /** Read a CPU register by name */ export declare function readRegister(register: string): Promise<JLinkCommandResult>; /** Read all registers */ export declare function readAllRegisters(): Promise<JLinkCommandResult>; /** Flash a firmware file */ export declare function flashFirmware(filePath: string, baseAddress?: number): Promise<JLinkCommandResult>; /** Erase the chip */ export declare function eraseChip(): Promise<JLinkCommandResult>; /** Set a hardware breakpoint */ export declare function setBreakpoint(address: number): Promise<JLinkCommandResult>; /** Clear all breakpoints */ export declare function clearBreakpoints(): Promise<JLinkCommandResult>; /** Step one instruction */ export declare function stepInstruction(): Promise<JLinkCommandResult>; /** Execute arbitrary J-Link commands */ export declare function executeRawCommands(rawCommands: string[]): Promise<JLinkCommandResult>; /** Read fault registers and decode them */ export declare function readFaultRegisters(): Promise<{ result: JLinkCommandResult; decoded: string; raw: { cfsr: number; hfsr: number; mmfar: number; bfar: number; }; }>; //# sourceMappingURL=commander.d.ts.map