Skip to content

Commit 283fe21

Browse files
Merge branch 'main' into filterEntriesSmart
2 parents f73758c + 24f8d46 commit 283fe21

9 files changed

Lines changed: 134 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,35 @@
11
# Change Log
22

3-
## 1.5.1
3+
## 1.6.0
44

5-
- Adds `Fault Reports` to the [Core Peripherals](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#core-peripherals) view.
6-
- Improves expand/collapse behavior with active filter in [Component Viewer](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#component-viewer) and
7-
[Core Peripherals](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#core-peripherals) views.
5+
- The extension now has a *pre-release channel* for early access to upcoming features.
6+
As part of this, the versioning scheme has changed: stable releases use even minor versions (starting with 1.6.0), while odd minor versions are reserved for pre-releases.
7+
- Adds the [Core Peripherals](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#core-peripherals) view which gives insight into the programming of CPU specific core peripherals.
8+
- Adds commands to enable/disable [CPU Time](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#cpu-time) updates.
9+
- Fixes [Component Viewer](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#component-viewer) display and stability issues.
810
- Includes updated pyOCD distribution ([pyOCD v0.44.0](https://github.com/pyocd/pyOCD/releases/tag/v0.44.0))
911
- Uses default debug sequences as defined in the
1012
[Open-CMSIS-Pack specification](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/debug_description.html#autotoc_md2).
1113
- Adds missing sequence support for flash programming and holding hardware reset.
1214
- Changes strategy of programming multiple flash memories from multiple erase-program-verify sequences per flash memory to a single
13-
erase-program-verify sequence spannig all targeted flash memories.
15+
erase-program-verify sequence spanning all targeted flash memories.
1416
- Renames RTT channel mode `telnet` to `server`.
1517
- Adds Segger [SystemView](https://www.segger.com/products/development-tools/systemview/) server mode to support direct recording
1618
from pyOCD via IP (TCP/IP connection) for [`run`](https://open-cmsis-pack.github.io/cmsis-toolbox/pyOCD-Debugger/#command-line-invocation)
1719
subcommand.
1820
- Improves robustness and logging of [Segger RTT](https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/)
1921
support.
20-
- See [pyOCD v0.44.0](https://github.com/pyocd/pyOCD/releases/tag/v0.44.0) for a full list of ehancements and bug fixes.
21-
22-
## 1.5.0
23-
24-
- Pre-release with a preview of the new [Core Peripherals](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#core-peripherals) view that lives under
25-
[Trace and Live View](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#trace-and-live-view).
26-
- Early feedback is welcomed, please use [GitHub issues](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/new/choose) to raise enhancement requests or defects.
27-
- Fixes [Component Viewer](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger?tab=readme-ov-file#component-viewer) display and stability issues.
28-
- Included in this extension pre-release:
29-
- [pyOCD v0.43.1](https://github.com/pyocd/pyOCD/releases/tag/v0.43.1)
22+
- Also included in this extension release:
3023
- [arm-none-eabi-gdb v14.3.1](https://artifacts.tools.arm.com/arm-none-eabi-gdb/14.3.1/)
31-
- Full list of required minimum versions for correct functionality of the CMSIS Debugger v1.5.0 pre-release:
24+
- Full list of required minimum versions for correct functionality of the CMSIS Debugger v1.6.0 release:
3225
- [Arm CMSIS Solution extension v1.66.0](https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution)
3326
- [CDT GDB Adapter extension v2.7.0](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.cdt-gdb-vscode)
3427
- [Memory Inspector v1.2.0](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.memory-inspector)
3528
- [Peripheral Inspector v1.9.0](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.peripheral-inspector)
3629
- [Serial Monitor v0.13.1](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor)
37-
- [RTOS Views v0.0.14](https://marketplace.visualstudio.com/items?itemName=mcu-debug.rtos-views)
38-
- See [v1.4.1...v1.5.0](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/compare/v1.4.1...v1.5.0) for a full list
39-
of changes that went into this pre-release.
30+
- [RTOS Views v0.0.15](https://marketplace.visualstudio.com/items?itemName=mcu-debug.rtos-views)
31+
- See [CMSIS Debugger 1.6.0 project board](https://github.com/orgs/Open-CMSIS-Pack/projects/21/views/10) for a full list
32+
of enhancement requests and defects addressed in this release.
4033

4134
## 1.4.1
4235

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ The Core Peripherals view shows information about the following components if im
316316
- System Tick Timer
317317
- Fault Reports
318318

319+
![Showing core peripheral contents in the COMPONENT PERIPHERALS view](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/raw/main/images/core-peripherals.png)
320+
319321
### PERIPHERALS
320322

321323
The **PERIPHERALS** view shows the device peripheral registers and allows to change their values. It uses the CMSIS-SVD files that are provided by silicon vendors and distributed as part of the CMSIS Device Family Packs (DFP).

images/core-peripherals.png

226 KB
Loading

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-cmsis-debugger",
33
"displayName": "Arm CMSIS Debugger",
44
"description": "Run and debug embedded and Edge AI projects on Arm Cortex-M single or multi core devices. Connects via pyOCD to CMSIS-DAP or other GDB servers.",
5-
"version": "1.5.1",
5+
"version": "1.6.0",
66
"preview": false,
77
"publisher": "Arm",
88
"author": "Jens Reinecke <jens.reinecke@arm.com>",
@@ -96,6 +96,20 @@
9696
"category": "Run and Debug",
9797
"when": "inDebugMode"
9898
},
99+
{
100+
"title": "Enable CPU Time",
101+
"command": "vscode-cmsis-debugger.enableCpuTimer",
102+
"category": "Run and Debug",
103+
"when": "inDebugMode",
104+
"enablement": "!vscode-cmsis-debugger.cpuTimerEnabled"
105+
},
106+
{
107+
"title": "Disable CPU Time",
108+
"command": "vscode-cmsis-debugger.disableCpuTimer",
109+
"category": "Run and Debug",
110+
"when": "inDebugMode",
111+
"enablement": "vscode-cmsis-debugger.cpuTimerEnabled"
112+
},
99113
{
100114
"command": "vscode-cmsis-debugger.liveWatch.add",
101115
"title": "Add Expression",

src/features/cpu-states/cpu-states-commands.test.ts

100644100755
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ describe('CpuStatesCommands', () => {
4848
cpuStatesCommands.activate(context, cpuStatesMock);
4949
expect(vscode.commands.registerCommand as jest.Mock).toHaveBeenCalledWith(CpuStatesCommands.showCpuTimeHistoryID, expect.any(Function));
5050
expect(vscode.commands.registerCommand as jest.Mock).toHaveBeenCalledWith(CpuStatesCommands.resetCpuTimeHistoryID, expect.any(Function));
51+
expect(vscode.commands.registerCommand as jest.Mock).toHaveBeenCalledWith(CpuStatesCommands.enableCpuTimer, expect.any(Function));
52+
expect(vscode.commands.registerCommand as jest.Mock).toHaveBeenCalledWith(CpuStatesCommands.disableCpuTimer, expect.any(Function));
5153
});
5254

5355
it('calls updateFrequyency and showStatesHistory for showCpuTimeHistory command', async () => {
@@ -71,4 +73,24 @@ describe('CpuStatesCommands', () => {
7173
expect(cpuStatesMock.resetStatesHistory).not.toHaveBeenCalled();
7274
});
7375

76+
it('calls enableCpuStates for enableCpuTimer command', async () => {
77+
cpuStatesCommands.activate(context, cpuStatesMock);
78+
await vscode.commands.executeCommand(CpuStatesCommands.enableCpuTimer);
79+
expect(cpuStatesMock.enableCpuStates).toHaveBeenCalledTimes(1);
80+
});
81+
82+
it('calls disableCpuStates for disableCpuTimer command', async () => {
83+
cpuStatesCommands.activate(context, cpuStatesMock);
84+
await vscode.commands.executeCommand(CpuStatesCommands.disableCpuTimer);
85+
expect(cpuStatesMock.disableCpuStates).toHaveBeenCalledTimes(1);
86+
});
87+
88+
it('should fail early if cpuStates is not set', async () => {
89+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
90+
const commands: any = new CpuStatesCommands();
91+
await expect(commands.handleShowHistory()).resolves.toBeUndefined();
92+
await expect(commands.handleResetHistory()).resolves.toBeUndefined();
93+
await expect(commands.handleEnableCpuTimer()).resolves.toBeUndefined();
94+
await expect(commands.handleDisableCpuTimer()).resolves.toBeUndefined();
95+
});
7496
});

src/features/cpu-states/cpu-states-commands.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ import { CpuStates } from './cpu-states';
2121
export class CpuStatesCommands {
2222
public static readonly showCpuTimeHistoryID = `${EXTENSION_NAME}.showCpuTimeHistory`;
2323
public static readonly resetCpuTimeHistoryID = `${EXTENSION_NAME}.resetCpuTimeHistory`;
24+
public static readonly enableCpuTimer = `${EXTENSION_NAME}.enableCpuTimer`;
25+
public static readonly disableCpuTimer = `${EXTENSION_NAME}.disableCpuTimer`;
2426
private cpuStates?: CpuStates;
2527

2628
public activate(context: vscode.ExtensionContext, cpuStates: CpuStates): void {
2729
// Register item and command
2830
context.subscriptions.push(
2931
vscode.commands.registerCommand(CpuStatesCommands.showCpuTimeHistoryID, () => this.handleShowHistory()),
30-
vscode.commands.registerCommand(CpuStatesCommands.resetCpuTimeHistoryID, () => this.handleResetHistory())
32+
vscode.commands.registerCommand(CpuStatesCommands.resetCpuTimeHistoryID, () => this.handleResetHistory()),
33+
vscode.commands.registerCommand(CpuStatesCommands.enableCpuTimer, () => this.handleEnableCpuTimer()),
34+
vscode.commands.registerCommand(CpuStatesCommands.disableCpuTimer, () => this.handleDisableCpuTimer())
35+
3136
);
3237
this.cpuStates = cpuStates;
3338
}
@@ -46,4 +51,18 @@ export class CpuStatesCommands {
4651
}
4752
this.cpuStates.resetStatesHistory();
4853
}
54+
55+
protected async handleEnableCpuTimer(): Promise<void> {
56+
if (!this.cpuStates) {
57+
return;
58+
}
59+
this.cpuStates.enableCpuStates();
60+
}
61+
62+
protected async handleDisableCpuTimer(): Promise<void> {
63+
if (!this.cpuStates) {
64+
return;
65+
}
66+
this.cpuStates.disableCpuStates();
67+
}
4968
};

src/features/cpu-states/cpu-states.test.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2025 Arm Limited
2+
* Copyright 2025-2026 Arm Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -85,6 +85,23 @@ describe('CpuStates', () => {
8585
cpuStates.activate(tracker);
8686
});
8787

88+
it('returns early from showStatesHistory when there are no active cpu states', () => {
89+
const warningMessageSpy = jest.spyOn(vscode.window, 'showWarningMessage');
90+
// No session started => activeCpuStates is undefined
91+
cpuStates.showStatesHistory();
92+
expect(warningMessageSpy).not.toHaveBeenCalled();
93+
});
94+
95+
it('returns early from resetStatesHistory when there are no active cpu states', () => {
96+
const warningMessageSpy = jest.spyOn(vscode.window, 'showWarningMessage');
97+
const refreshListener = jest.fn();
98+
cpuStates.onRefresh(refreshListener);
99+
// No session started => activeCpuStates is undefined
100+
cpuStates.resetStatesHistory();
101+
expect(warningMessageSpy).not.toHaveBeenCalled();
102+
expect(refreshListener).not.toHaveBeenCalled();
103+
});
104+
88105
it('manages session lifecycles correctly', async () => {
89106
cpuStates.activate(tracker);
90107
// No active session yet
@@ -409,6 +426,31 @@ describe('CpuStates', () => {
409426
expect(debugConsoleOutput.find(line => line.includes('(PC=0x08000396 <myframe>, myfunction::2)'))).toBeDefined();
410427
});
411428

429+
it('enable cpu states command sets context key to true', async () => {
430+
const executeCommandSpy = jest.spyOn(vscode.commands, 'executeCommand').mockResolvedValue(undefined);
431+
cpuStates.activate(tracker);
432+
await cpuStates.enableCpuStates();
433+
expect(executeCommandSpy).toHaveBeenCalledWith('setContext', 'vscode-cmsis-debugger.cpuTimerEnabled', true);
434+
});
435+
436+
it('disable cpu states command sets context key to false', async () => {
437+
const executeCommandSpy = jest.spyOn(vscode.commands, 'executeCommand').mockResolvedValue(undefined);
438+
cpuStates.activate(tracker);
439+
await cpuStates.disableCpuStates();
440+
expect(executeCommandSpy).toHaveBeenCalledWith('setContext', 'vscode-cmsis-debugger.cpuTimerEnabled', false);
441+
});
442+
443+
it('enable cpu states sets enableCpuStates flag to true', async () => {
444+
cpuStates.activate(tracker);
445+
await cpuStates.enableCpuStates();
446+
expect((cpuStates as unknown as { enableCpuStatesFlag: boolean }).enableCpuStatesFlag).toEqual(true);
447+
});
448+
449+
it('disable cpu states sets enableCpuStates flag to false', async () => {
450+
cpuStates.activate(tracker);
451+
await cpuStates.disableCpuStates();
452+
expect((cpuStates as unknown as { enableCpuStatesFlag: boolean }).enableCpuStatesFlag).toEqual(false);
453+
});
412454
});
413455

414456
describe('tests with established connection and CPU states not supported', () => {

src/features/cpu-states/cpu-states.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class CpuStates {
5252

5353
public activeSession: GDBTargetDebugSession | undefined;
5454
private sessionCpuStates: Map<string, SessionCpuStates> = new Map();
55+
private enableCpuStatesFlag: boolean = true;
5556

5657
public get activeCpuStates(): SessionCpuStates|undefined {
5758
if (!this.activeSession) {
@@ -69,6 +70,7 @@ export class CpuStates {
6970
tracker.onContinued(event => this.handleContinuedEvent(event));
7071
tracker.onStopped(event => this.handleStoppedEvent(event));
7172
tracker.onStackTrace(stackTrace => this.handleStackTrace(stackTrace));
73+
vscode.commands.executeCommand('setContext', 'vscode-cmsis-debugger.cpuTimerEnabled', true);
7274
}
7375

7476
protected handleOnWillStartSession(session: GDBTargetDebugSession): void {
@@ -197,6 +199,9 @@ export class CpuStates {
197199
if (!states) {
198200
return;
199201
}
202+
if (!this.enableCpuStatesFlag) {
203+
return;
204+
}
200205
const newCycles = await session.readMemoryU32(DWT_CYCCNT_ADDRESS);
201206
if (newCycles === undefined) {
202207
return;
@@ -320,4 +325,15 @@ export class CpuStates {
320325
states.skipFrequencyUpdate = false;
321326
this._onRefresh.fire(0);
322327
}
328+
329+
public async enableCpuStates(): Promise<void> {
330+
this.enableCpuStatesFlag = true;
331+
await vscode.commands.executeCommand('setContext', 'vscode-cmsis-debugger.cpuTimerEnabled', this.enableCpuStatesFlag);
332+
}
333+
334+
public async disableCpuStates(): Promise<void> {
335+
this.enableCpuStatesFlag = false;
336+
await vscode.commands.executeCommand('setContext', 'vscode-cmsis-debugger.cpuTimerEnabled', this.enableCpuStatesFlag);
337+
}
338+
323339
};

0 commit comments

Comments
 (0)