are you a platform/embedded developer?
do you need to interact with hardware in a semi-custom manner?
would you like to suffer a lot less doing it?

if so, #GlasgowInterfaceExplorer might be for you. the code below is all you need to build a custom testbench for a DUT you've never seen before. just as easily you can add JTAG/SWD debug, protocol analyzers, etc.

Doing a bit of #GlasgowInterfaceExplorer experimentation today

☑️ Running the self test
❎ Using any applet shipped with the software
❎ Writing a simple applet myself
👉 Monkey-patching Glasgow build system internals

Good news: Got my RCA VP3301 video terminal with #CDP1802 CPU and RCA VIS chipset this weekend!

Bad news: DIN plug I ordered from Digi-Key for power input was missing one of the pieces needed to assemble it.

Good news: Raised the issue on the Digi-Key web site, and notice of replacement part shipment being approved arrived very quickly, even though it's late Sunday evening!

Bad news: I have not powered up the terminal yet.

Good news: I did dump the terminal's ROM, which is not believed to be archived yet by the #COSMAC community! It was even my first time actually using my #glasgowinterfaceexplorer for a real purpose.

Bad news: While the terminal came with a user's manual and a schematic of the UART subsystem, it didn't include a full schematic, so it'll take some work to figure out the address map and whatnot.

Good news: Reverse engineering old computers is fun!

i've upgraded the Ethernet controller applet for #GlasgowInterfaceExplorer

this is the main loop of the applet working in bridge mode (acting as a network card for your PC). no weird optimizations, no hacks, just a loop that forwards packets in normal boring Python

on a 100BASE-T link, i get ~95.5 Mbps [saturated link] of upload bandwidth and ~70 Mbps of download bandwidth before packet loss starts

how cool is this?

it is now possible to set arbitrary strap pins with #GlasgowInterfaceExplorer! use `glasgow multi <...> ++ gpio --pins B0:3 B0=0 B1=H B2=L B3=1` to strap B0 strong low, B1 weak high, B2 weak low, B3 strong high

the GPIO applet doesn't take up USB endpoint resources, so this is "free": you can append `++ gpio` to any applet command line you'd like

i don't personally do retrocomputing but a lot of the design for #GlasgowInterfaceExplorer is made with an explicit purpose of making retrocomputing nicer (for example, the support for true 5 V TTL that we went to great lengths to preserve, vs. only supporting 3.3 V at most)

i'm quite happy to add support for more retro interfaces to it too

@whitequark works like a charm, SWD is pretty much what I work with 90% of the time.

Pretty much removed 3 devices from my desk, but most importantly... de-cluttered my tooling config on VSCodium 😍

I just had to configure SWD and the probe on #probe-rs cargo runner config and it happily run a Rust based blinky example on a STM32F411CEU6 ( Black pill ) board.

Thanks again for the hard work ❤️

Having this + uart on #glasgowinterfaceexplorer 's portB as the second applet is such a quality of life improvement.

what should i add to #GlasgowInterfaceExplorer next?

i've upgraded the SWD probe for #GlasgowInterfaceExplorer to be able to use 48 MHz SWCLK and now probe-rs benchmarks show 1.7 MB/s reads and 1.9 MB/s writes!

as it turns out, i've accidentally beaten every single probe in the probe-rs performance comparison (https://9names.github.io/embedded/rust/debug/2022/04/07/cmsisdap-probe-performance.html) without even really trying to

PR at https://github.com/GlasgowEmbedded/glasgow/pull/873

CMSIS-DAP debug probe performance

