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

Method SWOConfigurationCommands

src/stutil.ts:70–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 }
69
70 private SWOConfigurationCommands(): string[] {
71 const portMask = '0x' + calculatePortMask(this.args.swoConfig.decoders).toString(16);
72 const swoFrequency = this.args.swoConfig.swoFrequency;
73 const cpuFrequency = this.args.swoConfig.cpuFrequency;
74
75 const ratio = Math.floor(cpuFrequency / swoFrequency) - 1;
76
77 const commands: string[] = [
78 'EnableITMAccess',
79 `BaseSWOSetup ${ratio}`,
80 'SetITMId 1',
81 'ITMDWTTransferEnable',
82 'DisableITMPorts 0xFFFFFFFF',
83 `EnableITMPorts ${portMask}`,
84 'EnableDWTSync',
85 'ITMSyncEnable',
86 'ITMGlobalEnable'
87 ];
88
89 commands.push(this.args.swoConfig.profile ? 'EnablePCSample' : 'DisablePCSample');
90
91 return commands.map((c) => `interpreter-exec console "${c}"`);
92 }
93
94 public serverExecutable(): string {
95 if (this.args.serverpath) { return this.args.serverpath; }

Callers 1

swoAndRTTCommandsMethod · 0.95

Calls 2

calculatePortMaskFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected