adamgreig/ecpdap

`ecpdap program` fails but scan and probes work

nuudlman opened this issue · 2 comments

[OSS CAD Suite] C:\oss-cad-suite>ecpdap probes
Found 1 CMSIS-DAP probe:
  0d28:0204:0700000100150054340000124e543352a5a5a5a597969908 CMSIS-DAP-v1-MuseLab
[OSS CAD Suite] C:\oss-cad-suite>ecpdap scan
Detected JTAG chain, closest to TDO first:
 - 0: 0x41112043 (Lattice Semi.) [IR length: 8] [LFE5U-45]

The error:

[OSS CAD Suite] C:\oss-cad-suite>ecpdap program --freq 5000 C:\Users\isaac\Downloads\blink.bit -vv
[DEBUG jtagdap::probe] Attempting to open any connected probe
[DEBUG jtagdap::probe] Successfully opened v1 probe: ProbeInfo { name: Some("CMSIS-DAP-v1-MuseLab"), vid: 3368, pid: 516, sn: Some("0700000100150054340000124e543352a5a5a5a597969908"), v1_only: false }
[DEBUG jtagdap::dap] Requesting maximum packet size
[DEBUG jtagdap::dap] Checking probe for JTAG support
[DEBUG jtagdap::dap] Connecting to target
[DEBUG jtagdap::dap] Setting clock to 5000Hz
[DEBUG jtagdap::jtag] Running reset scan of JTAG chain
[DEBUG jtagdap::jtag] Scanning DR up to 192 bits
[INFO  jtagdap::jtag] JTAG DR scan chain detected as 32 bits long
[DEBUG jtagdap::jtag] Scanning IR up to 192 bits
[INFO  jtagdap::jtag] JTAG IR scan chain detected as 8 bits long
[DEBUG jtagdap::jtag] Found IDCODE: 0x41112043 (Lattice Semi.)
[INFO  jtagdap::jtag] Only one TAP detected, IR length 8
[DEBUG ecpdap] Automatically selecting ECP5 at TAP 0
[INFO  ecpdap::bitstream::parser] Parsing bitstream for metadata
[DEBUG ecpdap::bitstream::parser] Parsed to end of bitstream in 6ms
[INFO  ecpdap::bitstream] Checking bitstream IDCODE 0x41112043 against JTAG IDCODE 0x41112043
[DEBUG ecpdap::bitstream] IDCODEs match exactly, no action required.
[DEBUG ecpdap::bitstream] Skipping remove_spi_mode as no SPI_MODE command found.
 Programming [━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━] 0 B/1008.13 KiB (0 B/s; 00:00:00)                                                                                                                                                                                                                                    [DEBUG ecpdap] Checking ECP5 status before programming (06A00F10)
[INFO  ecpdap] BSE error present: ABRTError
[DEBUG jtagdap::dap] DAP dropped, disconnecting
[DEBUG jtagdap::dap] Disconnecting from target
Error: JTAG error

Caused by:
    0: DAP error
    1: Invalid response from probe.

blink.bit: https://github.com/wuxx/Colorlight-FPGA-Projects/blob/05459854c2bc4af59d962de116cd56ee57d862c5/demo/i9/blink.bit

I've tried reseating the som and cleaning both the sodimm finger and the jtag pins with 91% isopropyl alcohol, but I haven't had any luck with getting it to flash successfully.

I'm using ecpdap from today's nightly of the OSS Cad Suite (https://github.com/YosysHQ/oss-cad-suite-build/tree/2023-12-06).

Full log: log.txt

Hmm, I'm not sure how to debug this. The FPGA is reporting an error bit in the status register (ABRTError: "configuration aborted by the user") and so ecpdap gives up. You could try a lower frequency in case that helps. It might be some other odd electrical thing or something causing a reset? Lattice don't really elaborate on what the error really means.

I guess you are using the colorlite breakout board with the built-in programmer: does programming by dragging the .bit file onto the virtual USB storage device work?

It turns out that 5000 Hz was too low. Programming with the default frequency works just fine. (Dragging and dropping didn't work for some reason)

[OSS CAD Suite] C:\oss-cad-suite>ecpdap program C:\Users\isaac\Downloads\blink.bit -vv
[DEBUG jtagdap::probe] Attempting to open any connected probe
[DEBUG jtagdap::probe] Successfully opened v1 probe: ProbeInfo { name: Some("CMSIS-DAP-v1-MuseLab"), vid: 3368, pid: 516, sn: Some("0700000100150054340000124e543352a5a5a5a597969908"), v1_only: false }
[DEBUG jtagdap::dap] Requesting maximum packet size
[DEBUG jtagdap::dap] Checking probe for JTAG support
[DEBUG jtagdap::dap] Connecting to target
[DEBUG jtagdap::dap] Setting clock to 1000000Hz
[DEBUG jtagdap::jtag] Running reset scan of JTAG chain
[DEBUG jtagdap::jtag] Scanning DR up to 192 bits
[INFO  jtagdap::jtag] JTAG DR scan chain detected as 32 bits long
[DEBUG jtagdap::jtag] Scanning IR up to 192 bits
[INFO  jtagdap::jtag] JTAG IR scan chain detected as 8 bits long
[DEBUG jtagdap::jtag] Found IDCODE: 0x41112043 (Lattice Semi.)
[INFO  jtagdap::jtag] Only one TAP detected, IR length 8
[DEBUG ecpdap] Automatically selecting ECP5 at TAP 0
[INFO  ecpdap::bitstream::parser] Parsing bitstream for metadata
[DEBUG ecpdap::bitstream::parser] Parsed to end of bitstream in 7ms
[INFO  ecpdap::bitstream] Checking bitstream IDCODE 0x41112043 against JTAG IDCODE 0x41112043
[DEBUG ecpdap::bitstream] IDCODEs match exactly, no action required.
[DEBUG ecpdap::bitstream] Skipping remove_spi_mode as no SPI_MODE command found.
 Programming [━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━] 0 B/1008.13 KiB (0 B/s; 00:00:00)                               [DEBUG ecpdap] Checking ECP5 status before programming (00200F10)
 Programming [━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━] 1008.13 KiB/1008.13 KiB (17.90 KiB/s; 00:00:00)                 [DEBUG ecpdap] Checking ECP5 status after programming (00000100)
 Programming [━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━] 1008.13 KiB/1008.13 KiB (17.88 KiB/s; 00:00:00)                 Finished in 56.73s
[DEBUG jtagdap::dap] DAP dropped, disconnecting
[DEBUG jtagdap::dap] Disconnecting from target

Many thanks for the help!