CMSIS-DAP debug probe performance There are quite a few CMSIS-DAP USB debug probes in the wild, and a lot of other devices can be converted into CMSIS-DAP debug probes using various firmware projects. Most of these derive a lot of the core debugger functionality from ARM sources, though there are exceptions. These probes typically do not make any performance claims as universal tooling support and easy OS compatibility is a higher priority, but that does make choosing or recommending one over the other more difficult than it needs to be. I could not find any benchmarks of these anywhere, but I do have a small collection of probes and other embedded hardware that can run the open probe firmwares - so I spent a few days running some benchmarks and collecting data! Note: This post has been edited since original posting * 2022-04-18 - rustyprobe was slower than expected because the firmware tested was modified to only enumerate as cmsisdap-v1 * added rust-dap and a non-turbo firmware build of hs-probe to the dataset * added a link to the data in CSV form at the bottom of the page Hardware Test system All tests were performed on a Ryzen 3600 running Ubuntu 20.04 with Linux kernel 5.16 USB performance can vary greatly between Operating Systems - these results may not match yours. Probes The commercial probes I used for testing were: LPC-Link2 MCU-Link (with both official firmare and the latest DAPLink release) J-Link EDU Mini (in J-Link mode for comparison to CMSIS-DAP) STLink v3 (onboard debugger for Nucleo-H743ZI2) (STLink mode for comparison to CMSIS-DAP) Dev boards I also tested for performance: stm32f411 USB-C pill (ARM WeAct CMSIS-DAP firmware) Raspberry Pi Pico (DapperMime, RustyProbe and rust-dap firmware) STLink V2 clone (STLink mode, latest firmware, for comparison to CMSIS-DAP) stm32f103 blue pill DAP42 I also tested the BBC Microbit V2 with its onboard debugger, as this board is one of the recommended boards for folks new to Embedded Rust. Targets I tested each of the above external probes against the following Microcontrollers: RP2040 STM32H743ZI ATSAMD51 The speeds achieved for each target were identical (as you might expect) so I will only show graphs using STM32H7 as a target, since that was supported by the most probes. The MicroBit V2 debugger was tested against NRF52833 (the MCU on the Microbit V2), but is listed in the graphs next to everything else to keep things simple. Software For testing I used the benchmark example from the probe-rs repo. The original version only lets you choose a few SWD frequencies - I removed this check so I could get a few more data points. The list of frequencies tested (in KHz): 100, 200, 300, 600, 1200, 2400, 4800, 10000, 20000, 40000, 80000, 100000, 200000 Note that probes are free to choose their own frequency based on these requests, so sometimes a probe will perform better/worse than you would expect at a particular frequency. Sometimes instead of limiting the frequency the probe rejected it or could not connect at this frequency. At these points the graph will show no data. The RTT tests were done with firmware that effectively boils down to loop { rprint!("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n"); } This may or may not be representative of what is in your code. RTT throughput is measured with a very basic program and should not be considered accurate, but it should be good enough to provide relative performance. https://github.com/9names/stdoutbytecount Results No probe achieved greater performance at a requested speed above 40MHz, so graphs are plotted up to 80MHz. Each graph has either write or read performance, since they are measured seperately and are often different. All probes Full-speed probes It’s very hard to see the performance of the USB Full Speed probes when plotted against the high-speed ones. Here are some graphs with the USB High Speed probes removed. Write performance for USB-C pill and rustyprobe are identical, so they overlap perfectly. rustyprobe is slightly slower on read at lower frequencies. dap42 always uses the same frequency (internally it’s hardcoded to 10Mhz SWD) so performance for that probe is always the same regardless of requested frequency. rust-dap also runs at a fixed frequency. CMSIS-DAP V2 firmware is roughtly twice as fast as CMSIS-DAP V1 firmware on USB Full Speed Comparison against non-CMSIS-DAP probes Since hsprobe is clearly the fastest CMSIS-DAP probe in my testing, I thought it might be interested to compare it’s performance vs the proprietary probes supported by probe-rs. I did not expect either of the STLinks to perform this well, to be honest. It is nice to know you don’t need an expensive probe to get good performance. RTT performance My assumption was that read/write throughput would have a direct correlation with RTT throughput, and that’s mostly true. One outlier here is MCU-Link running DAPLink firmware, which manages to acheive nearly twice the RTT throughput despite having lower read/write performance than the default MCU-Link firmware. Conclusion My main takeaways from this testing: CMSIS-DAP is not a very efficient protocol. The data rates achieved by the high-speed probes are below what could be achieved over USB Full Speed, and the Full Speed ones are even slower. There are plenty of gains to be had by adding extensions like the hardware vendors do, while still preserving the universal compatibility of the standard. The performance of all USB Full Speed CMSIS-DAP V1 probes are basically equivalent, and the same seems to be true for V2 though my sample size is small here. I would not recommend DAP42 or rust-dap if care about low-speed connections (long wires, etc) since it won’t honour the requested speeds. HSProbe is the fastest CMSIS-DAP probe that I own STLink performance is better than expected. The USB Full Speed STLink V2 being almost the same performance class as the cheaper USB High Speed probes was quite surprising. The V3 being twice as fast as HSProbe is also not what I expected, but obviously the limitation is that you can only debug STM processors with this probe. JLink performance, even without using their DLL or proprietary protocol, is better than I expected. I was anticipating it being beaten by the Full Speed probes, and this is not the case. It’s still not good though. And if you want RTT, there are better CMSIS-DAP options. Data If you’d prefer to see the raw data or make your own graphs, download the data in CSV from here If you have enjoyed this content, please consider sponsoring probe-rs I have no affiliation, but without their software I could not have done any of this testing. Plus, we all benefit when our tools improve. https://github.com/sponsors/probe-rs

9names’ projects