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

Method SWOConfigurationCommands

src/bmp.ts:90–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 }
89
90 private SWOConfigurationCommands(): string[] {
91 const portMask = '0x' + calculatePortMask(this.args.swoConfig.decoders).toString(16);
92 const swoFrequency = this.args.swoConfig.swoFrequency;
93 const cpuFrequency = this.args.swoConfig.cpuFrequency;
94
95 const ratio = Math.floor(cpuFrequency / swoFrequency) - 1;
96
97 const commands: string[] = [];
98
99 commands.push(
100 'EnableITMAccess',
101 `BaseSWOSetup ${ratio}`,
102 'SetITMId 1',
103 'ITMDWTTransferEnable',
104 'DisableITMPorts 0xFFFFFFFF',
105 `EnableITMPorts ${portMask}`,
106 'EnableDWTSync',
107 'ITMSyncEnable',
108 'ITMGlobalEnable'
109 );
110
111 commands.push(this.args.swoConfig.profile ? 'EnablePCSample' : 'DisablePCSample');
112
113 return commands.map((c) => `interpreter-exec console "${c}"`);
114 }
115
116 public serverExecutable(): string {
117 return null;

Callers 1

swoAndRTTCommandsMethod · 0.95

Calls 2

calculatePortMaskFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected