Skip to content

Commit 7785593

Browse files
committed
JTAG support added
1 parent 09cf0fe commit 7785593

File tree

6 files changed

+318
-109
lines changed

6 files changed

+318
-109
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ embedded-hal-02 = { package = "embedded-hal", version = "0.2.7", features = ["un
1919
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
2020
replace_with = { version = "0.1.7", default-features = false, features = ["panic_abort"] }
2121
usbd-serial = "0.2.0"
22-
dap-rs = { version = "0.2.0", features = ["defmt"] }
22+
# dap-rs = { version = "0.2.0", features = ["defmt"] }
23+
dap-rs = { git = "https://github.com/bugadani/dap-rs.git", branch = "jtag" }
2324
git-version = "0.3.5"
2425
pio-proc = "0.2.1"
2526
pio = "0.2.1"

src/bin/app.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use rusty_probe as _;
66
#[rtic::app(device = rp2040_hal::pac, dispatchers = [XIP_IRQ, CLOCKS_IRQ])]
77
mod app {
88
use core::mem::MaybeUninit;
9-
use dap_rs::usb_device::class_prelude::*;
9+
use dap_rs::{jtag::TapConfig, usb_device::class_prelude::*};
10+
use rp2040_hal::usb::UsbBus;
11+
use rtic_monotonics::rp2040::prelude::*;
1012
use rusty_probe::{
1113
leds::{LedManager, Vtarget},
1214
setup::*,
1315
};
14-
use rp2040_hal::usb::UsbBus;
15-
use rtic_monotonics::rp2040::prelude::*;
1616

1717
#[shared]
1818
struct Shared {
@@ -31,6 +31,7 @@ mod app {
3131
#[init(local = [
3232
usb_bus: MaybeUninit<UsbBusAllocator<UsbBus>> = MaybeUninit::uninit(),
3333
delay: MaybeUninit<rusty_probe::systick_delay::Delay> = MaybeUninit::uninit(),
34+
scan_chain: [TapConfig; 8] = [TapConfig::INIT; 8],
3435
])]
3536
fn init(cx: init::Context) -> (Shared, Local) {
3637
let (
@@ -41,7 +42,13 @@ mod app {
4142
translator_power,
4243
target_power,
4344
target_physically_connected,
44-
) = setup(cx.device, cx.core, cx.local.usb_bus, cx.local.delay);
45+
) = setup(
46+
cx.device,
47+
cx.core,
48+
cx.local.usb_bus,
49+
cx.local.delay,
50+
cx.local.scan_chain,
51+
);
4552

4653
voltage_translator_control::spawn().ok();
4754

0 commit comments

Comments
 (0)