Cloning a git repository into your board connected to computer

  • While connecting your board to a network router would make it easy to clone git repositories, sometimes you are limited to connecting your board only to your PC, this may create some difficulties when you would like to get new files and repo added to your pynq environment, to overcome this challenge we would be taking an approach of cloning the needed repository into our PC and then transfer the repo to the board via ssh with the SCP command

  • First of all, you can connect to your board via ssh by running the following command ssh username@hostname example “ssh xilinx@192.168.2.99

  • The hostname may vary so check the one associated with your board, the default username is xilinx, after running that you will be asked to enter your password and the default one is xilinx

  • Now after cloning the needed repo to your local system, for example, you may want to add it to our jupyter_notebook folder located on our board directory /home/xilinx, to perform this: on your local system open the terminal and run:
    scp -r /path_to_the_folder_on_your_PC/ xilinx\@192.168.2.99:/home/xilinx/jupyter_notebooks

  • Enter your password and then enjoy running your new codes!

A small tip: to connect to your board via ssh easily give it a new short handly hostname, to do this:

  • Navigate to your home directory with cd and create a directory called .ssh with mkdir .ssh
  • Move to that new directory with cd .ssh then create a new file with the name config with gedit config
  • Add the following lines to that file:
    Host the_new_name_you_like_give_to_your_host (ex: mypynq)
    HostName 192.168.2.99
    User xilinx
  • save the file and connect to your board via ssh since now with ssh mypynq
2 Likes

If you use JupyterLab (available on PYNQ by browsing to {IP address of board}/lab then you can drag an drop files to upload.

You can also map the board as a network drive to access files:
https://pynq.readthedocs.io/en/v2.7.0/getting_started/pynq_sdcard_getting_started.html?highlight=samba#accessing-files-on-the-board

Cathal

3 Likes