Jump to content
  • 0

Best software to program an Arty board


tester11

Question

What is the best software to program in C++/C an Arty board? I tried Vivado HLS but it is good only for algorithms not for the components of the board.

The SDx made by Xilinx is not compatible with the boards.

If are others programs can someone please provide tutorials/books for some examples in C.On Xilinx forum I couldn't find any tutorial for working with the board components in C.

 

Link to comment
Share on other sites

24 answers to this question

Recommended Posts

@tester11,

I would actually recommend implementing anything network related within Linux if you can--there's just so much to the typical network communication setup that an O/S based network stack can be quite valuable.  If you install Linux on your board, you should (should--I haven't done this) have access to any WiFi module you can plug in the USB OTG port.

Dan

Link to comment
Share on other sites

You can use the microSD card on the Arty Z7 for both boot and application data. I recommend following the HTTPServer example included with the PmodWIFI for a great example of how to access data that is stored on the microSD card from your application. That demo hosts a webserver found on the microSD (maybe that is the same thing you want to do... :) ) . If you wanted to boot from SD card while also using the SD card to hold the webserver, you would just put the BOOT.bin file directly next to all of the webserver files and it should work fine.

If you still don't want to use SD for boot for some reason, it is also possible to boot from the onboard Quad SPI flash, but that is typically less convenient to program than a microSD card.

 

Link to comment
Share on other sites

43 minutes ago, sbobrowicz said:

Hey @tester11,

Lets clean up the history really quick because I feel like I am unclear on something still:

1) Are you using the Arty Z7-10 or the Arty Z7-20?

I can provide some links to petalinux materials, but before I do that we should make sure that is the right route for you... I think this will be determined by how you want to do your Wifi, as Dan suggested above. Really, if you are locked down with the Pmod Wifi, then I actually recommend you use baremetal (no Petalinux) instead, because that wifi module only works with our bare metal TCP/IP stack (not the Linux stack). If you are OK with using a USB wifi dongle instead, then that opens you up to Petalinux. Here is a breakdown of the different experiences you will have integrating Wifi into your project if you go bare metal vs. petalinux:

Petalinux

Hardware: USB Wifi Dongle

System setup: Medium-Hard. You have to build a linux system and load it onto an SD card. If your needs for the system are not very advanced (e.g. not a lot of third party software), this is easier. The process can be difficult if you run into problems or need to do something that is not typical. Good news is this process is well documented for the Arty Z7-20 by digilent with complete petalinux docs from Xilinx. Additional help provided on this forum.

Network Software Development: Easy. You can use the third-party networking library of your choice. Basically the experience will be the same as if you wanted to write a simple networking program that worked on a Linux PC. 

Bare Metal

Hardware: Pmod Wifi

System Setup: Easy. Export to SDK, use the demos included with our Pmod Wifi IP core. Software is developed directly in Xilinx SDK and and can also be programmed/debugged on the hardware directly from this tool. Easy to generate an SD card image with your final program too that will run right when the Arty Z7 is powered on. Digilent has several tutorials for this available here: https://reference.digilentinc.com/reference/programmable-logic/arty-z7/start . You should check out the Getting started with Vivado IP Integrator and then Getting Started with Digilent Pmod IPs.

Network Software Development: Medium-Hard. You will need to modify the bare-metal examples to satisfy your application requirements. If you are comfortable with bare-metal (think Arduino-like, but without all of the fancy C++ libraries) programming, this should be approachable for you. The fact that Xilinx SDK has a good integrated debugger will be helpful for you to debug this application as it is running. 

Based on those description, which route would you choose?

 

I got the Arty Z7-10.

I got the Pmod Wifi already and I must use it.I do the tutorial for the Arty-z7 maybe it will work.Both solutions use an SD card.I hoped to be able to read some data from it for processing not using it as a bootable device.

Looks like the tutorial worked with the buttons.I tried a few times the Xilinx SDK and it always said that it has missing libraries but the problems was that it needed more arguments to start.

Link to comment
Share on other sites

Hey @tester11,

Lets clean up the history really quick because I feel like I am unclear on something still:

1) Are you using the Arty Z7-10 or the Arty Z7-20?

I can provide some links to petalinux materials, but before I do that we should make sure that is the right route for you... I think this will be determined by how you want to do your Wifi, as Dan suggested above. Really, if you are locked down with the Pmod Wifi, then I actually recommend you use baremetal (no Petalinux) instead, because that wifi module only works with our bare metal TCP/IP stack (not the Linux stack). If you are OK with using a USB wifi dongle instead, then that opens you up to Petalinux. Here is a breakdown of the different experiences you will have integrating Wifi into your project if you go bare metal vs. petalinux:

Petalinux

Hardware: USB Wifi Dongle

System setup: Medium-Hard. You have to build a linux system and load it onto an SD card. If your needs for the system are not very advanced (e.g. not a lot of third party software), this is easier. The process can be difficult if you run into problems or need to do something that is not typical. Good news is this process is well documented for the Arty Z7-20 by digilent with complete petalinux docs from Xilinx. Additional help provided on this forum.

Network Software Development: Easy. You can use the third-party networking library of your choice. Basically the experience will be the same as if you wanted to write a simple networking program that worked on a Linux PC. 

Bare Metal

Hardware: Pmod Wifi

System Setup: Easy. Export to SDK, use the demos included with our Pmod Wifi IP core. Software is developed directly in Xilinx SDK and and can also be programmed/debugged on the hardware directly from this tool. Easy to generate an SD card image with your final program too that will run right when the Arty Z7 is powered on. Digilent has several tutorials for this available here: https://reference.digilentinc.com/reference/programmable-logic/arty-z7/start . You should check out the Getting started with Vivado IP Integrator and then Getting Started with Digilent Pmod IPs.

Network Software Development: Medium-Hard. You will need to modify the bare-metal examples to satisfy your application requirements. If you are comfortable with bare-metal (think Arduino-like, but without all of the fancy C++ libraries) programming, this should be approachable for you. The fact that Xilinx SDK has a good integrated debugger will be helpful for you to debug this application as it is running. 

Based on those description, which route would you choose?

 

Link to comment
Share on other sites

13 minutes ago, jpeyron said:

Hi @tester11,

I would suggest looking at the PetaLinux Tools Documentation Reference Guide for the version of petalinux you will be using. Here is the Petalinux wiki. I have also reached out to our embedded linux engineer to see if they have any additional input.

cheers,

Jon

I hope that they have.The wiki and Xilinx pdfs aren't very useful.I looked among them and they aren't very helpful,they explain the elements and how they work like here https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_4/ug1165-zynq-embedded-design-tutorial.pdf  but never dive into the real deal.

Link to comment
Share on other sites

1 minute ago, jpeyron said:

Hi @tester11,

I do not see any reason why you can not use notepad++.

thank you,

Jon

Can you name some books or references where can I find code that uses the FPGA components with C code on Digilent boards please? Didn't tought at begin that finding documentation will be the biggest problem

Link to comment
Share on other sites

1 minute ago, jpeyron said:

Hi @tester11,

If you look on the zynq chip it will have either XC7Z010(Arty-Z7-10) or XC7Z010(Arty-Z7-20). If it is to hard to read on the zynq chip you can download Adept 2 here and it will show what zynq chip it is connecting to as show below.

cheers,

Jon

arty-z7-20-adept.jpg

Thanks I figured out .On Github it says the instructions to install the linux kernel.Let's says that I succed to do that but I still don't have any basic example of code in C to control a led.

As it is Linux ,Notepad++ should be enough for writing the code,am I right?

Link to comment
Share on other sites

1 minute ago, jpeyron said:

Hi @tester11,

Thank you for clarifying the type of Arty board you have. The Arty-Z7 has a petalinux demo here for the Arty-Z7-20 and here for the Arty-Z7-10. These demos should be useful as a reference.

cheers,

Jon

I saw them already,how do I know if is Z7-10 or 20? on the box doesn't say anything.On the board under the name is wrote PSC 20,does this text shows a property for the pins that are on the left or tell the version of the board?

Link to comment
Share on other sites

1 minute ago, TrapperBob said:

MicroBlaze is a "soft" processor so to say Arty Z7 does not have it is not correct. Arty Z7 is a Zync-based board but a  MicroBlaze soft processor could be  added to the PL of the Zync device on the Arty. If you desire to use the PS in the Zync device (ARM based) to control your peripherals then you will use the SDK provided libraries and C and if you desire to use the  PL section then you can use Verilog and/or VHDL to generate hardware controllers for you peripherals.

Bob 

I just want a software to implement some code that can communicate with the board elements.I wasted 2 days trying to figure out how to program the board in C and couldn't find anything besides HLS .

Link to comment
Share on other sites

1 minute ago, D@n said:

@tester11,

I'm sorry, I thought you meant the generic Arty, not the Arty-Z7.  The Arty-Z7 has an ARM on board.  You shouldn't have any problems programming that ARM with GCC. 

While I don't normally recommend it (I normally recommend Verilog), you might wish to following the block design tutorials to get access to the various I/O capabilities of the board.

Dan

The boards need to use the wifi module so should I try to install linux on it and then run my code? The process of implementing wifi/ethernet communication with Verilog should be a pleasure.

Link to comment
Share on other sites

MicroBlaze is a "soft" processor so to say Arty Z7 does not have it is not correct. Arty Z7 is a Zync-based board but a  MicroBlaze soft processor could be  added to the PL of the Zync device on the Arty. If you desire to use the PS in the Zync device (ARM based) to control your peripherals then you will use the SDK provided libraries and C and if you desire to use the  PL section then you can use Verilog and/or VHDL to generate hardware controllers for you peripherals.

Bob 

Link to comment
Share on other sites

@tester11,

I'm sorry, I thought you meant the generic Arty, not the Arty-Z7.  The Arty-Z7 has an ARM on board.  You shouldn't have any problems programming that ARM with GCC. 

While I don't normally recommend it (I normally recommend Verilog), you might wish to following the block design tutorials to get access to the various I/O capabilities of the board.

Dan

Link to comment
Share on other sites

2 minutes ago, jpeyron said:

Hi @tester11,

Besides HLS I am not aware of way to doing everything in C. If you use microblaze once you have a hardware platform generated then you can export the hardware platform and launch SDK. You can program what you do with the components in C using SDK. Here is the getting started with microblaze tutorial that might be helpful.

cheers,

Jon

Arty Z7 doesn't have Microblaze 

3 minutes ago, D@n said:

@tester11,

Sure, but let's back up a moment.  I think you may be making your problem harder by dictating the solution ahead of time.  Can you share at all what it is you wish to accomplish?

There are many Verilog tutorials on line.  I've personally suggested both asic-world.com and  fpga4fun.com to many people just starting out.  I've personally found the projects on fpga4fun.com to be both simple, interesting, and fun.  I've posted a lot of information as well on my own blog that you might also find valuable.

Perhaps a solution already (nearly) exists for what you wish to accomplish?

Dan

My project involves a lot of modules ,stepper motors ,oled pmod,wifi pmod and image processing so  I really want to make it only in C . Changing the programming language isn't an option.

Link to comment
Share on other sites

Hi @tester11,

Besides HLS I am not aware of way to doing everything in C. If you use microblaze once you have a hardware platform generated then you can export the hardware platform and launch SDK. You can program what you do with the components in C using SDK. Here is the getting started with microblaze tutorial that might be helpful. Here is a forum thread that discusses putting petalinux on the Arty.

cheers,

Jon

Link to comment
Share on other sites

@tester11,

Sure, but let's back up a moment.  I think you may be making your problem harder by dictating the solution ahead of time.  Can you share at all what it is you wish to accomplish?

There are many Verilog tutorials on line.  I've personally suggested both asic-world.com and  fpga4fun.com to many people just starting out.  I've personally found the projects on fpga4fun.com to be both simple, interesting, and fun.  I've posted a lot of information as well on my own blog that you might also find valuable.

Perhaps a solution already (nearly) exists for what you wish to accomplish?

Dan

Link to comment
Share on other sites

1 minute ago, D@n said:

@tester11,

If HLS can create better logic than my Verilog, then shame on me for writing such poor Verilog.  I should mention, though, that I also started working on FPGA's using Verilog with little more than a C/C++ language background--and I was decades out of school at the time.  You will find your background very valuable.

That said, HLS questions are not uncommon on this forum.  The typical Digilent answer, however, is that they have little to no experience using it, and so they often refer people asking HLS types of questions to Xilinx's forums.

Hope that helps,

Dan

In 2 days I couldn't find a single file to explain anything about using HLS with the FPGA elements. I think to use an petalinux core for the project but I'm afraid that the documentation is poor here too.

Link to comment
Share on other sites

@tester11,

If HLS can create better logic than my Verilog, then shame on me for writing such poor Verilog.  I should mention, though, that I also started working on FPGA's using Verilog with little more than a C/C++ language background--and I was decades out of school at the time.  You will find your background very valuable.

That said, HLS questions are not uncommon on this forum.  The typical Digilent answer, however, is that they have little to no experience using it, and so they often refer people asking HLS types of questions to Xilinx's forums.

Hope that helps,

Dan

Link to comment
Share on other sites

2 minutes ago, D@n said:

@tester11,

Are you intending to program a CPU on your board?  Then I might recommend GCC.  Are you intending to program the FPGA logic elements?  Then I would recommend using Verilog, not C.  The two are *very* *different* languages--so different that there isn't really a direct mapping between them--even though HLS tries to provide such a solution.

Dan

Actually Xilinx says that Vivado HLS  can increase the performance of the code even if is written in C over Verilog.

I need to use the elements and I can use only C so...

Link to comment
Share on other sites

@tester11,

Are you intending to program a CPU on your board?  Then I might recommend GCC.  Are you intending to program the FPGA logic elements?  Then I would recommend using Verilog, not C.  The two are *very* *different* languages--so different that there isn't really a direct mapping between them--even though HLS tries to provide such a solution.

Dan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...