Cannot flash Tang Primer 20K

Open
#573 14 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start by reviewing the verbose output and reproduction details in this issue, including the reported failure while writing at 28.16% and the comparison with smaller bitstreams. The payload names no source files or tests, so locate the flash-writing path from the reported --write-flash entry point. Done means flash programming completes reliably for the Tang Primer 20K bitstream.

Written by the indexing model from the issue text.

Description

bug

Hi everyone, I just got a Tang Primer 20K (with devboard) to play with LiteX. While the official Gowin tools can program the flash correctly, they are a pain to use as they unload the ftdi driver, killing the UART port in the process.

OpenFPGAloader has issues programming the flash, as it seems to hang dusring the programming process. I am using version 0.13.1 from my distro. This does not always happen, it seems smaller bitstream can be flashed correctly.

I am not sure if it can be related to #572, as the detect part works for me. Thank you in advance and let me know if I need to do further debugging.

edoardo@edoardo-fedora:~$ openFPGALoader --verbose-level 2 --cable ft2232 --write-flash --bitstream /home/edoardo/Code/litex/linux-on-litex-vexriscv/build/sipeed_tang_primer_20k/gateware/sipeed_tang_primer_20k.fs
empty
write to flash
Jtag frequency : requested 6.00MHz   -> real 6.00MHz  
Raw IDCODE:
- 0 -> 0x0000081b
- 1 -> 0xffffffff
Fetched TDI, end-of-chain
found 1 devices
index 0:
	idcode 0x81b
	manufacturer Gowin
	family GW2A
	model  GW2A(R)-18(C)
	irlength 8
File type : fs
Parse file Parse /home/edoardo/Code/litex/linux-on-litex-vexriscv/build/sipeed_tang_primer_20k/gateware/sipeed_tang_primer_20k.fs: 
checksum 0xbd96
Done
DONE
bitstream header infos
CRCCheck: ON
Compress: OFF
ConfDataLength: 2110
LoadingRate: 2500000
ProgramDoneBypass: OFF
SPIAddr: 00000000
SecurityBit: ON
idcode: 0000081b
after program flash: displayReadReg 00006020
	Memory Erase
	Done Final
	Security Final
Erase SRAM before erase sram: displayReadReg 00006020
	Memory Erase
	Done Final
	Security Final
pollFlag: 60a0 (80)
pollFlag: 4080 (0)
pollFlag: 4080 (0)
pollFlag: 4080 (0)
pollFlag: 4080 (0)
pollFlag: 4080 (0)
pollFlag: a0 (20)
after erase sram: displayReadReg 000000a0
	Memory Erase
	System Edit Mode
pollFlag: 20 (0)
after erase sram: displayReadReg 00000020
	Memory Erase
DONE
Jtag probe limited to %d MHz6000000
Jtag frequency : requested 10.00MHz  -> real 6.00MHz  
b 0 17 b read b00170b
Detail: 
Jedec ID          : 0b
memory type       : 00
memory capacity   : 17
b 40 17 b read b40170b
Detail: 
Jedec ID          : 0b
memory type       : 40
memory capacity   : 17
RDSR : 0x00
WIP  : 0
WEL  : 0
BP   : 0
TB   : 0
SRWD : 0
RDSR : 0x00
WIP  : 0
WEL  : 0
BP   : 0
TB   : 0
SRWD : 0
flash chip unknown: use basic protection detection
start addr: 00000000, end_addr: 000e0000
Erasing: [==================================================] 100.00%
Done
Writing: [===============                                   ] 28.16%Error: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_read
Dominant language
C++
Stars
1.7k
Forks
396
Avg merge
2d 4h
Merged PRs (30d)
15

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from trabucayre/openFPGALoader

All issues in trabucayre/openFPGALoader

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.