April 24, 2024

EBAZ4205 Bitcoin miner board - Versaloon and JTAG

I hear several things about Versaloon.
It runs on a blue pill
It performs better than Dirty JTAG
It is a better choice if you want to use OpenOCD rather than urJTAG

Try it

We use an ST-link v2 adapter to flash it into a blue pill with this command:
st-flash write Versaloon-STM32F103C8_BluePill.bin 0x08000000
st-flash 1.8.0
2024-04-25T17:07:23 INFO common.c: STM32F1xx_MD: 20 KiB SRAM, 64 KiB flash in at least 1 KiB pages.
file Versaloon-STM32F103C8_BluePill.bin md5 checksum: edbd5a614598fbe65d8f4e09cdc1, stlink checksum: 0x004f025e
2024-04-25T17:07:23 INFO common_flash.c: Attempting to write 55532 (0xd8ec) bytes to stm32 address: 134217728 (0x8000000)
-> Flash page at 0x800d800 erased (size: 0x400)
2024-04-25T17:07:24 INFO flash_loader.c: Starting Flash write for VL/F0/F3/F1_XL
2024-04-25T17:07:24 INFO flash_loader.c: Successfully loaded flash loader in sram
2024-04-25T17:07:24 INFO flash_loader.c: Clear DFSR
 55/55  pages written
2024-04-25T17:07:28 INFO common_flash.c: Starting verification of write complete
2024-04-25T17:07:29 INFO common_flash.c: Flash written and verified! jolly good!

Plug it in

I see this in the linux logs:
Apr 25 17:19:38 trona kernel: usb 4-1.2: new full-speed USB device number 119 using ehci-pci
Apr 25 17:19:38 trona kernel: usb 4-1.2: New USB device found, idVendor=0483, idProduct=a038, bcdDevice= 1.00
Apr 25 17:19:38 trona kernel: usb 4-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 25 17:19:38 trona kernel: usb 4-1.2: Product: Versaloon
Apr 25 17:19:38 trona kernel: usb 4-1.2: Manufacturer: STMicroelectronics
Apr 25 17:19:38 trona kernel: usb 4-1.2: SerialNumber: 65FFC6601568254535744078
Apr 25 17:19:38 trona kernel: cdc_acm 4-1.2:1.1: ttyACM0: USB ACM device
Having ttyACM0 pop up is unexpected.

I try urjtag, but it fails:

cable vsllink
error: Couldn't connect to suitable USB device.
error: not found: no USB connections
(This is a known bug and on the TODO list on the web page).

Try it with OpenOCD

I try this:
openocd -f /usr/share/openocd/scripts/interface/vsllink.cfg
It sort of works, but complains that I didn't select "transport". (i.e. I need a line like "transport jtag")

As per the versaloon page I create a file "versa.cfg" with this:

interface vsllink
vsllink_usb_vid 0x0483
vsllink_usb_pid 0x5740
adapter_khz 100
transport select jtag
Then we try again:
openocd -f versa.cfg
Open On-Chip Debugger 0.12.0
DEPRECATED! use 'adapter driver' not 'interface'
DEPRECATED! use 'vsllink usb_vid' not 'vsllink_usb_vid'
DEPRECATED! use 'vsllink usb_pid' not 'vsllink_usb_pid'
DEPRECATED! use 'adapter speed' not 'adapter_khz'
However, note above that the device tells us: "idVendor=0483, idProduct=a038", so let's change the usb_pid accordingly. After this change (and fixing one wiring error), we get on the air with:
adapter driver vsllink
vsllink usb_vid 0x0483
vsllink usb_pid 0xA038
adapter speed 100
transport select jtag
It reports:
Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
Info : JTAG tap: auto0.tap tap/device found: 0x13722093 (mfg: 0x049 (Xilinx), part: 0x3722, ver: 0x1)
Info : JTAG tap: auto1.tap tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x13722093"
Warn : AUTO auto1.tap - use "jtag newtap auto1 tap -irlen 2 -expected-id 0x4ba00477"
It is reporting a Xilinx and an ARM gadget on JTAG (which sounds like the FPGA part of the ZYNQ as well as the ARM dual core side of the ZYNQ). But nothing that looks like NAND flash.
scan_chain
   TapName             Enabled  IdCode     Expected   IrLen IrCap IrMask
-- ------------------- -------- ---------- ---------- ----- ----- ------
 0 auto0.tap              Y     0x13722093 0x00000000     2 0x01  0x03
 1 auto1.tap              Y     0x4ba00477 0x00000000     2 0x01  0x03
At this point I am declaring "deep enough". I expected the flash chips to show up directly on JTAG -- and they don't. I am going to direct my efforts now into learning how to set up linux on a SD card and compile my own executables to run under linux.
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org