Octal450 / J-Runner-with-Extras

Source code to the J-Runner with Extras executable. Requires the proper support files, package can be found in README
https://www.realmodscene.com/index.php?/topic/10565-j-runner-with-extras-17559-built-in-timings-bugfixes-and-new-features/
MIT License
248 stars 33 forks source link

Add DirtyPico360 #46

Open ThisIsCheez opened 10 months ago

ThisIsCheez commented 10 months ago

2nd time submitting this. Updated to reflect your new version of 3.3.0r2

This adds functionality of using a Raspberry Pi Pico to flash Xilink based glitch chips using a combination of Pico-DirtyJtag Pico firmware and a newer build of UrJtag that supports LibUSB 1.0 and DirtyJtag.

The current version of UrJtag in J-Runner with Extras that is used for the xFlasher is an older version that does not support DirtyJtag. The newer build does not replace the current UrJtag build used for the xFlasher, but instead is in it's own directory of common/dirtypico. This was done to ensure no functionality with the xFlasher was not impacted nor needed testing, and the cross-compiled build of UrJtag only has LibUSB 1.0 driver support. The needed dll files, uf2 file for flashing the DirtyJtag firmware, and most recent copy of Zadig (needed for installing a signed copy of the libUSB-win32 drivers) are also found in common/dirtypico

The DirtyPico.cs class is mostly a copy and paste of SVF flashing portion of the xFlasher class since they both use UrJtag. Because of the way this build of UrJtag was cross-compiled, / or \ is required in the file paths when searching for a svf file. It will not recognize a single \ in the file path. You will notice to combat this I had to use static paths for svfPath and svfRoot since the original method of copying/storing the temp SVF file echoed the path with . The new temp storage location for the SVF file can be found @common/dirtypico/svftemp so the J-Runner folder can still be placed anywhere.

The proper VIP and PID have been added for J-Runner to properly detect the DirtyPico is connected, rules added so J-Runner is aware the DirtyPico can flash SVF files, and a logo has been added to resources. The downfall of DirtyJtag is it seems to fail/not understand the verification port of the SVF files. I do not understand enough about SVF files or FPGA flashing to know why this occurs. Because of this the "progress" argument in UrJtag is broken when using DirtyJtag, so we cannot use the same checks for a successful flash as the xFlasher and UrJtag does. The checks the xFlasher build of UrJtag uses is:

if (strLower.Contains("99%"))

But because we cannot get a progress on the DirtyJtag build of UrJtag the following is used:

if (strLower.Contains("between"))

This is used because UrJtag will display a "TDO mismatch error between XX and XX" when attempting to flash a glitch chip with a DirtyJtag device. In my experience this is simply caused by the verification portion of the SVF file but the timings are still programmed properly. If the SVF completely fails to flash then you will receive a genuine failure message, so looking for "between" in the final line of UrJtag is the best solution I have for reporting a successful flash in J-Runner.

Thank you, and look forward to your review, Josh.

UrJtag was cross-compiled from version 2021.03: https://sourceforge.net/projects/urjtag/files/urjtag/

DirtyJtag firmware was compiled from Pico-DirtyJtag v1.04: https://github.com/phdussud/pico-dirtyJtag