Skip to content

Commit f9ff98b

Browse files
committed
Use SW_Init instead of a bunch of gdb functions
1 parent 92ad7ce commit f9ff98b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/stlink.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,10 @@ export class STLinkServerController extends EventEmitter implements GDBServerCon
189189
const ratio = Math.floor(cpuFrequency / swoFrequency) - 1;
190190

191191
const commands = [
192-
'EnableITMAccess',
193-
`BaseSWOSetup ${ratio}`,
194-
'SetITMId 1',
195-
'ITMDWTTransferEnable',
196-
'DisableITMPorts 0xFFFFFFFF',
197-
`EnableITMPorts ${portMask}`,
198-
'EnableDWTSync',
199-
this.args.swoConfig.profile ? 'EnablePCSample' : 'DisablePCSample',
200-
'ITMSyncEnable',
201-
'ITMGlobalEnable'
192+
`set $cpuFreq = ${cpuFrequency}`,
193+
`set $swoFreq = ${swoFrequency}`,
194+
`set $swoPortMask = ${portMask}`,
195+
'SWO_Init'
202196
];
203197

204198
return commands.map((c) => `interpreter-exec console "${c}"`);

0 commit comments

Comments
 (0)