Flash / Run Altera Cyclone IV with OpenOCD
Asked Answered
N

2

5

I would like to run an Altera Cyclone IV IP with OpenOCD. No matter what file I need from quartus, but the execution should be done by OpenOCD. I am currently trying to do it with a sof file. The one that quartus uses for the programmer.

Additional hints to flash it are also welcome.

Is the .sof file the correct one to use with openbcd?

My board is a "Altera Cyclone IV FPGA Learning Board EP4CE6E22C8N and USB Blaster Programmer" Brand is [zrTech]

In Quartus this configuration works for executing it (sof file) sometimes, also not every time. But when it started working it continues doing so: enter setup in quartus That is what I currently collected what seems to be fine (except comments):

altera_ep4ce6e22.cfg :

interface usb_blaster
usb_blaster_lowlevel_driver ftdi
transport select jtag
set CHIPNAME ep4ce6mb
set FPGA_TAPID 0x020f10dd

jtag newtap $CHIPNAME tap -irlen 10 -ircapture 0x01 -irmask 0x3 -expected-id $FPGA_TAPID

##no errors but not sure about those 
pld init 
init

## Some stuff I tried with the errors of the results ###
#pld load 0 project.sof  ###Error: invalid subcommand "load 0 project.sof"
#program project.sof ###Error: ** Unable to reset target **

In that state above this is the output I get (command waits there - it does not return):

###: openocd -f altera_ep4ce6e22.cfg 
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Warn : Adapter driver 'usb_blaster' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
Warn : Transport "jtag" was already selected
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: ep4ce6mb.tap tap/device found: 0x020f10dd (mfg: 0x06e (Altera), part: 0x20f1, ver: 0x0)
Info : 'pld init' has already been called
Warn : gdb services need one or more targets defined

Any Idea what I have to do to make this work?

Thanks for any help.

Nalda answered 28/10, 2019 at 22:22 Comment(0)
P
4

As far as I know, OpenOCD doesn't support programming sof files (these are a proprietary Altera format) directly.

Instead, generate an SVF file from Quartus (see https://www.intel.com/content/www/us/en/programmable/support/support-resources/knowledge-base/solutions/rd07222008_677.html) and use the OpenOCD svf command to program it.

Phosphorescence answered 29/10, 2019 at 21:5 Comment(1)
Yes you are right! Just at the moment came back to post my own answer (most of the time I answer my own questions ... but this time you were faster) ;-)Nalda
N
2

My additonal answer for all that seek to do the same:

As David answered already, you need SVF Files: And that is my full file for it, if you need it. At the moment quartus refuses to program it, but openocd does quite fine with that file. It is created by the programmer dialog in the file menu. Next I look for the possibility to create it by a makefile, I somewhere saw that in a Makefile already.

(Source: f32c on Github)

Shell:

openocd -f altera_ep4ce6e22.cfg 

Both files involved reside in the execution directory.

my new altera_ep4ce6e22.cfg:

interface usb_blaster
usb_blaster_lowlevel_driver ftdi
set CHIPNAME ep4ce6mb
set FPGA_TAPID 0x020f10dd

jtag newtap $CHIPNAME tap -irlen 10 -ircapture 0x01 -irmask 0x3 -expected-id $FPGA_TAPID

init
scan_chain
svf -tap $CHIPNAME.tap project.svf ###<<<svf file by quartus programmer same
exit
Nalda answered 29/10, 2019 at 22:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.