• 0
joniengr081

Hello World project implementation in Ubuntu

Question

Hi,

I have created hello world project for zybo in Vivado 2017.4 installed in Ubuntu 16.04. The ELF file is created in SDK. I have written a TCL script to download FSBL, Bit file and also hello world application file. I have run the TCL script in XSCT terminal of SDK to download the program. The FPGA Done light indicate that the program is downloaded on the ZYNQ chip. The UART led on the board also blink every second because I use a while loop and sleep (1) function in the hello world application to send hello world every second.

The minicom is also installed.

I run the following command in Terminal.

dmesg | grep tty

Here is the reply.

[170018.653979] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB0
[170018.657182] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB1
[180348.206632] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[180703.928951] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[180705.297114] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB0
[180705.300051] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB1
[180706.519259] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[181491.379018] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[181492.231034] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB0
[181492.234064] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB1
[181565.482720] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[181916.591878] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[181917.697619] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB0
[181917.700661] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB1
[181996.463237] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[181996.463489] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[182311.425567] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB0
[182311.428703] usb 2-1.7: FTDI USB Serial Device converter now attached to ttyUSB1

The problem is how to find the port to which the board is connected ? How to find the serial port number of the board ?

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

@joniengr081,

I use Vivado on Ubuntu 16 all the time.  Once I start Vivado from the terminal, I really don't use that terminal any more.  I'll typically minimize it and start another.  If you really want to keep using that one, you can 1) place an "&" at the end of the line when you start Vivado, or 2) stop it with a ctrl-Z and then place it into the background with a "bg" command.  After either of these you can then start minicom--however, if Vivado sends something to the screen you'll see it in your minicom window.  Alternatively, you can 3) start the "screen" program before running Vivado, start Vivado, then use "ctrl-C" to create a new screen in the same terminal that you would then use for minicom.  This has the advantage of not dumping any warning messages from Vivado on your terminal session, but does take a little practice to get used to.

Personally, I don't use minicom myself.  I tend to use a serial-port to TCP converter, and then use telnet to connect to my board instead.  This allows me access to any of my circuit boards from any computer connected to my network.

Dan

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

One way to tell devices apart from each other is to run your command without the device connected and then with it connected. This is easy to do with USB devices. You also can add a -v or -vv to the command line for a more verbose reply. Eventually, you can learn to differentiate dissimilar USB devices by Linux log file information.

ftdi_sio  represents the FTDI VCP driver embedded into the Linux kernel. Most FPGA boards use FTDI USB devices because they can have multiple endpoints each capable of UART and JTAG functionality.

There's also the lsusb command for USB enumerated devices. You can use -v with it as well. You can also look in the /Sys/class/ directory for active devices.

Edited by zygot

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hi @jpeyron

I guess I first need to add "dialout group", right ? I have done that the following way. 

myUser---:~$ sudo adduser $USER dialout
[sudo] password for myUser---: 
Adding user `myUser---' to group `dialout' ...
Adding user myUser--- to group dialout
Done.

Latter I install screen as mentioned in your post https://forum.digilentinc.com/topic/4309-zybo-serial-port-in-ubuntu/

but I don't know the purpose.

myUser----:~$ sudo apt-get install screen
Reading package lists... Done
Building dependency tree       
Reading state information... Done
screen is already the newest version (4.3.1-2build1).
0 upgraded, 0 newly installed, 0 to remove and 291 not upgraded.

Here is the outcome of "dmesg | grep tty"

myUser---:~$ dmesg | grep tty
[83752.475622] usb 2-1.6: FTDI USB Serial Device converter now attached to ttyUSB0
[83752.475981] usb 2-1.6: FTDI USB Serial Device converter now attached to ttyUSB1

What do I need next ? Please list the subsequent steps to follow. The question is how to find the "port" to which zybo is connected ? To which port do I need to configure minicom ?

Edited by joniengr081

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hi,

Now I able to run hello world example, see attachment for UART settings in SDK. It works now. I am just curious that how people connect to minicom when Vivado and SDK are running because terminal gets busy while Vivado is running, right ? I usually launch the Vivado using the following command in Ubuntu terminal.

source /scratch/VivadoProjects/zybo_hello/scripts/xsct_tcl_script.tcl
Vivado

This launch Vivado.

****** Vivado v2017.4 (64-bit)
  **** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
  **** IP Build 2085800 on Fri Dec 15 22:25:07 MST 2017
    ** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

start_gui

This makes terminal busy and does not allow to run any further command. Closing the terminal also close the Vivado. How to launch minicom using "sudo minicom -s" while Vivado is running ?

Screenshot from 2019-07-18 12-31-07.png

Edited by joniengr081

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
23 minutes ago, joniengr081 said:

I am just curious that how people connect to minicom when Vivado and SDK are running because terminal gets busy while Vivado is running, right ?

For obvious reasons multiple applications cannot attach to the same USB endpoint or serial device at the same time. You can set the SDK to ignore a particular tty or COM port and use another application like minicom or Putty; or you can use your favourite serial port application and use the SDK. For configuration or debugging the same is true. Either don't have the Vivado Hardware Manager running or use another application to control the JTAG interface. Obviously, if you are using the ILA for debugging you need to be using the Vivado Hardware Manager.

Generally, I prefer other applications or my own applications for configuration, debugging and providing the FPGA with a user interface. It's usually more convenient to debug MicroBlaze or ZYNQ SDK applications using the Vivado tools but not necessarily a requirement.

I love those cheap TTL USB UART cables and breakout boards for the flexibility. If I can use something like DPTI or have a USB 3.0 interface available then I prefer writing my own application to communicate with the target, except for SDK code debugging.

Edited by zygot

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
6 hours ago, D@n said:

I use Vivado on Ubuntu 16 all the time

I've found Vivado or ISE on Linux to be a mixed bag. I use Centos. I can create configuration bitstreams but not all of the Vivado parts work as seamlessly as on WinWoes ( still prefer Win7 for hardware development, Linux for software application development). As @D@nhas kindly pointed out there are also some nice features with working on a decent Linux platform. I really despise Ubuntu Unity but it is very well supported as far as useful tools go and has exceptional aarch64 support. Nothing's perfect ( especially Linux users like me who's fingers pretty much ignore what I'm trying to type...).

It seems to me that doing development work on networked hosts and targets should tried after doing some research and pondering about security.

Edited by zygot

Share this post


Link to post
Share on other sites
  • 0

Hi @joniengr081,

Instead of using the serial terminal emulator on SDK i used screen in the thread linked above.

the command to connect the ttyUSB1 to screen is:

screen /dev/ttyUSB1 115200 

please attach screen shots of your terminal test along with SDK.

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0

@jpeyron,

Thanks for reminding me that within screen you don't need to use minicom anymore.  I keep learning and then forgetting that capability of screen.  I tend to use it just for terminal windows.

Dan

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hi,

I just have opened a new terminal and launch minicom through the new terminal which works the same way as SDK terminal but I have to close the SDK terminal before connecting to minicom. Thanks @D@n and @jpeyron

Edited by joniengr081

Share this post


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