• 0

execute a file from terminal


Go to solution Solved by JColvin,

Question

I put the same question Xilinx forum, but, nobody knows it... If someone know it, please tell me...

 

I'm testing Hello World using MicroBlaze on Artix7 (Basys3) by referring to, for instance,  https://reference.digilentinc.com/learn/programmable-logic/tutorials/basys-3-getting-started-with-microblaze/start It works.

I would like to do it from terminal something like ./HelloWorl.exe via serial communication with FPGA. And in the future I want to control FPGA, read data from buffer, etc. It means Command Line Session.

 Are there any useful example or useful web pages to understand it?

Best regards     

Edited by hep77
Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
  • Solution

Hi @hep77,

I don't quite know what you are asking. Are you wanting to be able to reprogram the FPGA from command line with a pre-existing design? Or are you wanting to configure and control the FPGA while it is already powered on?

Either way, we don't have any direct examples of controlling the FPGA over serial. In principle, you could use xuartlite directly (as opposed to stdout/stdin) to read incoming data and perform a pre-defined function based off of that, but that wouldn't be using a Command Line Interface.

If you are wanting to control the board and have it run a variety of pre-made functions, I would probably recommend that you take a look into SoC's where the Zynq chip also has an ARM processor that you could load some version of Linux onto (Digilent usually uses Petalinux).

Thank you,
JColvin

Link to post
Share on other sites
  • 0

Thank you for your comments, and sorry for my unclear question due to lack of my knowledge on FPGA development.

> .... control the FPGA while it is already powered on

Yes, this is close to what I want to do. I give a command (like ./TakeData) via serial communication and FPGA starts count something (for instance, clock) and send it to me. This is what I want to do as the first step.

> If you are wanting to control the board....

Yes, this is one way. But, for the moment, I have basys3 only, and try to investigate what I can do with this.

I found that MicroBlaze + FreeRTOS(+command line interface) might be able to do relatively similar thing. If you or someone know about it, please tell me anything.

Best regards. 

 

Append: I also found that following is nice introduction as the 1st step for my purpose. Thank you for your help! 

 

Edited by hep77
Link to post
Share on other sites
  • 0

Hi @hep77,

FreeRTOS could work, though note that the last official Microblaze design for it (link) was in 2014.4 with a Kintex 7 chip that requires a paid Design Edition license.

Otherwise, I would probably attempt to a list of different tasks that get executed when a particular character is received, similar to how the Nexys Video HDMI demo does it in it's DemoRun function: https://github.com/Digilent/Nexys-Video-HDMI/blob/master/sdk/appsrc/video_demo.c.

Thanks,
JColvin

Link to post
Share on other sites
  • 0
On 10/16/2020 at 12:08 AM, hep77 said:

Yes, this is close to what I want to do. I give a command (like ./TakeData) via serial communication and FPGA starts count something

I get the feeling that you are confusing the MicroBlaze soft-processor with the FPGA. If you want to use MicroBlaze then the SDK (Vivado 2019.1 or earlier) has example C/C++ code for using the UART in a software application. Your MicorBlaze software can do what ever you want it to do. If you don't want to use a MicroBlaze you can still have a PC control FPGA logic via a UART but you'll need to know how to write VHDL or Verilog. You don't need an RTOS to do this.

Commandline statements like ./Helloworld are specific to Linux. Running Linux on a MicroBlaze is a whole different level of work and heartache.  Xilinx has it own standalone OS for MicroBlaze and ZYNQ. Developing software for either ZYNQ or a MicroBlaze soft-processor is similar to developing software applications for a uProcessor. Generally there's no OS involved.

Link to post
Share on other sites
  • 0

Dear zygot

thank you for the comment.

> I get the feeling that you are ...

Yes, because I have never touched UART communication on FPGA program and there is an example of Hello World in the tutorial, I started to use MicroBlaze to communicate with PC via UART.

After I posted a question on it here, I got several comments and found that direct UART communication without Microblaze is possible, and now, I can do it on my FPGA with commands (python script) from terminal. Thanks!      

 

Edited by T.O
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now