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

Method SWOConfigurationCommands

src/openocd.ts:176–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 }
175
176 private SWOConfigurationCommands(): string[] {
177 const commands: string[] = [];
178
179 if (!this.args.pvtRestartOrReset) {
180 const portMask = '0x' + calculatePortMask(this.args.swoConfig.decoders).toString(16);
181 const swoFrequency = this.args.swoConfig.swoFrequency;
182 const cpuFrequency = this.args.swoConfig.cpuFrequency;
183 const source = this.args.swoConfig.source;
184 const swoOutput = (source === 'serial') ? 'external' : ':' +
185 this.ports[createPortName(this.args.targetProcessor, 'swoPort')];
186 commands.push(
187 `monitor CDSWOConfigure ${cpuFrequency} ${swoFrequency} ${swoOutput}`,
188 `set $cpuFreq = ${cpuFrequency}`,
189 `set $swoFreq = ${swoFrequency}`,
190 `set $swoPortMask = ${portMask}`
191 );
192 }
193
194 commands.push(
195 // ST/OpenOCD HACK: See HACK NOTES above.
196 'monitor gdb_sync', 'stepi',
197 'SWO_Init'
198 );
199 // commands.push(this.args.swoConfig.profile ? 'EnablePCSample' : 'DisablePCSample');
200
201 return commands.map((c) => `interpreter-exec console "${c}"`);
202 }
203
204 public serverExecutable(): string {
205 if (this.args.serverpath) { return this.args.serverpath; }

Callers 1

swoAndRTTCommandsMethod · 0.95

Calls 3

calculatePortMaskFunction · 0.90
createPortNameFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected