Skip to content

Commit 6f623ca

Browse files
committed
Update cbuild-run types to toolbox 2.9.0 schema
Signed-off-by: Jens Reinecke <[email protected]>
1 parent e7561c0 commit 6f623ca

File tree

3 files changed

+52
-21
lines changed

3 files changed

+52
-21
lines changed

src/cbuild-run/__snapshots__/cbuild-run-reader.test.ts.snap

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@ exports[`CbuildRunReader Parser successfully parses a *.cbuild-run.yml file 1`]
6565
},
6666
],
6767
},
68-
"debugger": [
69-
{
70-
"clock": 10000000,
71-
"name": "<default>",
72-
"port": "swd",
73-
},
74-
],
68+
"debugger": {
69+
"clock": 10000000,
70+
"gdbserver": "My Server Options
71+
",
72+
"name": "<default>",
73+
"port": "swd",
74+
"start-pname": "Core0",
75+
"terminal": 4444,
76+
},
7577
"device": "MyVendor::MyDevice",
7678
"device-pack": "MyVendor::[email protected]",
7779
"generated-by": "csolution version 2.8.0",

src/cbuild-run/cbuild-run-types.ts

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

17-
export type OutputFileType = 'lib'|'elf'|'hex'|'bin';
17+
export type OutputFileType = 'lib'|'elf'|'hex'|'bin'|string;
18+
export type LoadType = 'image+symbols'|'symbols'|'image'|'none';
1819

1920
export interface OutputType {
2021
file: string;
2122
type: OutputFileType;
22-
info: string;
23-
run: string;
24-
debug: string;
23+
info?: string;
24+
load: LoadType;
25+
'load-offset'?: number;
26+
pname?: string;
2527
};
2628

2729
export interface MemoryType {
@@ -44,16 +46,27 @@ export interface SystemDescriptionType {
4446
file: string;
4547
type: SystemDescriptionTypeType;
4648
info?: string;
49+
pname?: string;
50+
};
51+
52+
export interface GdbserverType {
53+
port: number;
54+
pname?: string;
55+
punit?: number;
4756
};
4857

4958
export type ProtocolType = 'swd'|'jtag';
5059

5160
export interface DebuggerType {
5261
name: string;
5362
info?: string;
54-
protocol: ProtocolType;
55-
clock: number;
56-
dbgconf: string;
63+
protocol?: ProtocolType;
64+
clock?: number;
65+
dbgconf?: string;
66+
'start-pname'?: string;
67+
gdbserver?: GdbserverType[];
68+
terminal?: string;
69+
trace?: string;
5770
};
5871

5972
export interface DebugVarsType {
@@ -94,10 +107,21 @@ export interface SwdType {
94107
targetsel?: number;
95108
};
96109

110+
export interface DatapatchType {
111+
address: number;
112+
value: number;
113+
mask?: number;
114+
type?: string;
115+
info?: string;
116+
};
117+
97118
export interface AccessPortType {
98119
apid: number;
99120
index?: number;
100121
address?: number;
122+
HPROT?: number;
123+
SPROT?: number;
124+
datapatch?: DatapatchType[];
101125
accessports?: AccessPortType[];
102126
};
103127

@@ -112,14 +136,14 @@ export type ResetSequenceType = 'ResetSystem'|'ResetHardware'|'ResetProcessor'|s
112136

113137
export interface PunitType {
114138
punit: number;
115-
address?: number;
139+
address: number;
116140
};
117141

118142
export interface ProcessorType {
119-
pname: string;
143+
pname?: string;
120144
punits?: PunitType[];
121145
apid?: number;
122-
'reset-sequence': ResetSequenceType;
146+
'reset-sequence'?: ResetSequenceType;
123147
};
124148

125149
export interface DebugTopologyType {
@@ -134,6 +158,7 @@ export interface CbuildRunType {
134158
'generated-by'?: string;
135159
'solution'?: string;
136160
'target-type'?: string;
161+
'target-set'?: string;
137162
compiler?: string;
138163
board?: string;
139164
'board-pack'?: string;
@@ -142,7 +167,7 @@ export interface CbuildRunType {
142167
output: OutputType[];
143168
'system-resources'?: SystemResourcesType;
144169
'system-descriptions'?: SystemDescriptionType[];
145-
debugger: DebuggerType[];
170+
debugger: DebuggerType;
146171
'debug-vars': DebugVarsType;
147172
'debug-sequences'?: DebugSequenceType[];
148173
programming?: ProgrammingType[];

test-data/simple.cbuild-run.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ cbuild-run:
6868
pname: Core0
6969
from-pack: MyVendor::[email protected]
7070
debugger:
71-
- name: <default>
72-
port: swd
73-
clock: 10000000
71+
name: <default>
72+
port: swd
73+
clock: 10000000
74+
start-pname: Core0
75+
terminal: 4444
76+
gdbserver: |
77+
My Server Options
7478
debug-sequences:
7579
- name: MySequence
7680
blocks:

0 commit comments

Comments
 (0)