f4pga-examples icon indicating copy to clipboard operation
f4pga-examples copied to clipboard

issues with xc7 instructions for openocd

Open tcal-x opened this issue 4 years ago • 10 comments

If this addressed by a PR in flight, just close this.

I'm going through the examples at https://symbiflow-examples.readthedocs.io/en/latest/building-examples.html .

After the counter example is built, the user is told to execute the following to program the part with the bitstream:

openocd -f ${INSTALL_DIR}/conda/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 top.bit; exit"

There are two things wrong with this:

  • digilent_arty.cfg is not at the provided path. In fact I cannot find it at all in the installed tool directory. I have only installed the xc7 tools.
  • the user is still in the xc7/ directory, so either they need to cd to the correct build directory, or top.bit should be replaced with the path to the correct file

tcal-x avatar Dec 18 '20 03:12 tcal-x

can we rewrite the guide to use https://github.com/trabucayre/openFPGALoader? This tool is way simpler to use than openOCD and it supports xc7 boards we target

GitHub
Universal utility for programming FPGA. Contribute to trabucayre/openFPGALoader development by creating an account on GitHub.

kgugala avatar Dec 18 '20 06:12 kgugala

I'd be willing to give it a try if it simplifies things overall.

  • is it easy to add to the downloads/packages for the user, or can they install it with apt-get?
  • it has an AGPL license -- is that an issue?

tcal-x avatar Dec 18 '20 16:12 tcal-x

it has an AGPL license -- is that an issue?

this is not an issue if we just use it as a third party tool. (BTW openocd is GPL licensed)

kgugala avatar Dec 18 '20 18:12 kgugala

@kgugala - I'm afraid we can't touch anything which is AGPL. GPL is fine.

mithro avatar Dec 18 '20 18:12 mithro

https://opensource.google/docs/using/agpl-policy/

opensource.google

mithro avatar Dec 18 '20 18:12 mithro

oh, OK. So we need to fix openocd instructions then

kgugala avatar Dec 18 '20 18:12 kgugala

@kgugala - If anyone has a good relationship with the openFPGALoader people, it might be worth talking to them and seeing if they would consider "downgrading" to just GPL (rather than AGPL) -- which means we could then use them. I'm not sure the AGPL makes a lot of sense for their software anyway - the additions in AGPL are mainly focused towards "web" technologies like databases, web apps, etc.

mithro avatar Dec 18 '20 20:12 mithro

Seems its more than one person but the main committer is [email protected]

pgielda avatar Dec 18 '20 21:12 pgielda

In case it's relevant: digilent_arty.cfg seems to be found in the openocd that comes from the litex::openocd conda package, which is incompatible with python 3.8 which is installed following the directions in this repository.

I'm not seeing any obvious difference between digilent_arty.cfg and the arty_s7.cfg in upstream OpenOCD which can be installed outside of conda. Although I've successfully programmed my Arty A7-100T with arty_s7.cfg in the past, and substituting it in the example command (after first cd counter_test/build/arty_100/) produces no errors, I don't see any flashing LEDs.

pabigot avatar Dec 19 '20 13:12 pabigot

@pabigot @tcal-x I have opened a PR to:

  • fix the absence of openocd in the env (and also the link to the config file);
  • fix the non-working counter test for arty. There was a typo in the constraints files which messed up the IOSTANDARD values of the LEDs IOPADs.

acomodi avatar Dec 21 '20 10:12 acomodi