Closed lmbollen closed 1 week ago
Perhaps we could pass these in using environment variables? I.e., something like:
USB_DEVICE="1-5.1:1" gdb the_script.tcl
The TCL could then do something like:
set usb_device [env USB_DEVICE]
if { $usb_device == "" } {
error "Required environment variable 'USB_DEVICE' is not set."
}
@martijnbastiaan How would we then open multiple jtag devices at once?
We're currently using withCreateProcess
, which takes a CreateProcess
. Each CreateProcess
can pass its own environment variables (env
). I.e., you would start OpenOCD multiple times, each with its own environment variable.
Ah interesting. Currently @hiddemoll has a working implementation, but that seems like a way simpler approach. You'll see the PR soon I think
We currently have some functionality to start
gdb
and run a script that is located outside of the Haskell code. But it would be nice to at least have a reusable function to load a binary onto the FPGA. This could simply be a function that starts openocd, starts gdb, programs the soft-core connected via JTAG and starts execution.Currently the
adapter usb location
is hardcoded to1-5.1:1
, in thesipeed.tcl
script. We need to be able to control this via haskell.The location itself is a static USB path that points to the JTAG interface. These paths can be shown using
lsbusb -t
where1-5.1:1
means: