My notes flashing LiteX-CNC on a Colorlight 5A-75E (solved)

More
01 Oct 2022 16:16 - 01 Oct 2022 16:20 #253186 by DePrutser
Hi All,

In this thread I'm documenting my attempts to flash LiteX-CNC firmware [6] on my Colorlight 5A-75E [1].
I have the following programmers:
USB Blaster (ALTERA CPLD / FPGA download cable) [2]
Cmsis Dap/Daplink Emulator STM32 Debug Probe [3]
Pi Pico Board RP2040 [4]
CKS32F103C8T6 STM32F103C8T6 ARM STM32 Minimum System Development Board Module [5]

Any suggestions on what software is available is welcome.

[1] github.com/q3k/chubby75/tree/master/5a-75e
[2] www.aliexpress.us/item/2251800524323433.html
[3] nl.aliexpress.com/item/1005002784627064.html
[4] www.aliexpress.us/item/3256804322303962.html
[5] www.aliexpress.us/item/2251801562130385.html
[6] github.com/cdwijs/LiteX-CNC/tree/expanded-readme
Last edit: 01 Oct 2022 16:20 by DePrutser. Reason: Forgot a programmer
The following user(s) said Thank You: andypugh

Please Log in or Create an account to join the conversation.

More
02 Oct 2022 15:00 #253257 by DePrutser
First contender: The Altera USB Blaster.  The pinout of the 10-pin cable is like this, the difference between the different sources is denoted by "|":
[1]  [2] [3]
1 TCK | TRGTCK
2 GND
3 TDO | TRGTDO
4 VTref | VCC(TRGT) | TRGVCC
5 TMS | TRGTMS
6 nSRST | PROC_RST
7 Vsupply| -
8 (nTRST) | -
9 TDI | TRGASDO
10 GND

For the Colorlight 75E, the pins TDO, TDI, TMS, TCK, 3v3 and GND are used [4], so the required connections are like this:
COLORLIGHT 75E - signal - USB Blaster
J30 - TDO - 3
J32 - TDI - 9
J31 - TMS - 5
J27 - TCK - 1
J33 - 3v3 - 7
J34 - GND - 2,10

[1] www.digital-circuitry.com/IMAGES/webpage...ster_JTAG_pinout.jpg
[2] www.intel.com/content/dam/support/jp/ja/...b-blstr-ii-cable.pdf page 2-3
[3] www.terasic.com.tw/wiki/Terasic_USB_Blaster_revB_Manual
[4] github.com/q3k/chubby75/tree/master/5a-75e

Please Log in or Create an account to join the conversation.

More
06 Oct 2022 18:58 #253629 by DePrutser
It looks like i need openocd, with 2 config files. One for the Altera USB Blaster, and the other for the ECP5 FPGA.

here [1] they suggest this for the file "ecp5.ocd"
# file: ecp5.ocd
telnet_port 4444
gdb_port 3333

# JTAG TAPs
jtag newtap lfe5 tap -expected-id 0x21111043 -irlen 8 -irmask 0xFF -ircapture 0x5

# -expected-id should match ECP5 CHIP_ID:
# 12F: 0x21111043
# 25F: 0x41111043
# 45F: 0x41112043
# 85F: 0x41113043

init
scan_chain
svf -tap lfe5.tap -quiet -progress bitstream.svf
shutdown

here [2] they suggest they suggest this for the file "openocd.cfg"
interface usb_blaster
jtag_khz 1000
jtag newtap ep3c25f324 tap -irlen 10 -expected-id 0x020f30dd
init
svf led/led.svf quiet

here [3] they specify this:
# ecp3.cfg
# OpenOCD commands

telnet_port 4444
gdb_port 3333

# JTAG TAPs
jtag newtap lfe5u25 tap -expected-id 0x41111043 -irlen 8 -irmask 0xFF -ircapture 0x5
#jtag newtap lfe5u45 tap -expected-id 0x41112043 -irlen 8 -irmask 0xFF -ircapture 0x5
#jtag newtap lfe5u85 tap -expected-id 0x41113043 -irlen 8 -irmask 0xFF -ircapture 0x5

init
scan_chain
svf -tap lfe5u25.tap -quiet -progress project/project_project_sram.svf
shutdown

From here [4] I get the impression openocd is capable of autodetecting an JTAG tap port:
my_vsllink.cfg:
interface vsllink
vsllink_usb_vid 0x0483
vsllink_usb_pid 0x5740
adapter_khz 100
transport select jtag

In the terminal:
openocd -f my_vsllink.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
adapter speed: 100 kHz
jtag
Info : Versaloon(0x15)by Simon(compiled on Dec 20 2018)
Info : USB_TO_XXX abilities: 0x0000176E:0x010001EF:0xC0000007
Info : clock speed 100 kHz
Warn : There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!
Info : JTAG tap: auto0.tap tap/device found: 0x44002093 (mfg: 0x049 (Xilinx), part: 0x4002, ver: 0x4)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x44002093"
Error: IR capture error at bit 2, saw 0x3FFFFFFFFFFFFFF5 not 0x...3
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined

I'm not sure yet what the correct commands and config files for openosc are, but I'm getting closer.

[1] github.com/emard/ulx3s/blob/master/doc/MANUAL.md
[2] forum.sparkfun.com/viewtopic.php?t=22458
[3] github.com/f32c/f32c/blob/master/rtl/pro...d/ulx3s/ecp5-25f.ocd
[4] github.com/zoobab/versaloon

Please Log in or Create an account to join the conversation.

More
07 Oct 2022 05:41 #253644 by DePrutser
First test using my usb blaster.
$ cat myopenocd.cfg
adapter driver usb_blaster
$ openocd -f ./myopenocd.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : No lowlevel driver configured, using ftdi
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Warn : There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined
^Cshutdown command invoked

The same command without the usb blaster connected:
$ openocd -f ./myopenocd.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : No lowlevel driver configured, using ftdi
Info : usb blaster interface using libftdi
Error: unable to open ftdi device: device not found

Looks like the usb blaster has been found. Next step is to connect the colorlight board.

Please Log in or Create an account to join the conversation.

More
07 Oct 2022 21:24 #253717 by DePrutser
I have connected the colorlight board to the usb blaster, and the fpga is detected, but I do get an IR capture error:

$ openocd -f ./myopenocd.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : No lowlevel driver configured, using ftdi
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Warn : There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!
Info : JTAG tap: auto0.tap tap/device found: 0x41111043 (mfg: 0x021 (Lattice Semi.), part: 0x1111, ver: 0x4)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x41111043"
Error: IR capture error at bit 2, saw 0x3fffffffffffff05 not 0x...3
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined

Please Log in or Create an account to join the conversation.

More
07 Oct 2022 21:36 #253718 by DePrutser
Here[1] i see the following openosc output while flashing a colorlight FPGA board. Notice the irlen is 8 and not the 2 in my output:

$ sudo openocd -f interface/vsllink.cfg -f chubby.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
adapter speed: 200 kHz
Info : Versaloon(0x15)by Simon(compiled on Jul 26 2020)
Info : USB_TO_XXX abilities: 0x00000208:0x010001E3:0xC0000007
Info : clock speed 200 kHz
Info : JTAG tap: lfe5u25.tap tap/device found: 0x41111043 (mfg: 0x021 (Lattice Semi.), part: 0x1111, ver: 0x4)
Warn : gdb services need one or more targets defined
TapName Enabled IdCode Expected IrLen IrCap IrMask
--






0 lfe5u25.tap Y 0x41111043 0x41111043 8 0x05 0xff
svf processing file: "top.svf"
95%
Time used: 0m50s625ms
svf file programmed successfully for 620 commands with 0 errors
shutdown command invoked

[1] forum.1bitsquared.com/t/colorlight-5a-75...lopment-platform/141

Please Log in or Create an account to join the conversation.

More
07 Oct 2022 21:38 #253719 by DePrutser
Now I don't get an error anymore, but I don't know if it actually works yet:
$ cat myopenocd.cfg
adapter driver usb_blaster
jtag newtap auto0 tap -irlen 8 -expected-id 0x41111043

$ openocd -f ./myopenocd.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : No lowlevel driver configured, using ftdi
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: auto0.tap tap/device found: 0x41111043 (mfg: 0x021 (Lattice Semi.), part: 0x1111, ver: 0x4)
Warn : gdb services need one or more targets defined

Please Log in or Create an account to join the conversation.

More
12 Oct 2022 05:40 #254000 by DePrutser
I tried to flash the .lpf file I made using this guide [1] I can't get it to work yet:

[cedric@cedric ~]$ cat myopenocd.cfg
adapter driver usb_blaster
jtag newtap auto0 tap -irlen 8 -expected-id 0x41111043

[cedric@cedric ~]$ cat colorlight_5a_75e.cfg
init
scan_chain
svf -progress colorlight_5a_75e.lpf
shutdown

[cedric@cedric ~]$ openocd -f ./myopenocd.cfg -f ./colorlight_5a_75e.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : No lowlevel driver configured, using ftdi
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: auto0.tap tap/device found: 0x41111043 (mfg: 0x021 (Lattice Semi.), part: 0x1111, ver: 0x4)
Warn : gdb services need one or more targets defined
svf processing file: "colorlight_5a_75e.lpf"
0% BLOCK RESETPATHS;
Error: invalid svf command: BLOCK
Error: fail to run command at line 1
Time used: 0m0s0ms
svf file programmed failed

[1] forum.linuxcnc.org/27-driver-boards/4692...itex-cnc-on-linuxcnc

Please Log in or Create an account to join the conversation.

More
12 Oct 2022 19:13 #254032 by DePrutser
It turns out the .lpf was not the actual FPGA bitstream. After generating the bitstream (see [1]), I still get an error, but I got a lot further:

$ cat myopenocd.cfg
adapter driver usb_blaster
jtag newtap auto0 tap -irlen 8 -expected-id 0x41111043

$ cat colorlight_5a_75e.cfg
init
scan_chain
svf -progress colorlight_5a_75e.svf
shutdown

$ openocd -f ./myopenocd.cfg -f ./colorlight_5a_75e.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : No lowlevel driver configured, using ftdi
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: auto0.tap tap/device found: 0x41111043 (mfg: 0x021 (Lattice Semi.), part: 0x1111, ver: 0x4)
Warn : gdb services need one or more targets defined
svf processing file: "colorlight_5a_75e.svf"
0% HDR 0;
0% HIR 0;
0% TDR 0;
0% TIR 0;
0% ENDDR DRPAUSE;
0% ENDIR IRPAUSE;
0% STATE IDLE;
0% SIR 8 TDI (E0);
0% MASK (FFFFFFFF);
0% SIR 8 TDI (1C);
0% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
0% SIR 8 TDI (C6);
0% SDR 8 TDI (00);
0% RUNTEST IDLE 2 TCK 1.00E-02 SEC;
0% SIR 8 TDI (0E);
0% SDR 8 TDI (01);
0% RUNTEST IDLE 2 TCK 1.00E-02 SEC;
0% SIR 8 TDI (3C);
0% MASK (0000B000);
0% SIR 8 TDI (46);
0% SDR 8 TDI (01);
0% RUNTEST IDLE 2 TCK 1.00E-02 SEC;
0% SIR 8 TDI (7A);
0% RUNTEST IDLE 2 TCK 1.00E-02 SEC;
0% 0000DCFFFFFFFFCDBDFFFFFF006CAC4C82E24282C26CB462AC4CB4AAACA26232045C2E4E860A00FF);
0% 0000000000FF173300000000000000000000FF173300000000000000000000FF1733000000000000);
0% 0000FF173300000000000000000000FF173300000000000000000000FF1733000000000000000000);
<snip>
95% 00000000000000000000000000000000000000000000000000000000000000000000000000000000);
95% 00000000000000000000000000000000000000000000000000000000000000000000000000000000);
95% SIR 8 TDI (FF);
95% RUNTEST IDLE 100 TCK 1.00E-02 SEC;
95% SIR 8 TDI (C0);
95% RUNTEST IDLE 2 TCK 1.00E-03 SEC;
95% MASK (FFFFFFFF);
95% SIR 8 TDI (26);
95% RUNTEST IDLE 2 TCK 2.00E-01 SEC;
95% SIR 8 TDI (FF);
95% RUNTEST IDLE 2 TCK 1.00E-03 SEC;
95% SIR 8 TDI (3C);
95% MASK (00002100);
Error: tdo check error at line 28
Error: READ = 0x0201f10
Error: WANT = 0x0000000
Error: MASK = 0x000b000
Time used: 0m1s761ms
svf file programmed failed


[1] forum.linuxcnc.org/27-driver-boards/4692...on-linuxcnc?start=20

Please Log in or Create an account to join the conversation.

More
16 Oct 2022 21:06 #254260 by benitoss
I recommend to use OpenFPGALoader to program the ColorLight 5A-75E board. --> github.com/trabucayre/openFPGALoader
The reason is because you only need to work with bit files

The command line for usb-blaster is:
$ openFPGALoader -c usb-blaster -m my_bitstream.bit

For PI PICO board you need to use the DirtyJTAG proyect for PI PICO
github.com/phdussud/pico-dirtyJtag/

And the command line for OpenFPGALoader is :
$ openFPGALoader -c dirtyJtag -m my_bitstream.bit

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.201 seconds
Powered by Kunena Forum