Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BMP connect_srst option #735

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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