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

Method rttCommands

src/openocd.ts:135–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133 }
134
135 public rttCommands(): string[] {
136 const commands = [];
137 if (this.args.rttConfig.enabled && !this.args.pvtRestartOrReset) {
138 const cfg = this.args.rttConfig;
139 if ((this.args.request === 'launch') && cfg.clearSearch) {
140 // The RTT control block may contain a valid search string from a previous run
141 // and RTT ends up outputting garbage. Or, the server could read garbage and
142 // misconfigure itself. Following will clear the RTT header which
143 // will cause the server to wait for the server to actually be initialized
144 commands.push(`interpreter-exec console "monitor mwb ${cfg.address} 0 ${cfg.searchId.length}"`);
145 }
146 commands.push(`interpreter-exec console "monitor rtt setup ${cfg.address} ${cfg.searchSize} {${cfg.searchId}}"`);
147 if (cfg.polling_interval > 0) {
148 commands.push(`interpreter-exec console "monitor rtt polling_interval ${cfg.polling_interval}"`);
149 }
150
151 // tslint:disable-next-line: forin
152 for (const channel in this.rttHelper.rttLocalPortMap) {
153 const tcpPort = this.rttHelper.rttLocalPortMap[channel];
154 commands.push(`interpreter-exec console "monitor rtt server start ${tcpPort} ${channel}"`);
155 }
156
157 // We are starting way too early before the FW has a chance to initialize itself
158 // but there is no other handshake mechanism
159 commands.push('interpreter-exec console "monitor rtt start"');
160 if (this.args.rttConfig.rtt_start_retry === undefined) {
161 this.args.rttConfig.rtt_start_retry = 1000;
162 }
163 }
164 return commands;
165 }
166
167 public swoAndRTTCommands(): string[] {
168 const commands = [];

Callers 1

swoAndRTTCommandsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected