Skip to content

Commit 182761c

Browse files
authored
Merge pull request #100 from Neotron-Compute/vscode-config
Use probe-rs for debugging.
2 parents 668a46a + 24ea739 commit 182761c

File tree

2 files changed

+16
-47
lines changed

2 files changed

+16
-47
lines changed

.vscode/launch.json

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,23 @@
11
{
2-
/*
3-
* Requires the Rust Language Server (RLS) and Cortex-Debug extensions
4-
* https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
5-
* https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug
6-
*/
72
"version": "0.2.0",
83
"configurations": [
94
{
10-
"type": "cortex-debug",
5+
"type": "probe-rs-debug",
116
"request": "launch",
12-
"name": "Debug (QEMU)",
13-
"servertype": "qemu",
14-
"cwd": "${workspaceRoot}",
15-
"preLaunchTask": "Cargo Build (debug)",
16-
"runToMain": true,
17-
"executable": "./target/thumbv7m-none-eabi/debug/neotron-pico-bios",
18-
/* Run `cargo build --example hello` and uncomment this line to run semi-hosting example */
19-
//"executable": "./target/thumbv7m-none-eabi/debug/examples/hello",
20-
"cpu": "cortex-m3",
21-
"machine": "lm3s6965evb",
22-
},
23-
{
24-
/* Configuration for the STM32F303 Discovery board */
25-
"type": "cortex-debug",
26-
"request": "launch",
27-
"name": "Debug (OpenOCD)",
28-
"servertype": "openocd",
29-
"cwd": "${workspaceRoot}",
30-
"preLaunchTask": "Cargo Build (debug)",
31-
"runToMain": true,
32-
"executable": "./target/thumbv7em-none-eabihf/debug/neotron-pico-bios",
33-
/* Run `cargo build --example itm` and uncomment this line to run itm example */
34-
// "executable": "./target/thumbv7em-none-eabihf/debug/examples/itm",
35-
"device": "STM32F303VCT6",
36-
"configFiles": [
37-
"interface/stlink-v2-1.cfg",
38-
"target/stm32f3x.cfg"
7+
"name": "Run with probe-rs",
8+
"speed": 20000,
9+
"preLaunchTask": "Cargo Build (release)",
10+
"flashingConfig": {
11+
"flashingEnabled": true,
12+
},
13+
"chip": "RP2040",
14+
"coreConfigs": [
15+
{
16+
// Change this to the binary you want to debug
17+
"programBinary": "${workspaceFolder}/target/thumbv6m-none-eabi/release/neotron-pico-bios",
18+
"rttEnabled": true
19+
}
3920
],
40-
"svdFile": "${workspaceRoot}/.vscode/STM32F303.svd",
41-
"swoConfig": {
42-
"enabled": true,
43-
"cpuFrequency": 8000000,
44-
"swoFrequency": 2000000,
45-
"source": "probe",
46-
"decoders": [
47-
{ "type": "console", "label": "ITM", "port": 0 }
48-
]
49-
}
5021
}
5122
]
5223
}

src/main.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ impl Hardware {
10631063
resets,
10641064
clocks.peripheral_clock.freq(),
10651065
2_000_000.Hz(),
1066-
&embedded_hal::spi::MODE_0,
1066+
embedded_hal::spi::MODE_0,
10671067
),
10681068
delay,
10691069
led_state: 0,
@@ -2624,9 +2624,7 @@ extern "C" fn power_control(power_mode: common::PowerMode) -> ! {
26242624
// Reboot to USB bootloader with no GPIOs and both USB interfaces
26252625
// enabled.
26262626
hal::rom_data::reset_to_usb_boot(0, 0);
2627-
loop {
2628-
core::unreachable!()
2629-
}
2627+
core::unreachable!()
26302628
}
26312629
_ => {
26322630
// Anything else causes a reset

0 commit comments

Comments
 (0)