Skip to content

Commit

Permalink
Add BMP connect_srst option (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-mk authored Sep 1, 2022
1 parent 3a2079a commit d4858f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,10 @@
"powerOverBMP": {
"type": "string",
"description": "Power up the board over Black Magic Probe. \"powerOverBMP\" : \"enable\" or \"powerOverBMP\" : \"disable\". If not set it will use the last power state."
},
"bmpConnectUnderReset": {
"type": "boolean",
"description": "Configure connect under SRST."
}
},
"required": [
Expand Down Expand Up @@ -2728,6 +2732,10 @@
"powerOverBMP": {
"type": "string",
"description": "Power up the board over Black Magic Probe. \"powerOverBMP\" : \"enable\" or \"powerOverBMP\" : \"disable\". If not set it will use the last power state."
},
"bmpConnectUnderReset": {
"type": "boolean",
"description": "Configure connect under SRST."
}
},
"required": [
Expand Down Expand Up @@ -3050,6 +3058,7 @@
"nan": "^2.14.2",
"node-interval-tree": "^1.3.3",
"prebuild-install": "^7.0.1",
"react": "^18.2.0",
"ringbufferjs": "^1.1.0",
"safe-buffer": "^5.2.1",
"stream-json": "^1.7.3",
Expand Down
6 changes: 6 additions & 0 deletions src/bmp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export class BMPServerController extends EventEmitter implements GDBServerContro
`target-select extended-remote ${this.args.BMPGDBSerialPort}`
];

if (this.args.bmpConnectUnderReset) {
commands.push('interpreter-exec console "monitor connect_rst enable"');
} else {
commands.push('interpreter-exec console "monitor connect_rst disable"');
}

if (this.args.powerOverBMP === 'enable') {
commands.push('interpreter-exec console "monitor tpwr enable"');
// sleep for 100 ms. MCU need some time to boot up after power up
Expand Down
1 change: 1 addition & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ export interface ConfigurationArguments extends DebugProtocol.LaunchRequestArgum
// BMP Specific
BMPGDBSerialPort: string;
powerOverBMP: string;
bmpConnectUnderReset: boolean;

// QEMU Specific
cpu: string;
Expand Down

0 comments on commit d4858f0

Please sign in to comment.