Skip to content

Using Visual Studio Code on macOS to log in to a PYNQ board

You need to install Visual Studio Code (Steps 1-2) only once. Every time you use the board you need to log in to it (Steps 3-4).

Step 1: Install Visual Studio Code & the remote ssh extension

  1. Go to the official Visual Studio Code website.
  2. Click on the Download button selecting the macOS operating system.
  3. Once the download is complete, run the installation file and follow the instructions. Move the downloaded application to /Applications, for which you may need to type in the account name and password of an administrator on your computer. Visual Studio Code Extensions Tab
  4. Open Visual Studio Code and go to the Extensions tab (left sidebar).
  5. Search for Remote - SSH in the search bar and select the extension published by Microsoft. Visual Studio Code Extensions Tab
  6. Click Install.
  7. Install the "C/C++ extension pack" from Microsoft.
    C extension
  8. Install the "Makefile tools" from Microsoft.
    C extension

Step 2: Add PYNQ to the remote ssh extension.

  1. Open the command palette in Visual Studio Code by pressing Command + Shift + p.
  2. Select Remote-SSH: Open SSH Configuration File... Cmd window
  3. Select the config directory that ends in .ssh/config. ssh config
  4. Add the following lines to the file (you can copy-paste these). Note that the 4 spaces before HostName and User and the capital letters (e.g. HostName not Hostname) are important.
    Host pynq
        HostName 10.43.0.1
        User student 
    
    ssh
  5. Save and close the file.

Step 3: Log in to the PYNQ board

With the configured ssh file, a connection between your laptop and the PYNQ board can be established.

  1. Connect the PYNQ board and switch it on. Wait until the DONE LED is on.
  2. Open the Remote Explorer on the left (the second icon from the bottom). Select pynq and click the little right arrow.
    Double Click
  3. When asked about the fingerprint press Continue. (This appears only the first time you log in.) Fingerprint
  4. When prompted for the password (in the top middle of the screen - it's not very prominent), enter: student. It may take some time before the screen is updated. Password
  5. The first time you log in Visual Studio Code takes some time to initialise itself. When you log in again, it is faster. The screen should look something like the picture below. Terminal

Step 4: Explore the files on the PYNQ board

Open the Explorer to see the files on the PYNQ board. Explorer

The first time you log in, you'll get a pop-up asking to trust the authors of the files. Also select the Trust the authors of all files in the parent directory 'home'.
Trust

As an example, we've opened the .bashrc file.
bashrc

Step 5: Write and run an application