Comments (73)
Hi,
all prerequisites are present (-o / --offset to provides base address and I've fixed a bug in spiFlash the last week) but this option was only tested with cyc1000 board.
So, I need to create a design to check behaviour before unlocking this feature (for ECP5 in a first time).
Currently since erase is done by sector it's a 64k offset. But I must improving erase and flash algorithm to handle smallest size as possible.
In fact this feature is in my ASAP todolist.
Thank to motivate me to hurry about that ;)
from openfpgaloader.
There should not be any hurry. Of course my primary interest
should be ecp5-ft231x :) but I can also test and report what
happens on ft4232 based boards with ecp5-85, artix7-100, and cyclone5-49
from openfpgaloader.
In fact the interface is not a problem. If it's work with one of them, it will work with all.
I need to enable this feature FPGA per FPGA since flash access is a bit different for each vendor:
- flash access is tranparent for anlogic eagle_s20 and ECP5 (it's only mandatory to write a specific instruction before)
- one bitstream must be loaded in RAM to provide a bridge for xilinx and cyclone devices. An in this situation it's mandatory to have as much as bitstream as FPGA model (artix, spartan6/7, cyclone 10/5) and size. Bitstreams are available for artix A35t and A50t).
- for the specific case of cyc1000 I use the second interface of FT2232 (interface B) to emulate SPI (bitstream is just connexion between pins on the Ftdi side and pins on the Flash side). I must updating this to have jtag<->SPI interface like for xilinx FPGA.
In a first time, I focus to ecp5 (colorlight and ecp5_evn).
from openfpgaloader.
I kinde understand everything mentioned.
I have a board with ecp5 and 256-mbit flash, the one with 4-byte
address and openFPGALoader works while I know it uses only
3-byte legacy addresses. That's great
I know for every artix anc cyclone, a different jtag-spi passthru
bitstream must be prepared. Not only this but there's more, cyclone5
or MAX10 i htink have some internal flash that is used to initialize
BRAM content so the programmer needs to handle this thing also.
from openfpgaloader.
I know I need to improve spiFlash support to handle both 4 and 3-bytes address.
For artix and spartan7 se same implementation may be used (@Fatsie has added spartan7 support). For altera I need to first reworks the passthru to use jtag <-> spi instead.
With FPGAs with internal flash it's a bit more easy because in most case the flash is only dedicated for bitstream and it's not possible to add something else.
I have locally unlocked the ability to flash a raw data, a read after write show correct data but I'have a problem with my test design. I'm waiting to fix this before updating lattice support.
from openfpgaloader.
from openfpgaloader.
Yesterday I'have fixed my design for my ECP5_EVN:
- an riscV is written at the beginning of the FLASH
- the CPU firmware is written at 0x200000
After fixing some issue it's works -> openFPGALoader is able for ECP5 to write something everywhere in flash \o/
Now it's time to cleanup openFPGALoader and the design before pushing it.
for ECP5 you have to known file format: bit and mcs.
- mcs is written in flash
- bit is loaded in RAM if -m (or nothing) and written in flash if -f
For the jtagofspi, xc3sprog bitstreams are not compatible. I use a piece of HDL I've written. But to support new xilinx FPGA you have just to update the Makefile and add corresponding xdc file.
from openfpgaloader.
from openfpgaloader.
It's true for read back mainly because it's possible to check write task. In fact I've already this (to read back content just after write) to verify the read everywhere.
If I have artix's details I'm able to update the Makefile to produce required bitstream if you want.
For gzip, as mentionned here, It's not clear for me if it's for storage or to increase write speed task.
from openfpgaloader.
from openfpgaloader.
I was experimenting with esp32 micropython programmer
using xc3sprog bscan and got it working, it uploads bscan7.bit.gz
first and then writes the flash. It first reads a flash block, compares
with to-be-written block content and decides if it must erase or write or
nothing, thus reducing flash wear and working faster.
Sometimes (about 1 in 20), after uploading bscan7,
flash write fails on first block (erase, write, verify
retried 3 times and give up).
If you need some inspiration or reference, here it is:
https://github.com/emard/esp32ecp5/tree/master/rbp
BTW is there spioverjtag source for altera?
from openfpgaloader.
Okay I will seeing this. Thanks
In fact I have written my spiOverJtag in early time of this project. Maybe I must move to xc3sprog version. I will compare both.
For altera I need to find where I have stored this (but It has no real interest since it use interfaceB of the ft2232, and consequently limited to cyc1000). My idea is to rewrite this (or adapt the xc3sprog passthru) to use the JTAG interface.
I've updated the repository with support for writing raw data at an arbitrary offset (readback is currently missing).
My test design is an adaptation to picosoc
from openfpgaloader.
from openfpgaloader.
My bridge has nothing to do with that of xc3sprog. This why both are incompatible.
If you read xilinx_spiOverJtag this piece of code just adapts JTAG signals to SPI.
I need to compare both speed to move to xc3sprog bridge.
from openfpgaloader.
from openfpgaloader.
Sorry for delay.
I've updated xilinx support to write raw data in arbitrary address (tested again with picosoc) and added bitstream for xc7a100 device. If you can try it.
ASAP I must compare for bridge to see if I need to move to xc3sprog version. But usually SPI communication is quite small (for tx there are no overhead, for rx with a delay of one bit I need to read one byte more and reconstruct byte).
from openfpgaloader.
from openfpgaloader.
OK. No problem. It's not hurry at all.
Currently, openFPGALoader use only 64K erase block. (I know it's sometime overkill and the algorithm needs to be improved).
from openfpgaloader.
from openfpgaloader.
To write a bitstream in flash you need to convert the bit to mcs.
In fact I've not tried to write a bit to flash (If it so, i'll update openFPGALoader to allows this)
from openfpgaloader.
from openfpgaloader.
from openfpgaloader.
I've tried with a .bit: It didn't work in flash.
lattice .bit and xilinx .bit are not same...
Lattice .bit contains instructions to drive the FPGA in configuration phase.
I suspect this is not true for xilinx .bit file this is why it's mandatory to use mcs (maybe .bin)
In openFPGALoader, xilinx class don't use -f and -m.
if file is .mcs -> FLASH
if file is .bit -> RAM
if file is xxx -> FLASH with a sanity checking about offset
It's true this mean a file with .bit can't be written at an offset > 0x00
from openfpgaloader.
from openfpgaloader.
from openfpgaloader.
So I renamed bit file to xxx and this seems to work and pass verify
only I'd like to be able to flash raw binary exactly at offset 0,
currently it accepts other offsets than 0.
I edited the source and removing checking for address 0,
have written *.bit raw bitstream there and it works!
./openFPGALoader --cable ft4232 -o 0 /tmp/artix7.xxx
load program
Flash SRAM: [===================================================] 100.000008%
Done
parsing 3825900
file length 30607200
Parse file DONE
Detail:
Jedec ID : 01
memory type : 60
memory capacity : 19
EDID + CFD length : ff
EDID : ffff
CFD :
Erasing: [==================================================] 100.000000%
Done
Writing: [===================================================] 100.000008%
Done
from openfpgaloader.
I can test something similar (same cable ft4232 and 32MB spansion flash)
with cyclone5, part 5CEBA4F23C7N
from openfpgaloader.
After comparing .bit file from xilinx and mcs file from xilinx too, it's true the .bit file should work with the flash. I need to redo my tests, I'have missed something, but not now I'm not at home and hav'nt my arty with me.
For .mcs produces by using objcopy, I suppose my implementation don't cover all possible type... I've added this in my (long) TODO list.
For rawData at offset 0x0, I've (it's maybe an error) forbid this behavior considering only a valid bitstream could be write in this area.
I have never tested with CycloneV, I need to redo bridge (currently cyc1000 only). For SRAM you need to use a svf file. .sof file is just not documented, quartus do a magic thing before sending bitstream data...
from openfpgaloader.
from openfpgaloader.
I've redo test and now it's possible to write a .bit in flash (In fact my previous tests have failed due to an inconscient in parser...)
Yes sof are too difficult... Tried to analyse this file but fails...
from openfpgaloader.
from openfpgaloader.
I've planned to study .rbf. This format is used by Linux, for cycloneV Soc, to program the FPGA. I suppose this filetype is more or less documented (at least enough to be usable).
If it's possible to use them, it's maybe better (or simplier) than using .svf
from openfpgaloader.
Is altera (cyclone-5 + epc flash = 5CEBA4F23C7 + EPCS64) supported?
I see there's some code to load bridge and read/write flash.
there's possible misspelling at sram write, it prints message
"Flash SRAM" maybe it should print message "Write SRAM".
from openfpgaloader.
altera cycloneV are supported to write SPI flash.
This model must be added in spiOverJtag. Have you a ref board? I could update accordingly.
from openfpgaloader.
from openfpgaloader.
Thanks.
rbf are a bit large :-/ (and it's not possible to use compression since jtag+real time uncompress is not supported by cyclone devices)
Before adding this file to openFPGALoader repo could you try:
- download this bridge into spiOverJtag directory.
- add in src/part.hpp idcode for your device
make install
- use
openFPGALoader -c ft4232 --fpga-part 5ce423 -f yourRBF.rbf
Thanks
from openfpgaloader.
from openfpgaloader.
spiOverjtag naming is a bit strange, i'm agree. I've assumed only size and package are required (maybe I need to do a deep check).
First dump seems good. openFPGALoader has correctly loaded bridge into RAM and you use the correct (as far I know) command to produce the rbf file.
SVF is not working here, because It will be loaded into SRAM
For the second dump it's like chip is not connected or something like this.
Need to try in my side (maybe something in spiflash update has broken that...)
from openfpgaloader.
from openfpgaloader.
It's really weird. I have tried by two of my intel FPGAs (cycloneV and cyclone IV) sucessfully...
If you dump flash it's the same as rbf content? (maybe with bit reversal) ?
from openfpgaloader.
from openfpgaloader.
Most of devices with SPI flash have dump flash support. Seems doc must be updated to highlight that :)
from openfpgaloader.
from openfpgaloader.
My fault... Wrong method signature...
Fixed
from openfpgaloader.
from openfpgaloader.
from openfpgaloader.
rbf is handle as a raw data so flash's content must match rbf's content. Its may be required to add byte reversal when storage to have exactly original file content.
I've updated spiFlashdb with W25Q64 device.
from openfpgaloader.
from openfpgaloader.
byte reversal is not required before calling openFPGALoader. It is done, if required, before writing to flash. With all my intel's FPGAs rbf are working.
Byte reversal may be required after a dump to compare original rbf with the dump.
from openfpgaloader.
from openfpgaloader.
A bitstream is always reversed. A raw data file is written in natural order.
Oups I have a typo in previous messages byte -> bit so LSB become MSB and MSB become LSB
from openfpgaloader.
from openfpgaloader.
Need to compare jic and rbf (maybe I've already done that but don't remember -> documentation page for file format is required). It's weird tried many time successfully (but not with your board/device)
Same for spiOverJtag with all intel based board it's okay (but again not with this device) -> have to check aliexpress for something similar to your board.
Thanks
from openfpgaloader.
If there's source for spioverjtag, I can compile and
try to change something to see if I can fix it
maybe not the same chip but similar and very good board
and with good price should be "mister".
from openfpgaloader.
source is available, I just have to push entry for your device.
"mister" uses the de10nano? I have one of them. chip id is correctly read but further steps are not working (I suspect dual or quad access between FPGAs and chip).
from openfpgaloader.
from openfpgaloader.
from openfpgaloader.
I have de10nano, de0nanoSo and de1Soc.
I have produce a jic file from sof -> it's quite similar to rbf with an header. Need to check why some small diff.
Having to load something into RAM before using spiOverJtag is really strange, currently I don't see why. Need to investigate.
Using an rbf into flash it not always possible (You can't use one in compress mode -> real time decompression isn't supported by the FPGA in JTAG mode).
from openfpgaloader.
from openfpgaloader.
for svf the compression is, as far I know, not used.
I've started a parser for jic
But it's clear I can't reproduce your issue (and it's a situation I don't like). I need to check everything... I, definitively, have to find a board with same hardware.
from openfpgaloader.
from openfpgaloader.
from openfpgaloader.
Tried with my de10nano -> success...
flash id is read successfully...
Ok I'm unable to program chip for an unknown reason -> maybe with the clip I will be able to dump transaction with a logic analyzer.
from openfpgaloader.
from openfpgaloader.
from openfpgaloader.
it's maybe time to open an dedicated issue, this thread become very long :-)
My board is currently in AS mode (but I have tried all modes)
I can't set holdn and wpn since I use intel IP (serial flash loader).
I need to finalize my jic parser and to integrate this. But it's really weird, I have flashed many rbf this morning to verify behaviour with cylone10, cycloneIV and cycloneV (not socfpga) without any problem. Maybe something with quad/dual/single mode?
from openfpgaloader.
from openfpgaloader.
I am trying to write a raw binary file, too, but despite the -o option given, openFPGALoader does not accept random data. Do I need to provide additional options to enable this?
openFPGALoader --board=ulx3s -f -o 0x200000 LICENSE -v
write to flash
Jtag probe limited to 3MHz
Jtag frequency : requested 6000000Hz -> real 3000000Hz
ret 0
found 1 devices
index 0:
idcode 0x41113043
manufacturer lattice
model LFE5U-85
family ECP5
irlength 8
File type : LICENSE
Error: Failed to claim FPGA device: incompatible file format
openFPGALoader -V
openFPGALoader v0.5.0
from openfpgaloader.
from openfpgaloader.
@Mecrisp Good catch! file type are deduced from extension, but without extension, and without --file-type
, openFPGALoader is unable to decide what to do. It's now fixed in master branch.
@emard true. It's a solution to avoid this error.
Thanks to all
from openfpgaloader.
Thank you for the quick solution - specifying the file type did the trick. Idea: Would be great if the help text could include the possible "file-type-specifiers". I tried with --file-type raw intuitively before, but that wasn't accepted.
This did the trick with the version already installed, will update later:
openFPGALoader --board=ulx3s -f -o 0x200000 LICENSE -v --file-type bin
from openfpgaloader.
from openfpgaloader.
@emard exactly (and done this morning).
I have relaxed constrains about filetype:
- known format are treated using corresponding parser
- unknown format are allowed only if the file is wrtten in flash
now if you use:
openFPGALoader --board=ulx3s -f -o 0x200000 LICENSE -v --file-type bin
or
openFPGALoader --board=ulx3s -f -o 0x200000 LICENSE -v --file-type raw
or
openFPGALoader --board=ulx3s -f -o 0x200000 LICENSE -v
Result (and behaviour) is same (or I have introduce a bug ;-) )
@Mecrisp it's true: message must be more explicit and more informative
from openfpgaloader.
Related Issues (20)
- Adding support for the Digilent XUP USB-JTAG Programmer
- unable to open ftdi device: -6 (ftdi_usb_reset failed) tang nano 20k HOT 11
- Refresh: FAIL on Lattice MachXO2 HOT 13
- cheat code support. HOT 3
- Attempting to Flash SPI PROM of a custom board - Dragon-L HOT 24
- XC7A200 on TE0712: Boot from flash only after one time programming with Xilinx tools HOT 6
- Artix Ultrascale XCAU25P support for flash(mcs file)
- 3- vs. 4-Byte-Adressing: Flashing a MT25QL256 attached to Cyclone 10CL025 fails HOT 4
- Segmentation fault with unknown flash chip ID HOT 3
- Cannot find Board or Programming cable HOT 4
- How to add a Xilinx Spartan 7 Part? HOT 9
- Gowin GW2A-LV18EQ144C8 external flash troubles HOT 5
- Tang Nano 9K CRC error with -b tangnano9k HOT 13
- Support for xc3s700? HOT 3
- spiOverJtag support for more than one device on scan chain
- efinix: program reports success (returns 0) when programming fails HOT 3
- Efiinix: Occasional failure to detect SPI flash (possibly when flash device is still in in QSPI mode)
- Trying to Flash xc6slx25, But Found No spiOverJtag File HOT 6
- Request for C5E215 HOT 1
- Help with CYC5000 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfpgaloader.