MCPcopy Create free account
hub / github.com/Marus/cortex-debug / serverLaunchCompleted

Method serverLaunchCompleted

src/jlink.ts:191–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189
190 public serverLaunchStarted(): void {}
191 public serverLaunchCompleted(): Promise<void> {
192 if (this.args.swoConfig.enabled) {
193 if ((this.args.swoConfig.source === 'probe') || (this.args.swoConfig.source === 'socket')) {
194 const swoPortNm = createPortName(this.args.targetProcessor, 'swoPort');
195 this.emit('event', new SWOConfigureEvent({
196 type: 'socket',
197 args: this.args,
198 port: this.ports[swoPortNm].toString(10)
199 }));
200 }
201 else {
202 this.emit('event', new SWOConfigureEvent({
203 type: 'serial',
204 args: this.args,
205 device: this.args.swoConfig.source,
206 baudRate: this.args.swoConfig.swoFrequency
207 }));
208 }
209 }
210
211 /* The JLink Server will output its initMatch line before it's actually ready to
212 * process commands from a GDB client. This causes the JLink server's state to fall out of
213 * sync with the debugger chip from the beginning, and the GDB client will fail to start
214 * the processor correctly. This typically surfaces as a "Failed to start CPU" line in
215 * the Adapter output and all registers read as 0xdeadbeee or 0xdeadbeef until the debugger
216 * chip is reset with "monitor reset".
217 *
218 * Sleep for 500ms at the end of the server launch to give the JLink server time to
219 * settle:
220 */
221 return new Promise((resolve) => setTimeout(resolve, 500));
222 }
223 public debuggerLaunchStarted(): void {}
224 public debuggerLaunchCompleted(): void {
225 this.rttHelper.emitConfigures(this.args.rttConfig, this);

Callers

nothing calls this directly

Calls 2

createPortNameFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected