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

Method SWOConfigurationCommands

src/pyocd.ts:71–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

swoAndRTTCommandsMethod · 0.95

Calls 2

calculatePortMaskFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected