Skip to content

Latest commit

 

History

History
2535 lines (1801 loc) · 94 KB

README.md

File metadata and controls

2535 lines (1801 loc) · 94 KB

HR2 Robot Software

This document discusses how to download, install, and develop software for the HR2 platform. This document is currently broken into the following sections:

Introduction

For the HR2 there are three computers/microcontrollers of interest:

  • Development Computer: The development computer is used for all software development. It is a 64-bit x86 architecture processor that runs the Ubuntu 20.04 Linux distribution (possibly in under an emulator.) The development computer runs both ROS2 and the microcontroller development software (discussed shortly below.) The development computer needs to be able to access a local WiFi network in order to communicate with the HR2 robot computer.

  • Robot Computer: The robot computer is either a 4GB or 8GB Raspberry Pi 4 and runs ROS2 under the Ubuntu 20.04 Linux distribution. (By the way, 4GB of memory is more than adequate for the Raspberry Pi 4.) The robot computer acts as the intermediary between the Development computer and the Robot Microcontroller (see immediately below.) The Robot Computer communicates with the development computer via the local Wifi network.

  • Robot Microcontroller: The robot microcontroller is an STM (ST Microelectronics) 32-bit microcontroller that resides on the HR2 robot that handles lower level functions (motors, sensors, etc.) Currently, it is an STM32F767ZI, but that could change later on. All microcontroller firmware is written and debugged on the development computer using a cross platform firmware development environment. The developed firmware is downloaded to the microcontroller using either a physical cable or over WiFi, whichever is most convenient.

The ultimate goal is to be able to develop all software on the development computer and download/execute/debug the developed software to the appropriate computer.

There is some additional needed hardware to perform the software and firmware download.

Software Download and Install

Each computer/microcontroller needs is its own software development software. Please use hardwired network connections for all initial software installs. Setting up Wifi properly is a discussed much further below.

This is broken into the following sections:

  1. Additional Needed Hardware: Some additional cables, micro-SD cards, etc. are needed during software download and installation.

  2. Development Computer Ubuntu 20.04 Install: Get the Ubuntu 20.04 Linux distribution running on your development computer

  3. Development Computer ROS2 Install: Install ROS2 (Foxy) on your development computer.

  4. Development Computer STM32CubeIDE Install: Install the STM32CubeIDE microcontroller software on development computer.

  5. Development Computer Configuration Some additional configuration for the development computer.

  6. Robot Computer Ubuntu Installation

  7. Robot Computer ROS2 Installation

Additional Needed Hardware

In addition to the three computers above in the introduction, you need some additional hardware. All of the possible needed hardware is listed here, but discussed in greater detail in various sections below.

In the United States For the more specialized electronics, Digi-Key is a common electronics distributor. Many of the other items can be purchased from vendors such as Amazon, NewEgg, etc. For Digi-Key, links into their website are provided, so you do not have to figure out how to find things on their website.

The additional required hardware is needed:

  • 4GB Raspberry Pi 4: This is robot computer immediately above in the introduction.

  • Raspberry Pi 4 Heat Sinks The Raspberry Pi 4 runs hot and needs heat sinks. The HR2 master printed circuit board (PCB) has holes in the board to radiate heat from the heat sinks. They come in package of 4 -- 1 large for the processor, 1 medium for the memory, and 2 smaller ones for the Ethernet controller and USB controller. DO NOT power up the Raspberry Pi 4 microcontroller without first attaching the heat sinks.

  • Nucelo-F767ZI This is the robot microcontroller the introduction.

  • Micro-SD to USB Adapter: There are plenty of these available out there. Search for "USB A to micro SD adapter".

  • Micro-SD card: 32GB micro-SD cards are pretty affordable. Make sure it is UHS-1. SanDisk is a common vendor, but there are others. These cards are really small and easy to lose. So keep careful track of them. Also, it does not hurt to buy an extra just in case you lose one.

  • Battery Pack: The Raspberry Pi4 is powered via a USB-C connector. Batteries packs come and go. The one that is currently recommend is the CONXWAN 26800mAh Power bank. What is nice about this one is that it has 3 3A output connectors (1 USB-C and 2 USB-A). In addition, it can be charged either via the USB-C or via a forth USB micro connector. While the exact number power capacity (i.e. 26800mAh) is not that important, it is nice to have at least 2 3A outputs. Since some these battery packs do not come with a complete set of charging cables, it may be necessary to purchase additional cables. In general, the HR2 does not need long cables. Also, when the battery first pack shows up, be sure to charge it up since it takes a while to charge these battery packs.

  • USB-A to USB-C Cable: The robot is powered via a USB-A to USB-C cable. Shorter cables are desirable (6in/15cm) to (12in/30cm). The theory was that all USB cables with the correct connectors on the end would "just work". In practice, the marketplace has learned to economize by creating specialized "power" cables which are slightly less expensive to manufacture. Thus, take any cable that is the correct length and do not worry about whether is says "power" or not.

For bringing up the Raspberry Pi 4, it is frequently useful to have some additional hardware. The hardware is listed below is primarily used for bringing up WiFi on the Raspberry Pi 4. For completeness, the hardware is listed here, but its usage is discussed more completely in the Robot Computer Ubuntu Installation section of this document. Be sure to read about keyboard/display vs. headless configuration before purchasing any of the hardware immediately below:

  • HDMI Display (for keyboard/display based configuration): The resolution does not particularly matter. The only requirement is that it has a standard sized HDMI input jack.

  • Micro-HDMI to regular HDMI adapter cable (for keyboard/display based configuration): The Raspberry Pi 4 has 2 micro HDMI connectors. This cable adapts between the Raspberry Pi 4 micro-HDMI connector and the regular display HDMI connector.

  • USB-A Keyboard (for keyboard/display based configuration): This is needed to type commands into the Ubuntu console.

  • RJ45 Ethernet Cable (for "headless" based configuration): It is counter-intuitive, but this is very useful for bringing up the Raspberry Pi 4 WiFi.

The list above should be a pretty complete list of the required additional hardware.

Development Computer Ubuntu 20.04 Install

The development computer is assumed to be running Ubuntu 20.04. It is beyond the scope of this document explain how to download Ubuntu 20.04.

You may do one of the following:

  • Purchase a laptop with Ubuntu preinstalled.

  • Install Ubuntu 20.04 onto an 64-bit x86 processor yourself.

  • Install Ubuntu 20.04 to run under a virtualization environment like (VirtualBox)[https://www.virtualbox.org/].) If you use VirtualBox, be sure to configure the Ethernet adapter to be in "bridged mode". Other than that, just follow the lengthy installation instructions.

Development Computer ROS2 Install

Once you have Ubuntu 20.04 installed, please install the ROS2 version named Foxy which configured for Ubuntu 20.04. Do a full desktop install.

Development Computer Configuration:

This is where various specialized configurations occur. For now there is only one:

  • Install usbip Client Service: The usbip protocol is used to allow the development computer to connect to the ST-Link on the robot micrcontroller.

Install usbip Client Service

The robot microcontroller has an ST-Link system on it that is used for firmware download and debug. The robot microcontroller firmware is developed on the development computer. The robot computer provides a bridge between the ST-Link on the robot microcontroller and the development computer as shown immediately below:

                        IP                    USB
 Development Computer <====> Robot Computer <=====> Robot Microcontroller
    (usbip client)            (usbip host)

The protocol is called usbip for USB Internet Protocol. This protocol enables the access to USB devices on other computers as if they are local.

Create a systemd service file:

 sudo -s   # switch over to super user
 cat <<EOF > /etc/systemd/system/usbip-client.service
 [Unit]
 Description=USB/IP Client Modules

 [Service]
 Type=oneshot
 RemainAfterExit=true
 ExecStart=/sbin/modprobe -qab vhci-hcd

 [Install]
 WantedBy=multi-user.target
 EOF

 exit # Exit super user mode

 systemctl enable usbip-client.service
 systemctl start usbip-client.service 
 systemctl status usbip-client.service  # Should be OK

 # Verify that it worked:
 lsmod | grep vhci
 # Should list two lines

Development Computer STM32CubeIDE Install

There are multiple cross platform IDE's (Integrated Development Environment) out there. The STM32CubeIDE IDE is selected because it is directly supported by microcontroller vendor (i.e ST Microelectronics.) There are others (e.g. vscode, Keil, etc.) that could work as well, but they are not directly supported by STM.

Please note that these instructions are for STM32CubeIDE 1.5.x. The 1.6.x version of STM32CubeIDE has been released and these install instructions need to be updated.

Please do the following:

  1. Uninstall Notes:

    Note that STM32CubeIDE is a big complicated program that feels obligated to create a bunch of sub-directories in your home directory. At this point in time, the following sub directories are created:

    • .stm32cubeide/: It seems to just contain favorites.mcus.txt.

    • .stm32cubemx/: Some plugins/ and thirdparty/ software.

    • .stmcube/: Empty!

    • .stmcufinder/: Some plugins/.

    • st/: This s a sub-directory that contains the actual unpacked IDE files from the download .zip file (see below.)

    • STM32Cube/: This is a huge sub-directory contains many gigabytes of files. It sometimes downloads new updates that essentially duplicated the contents of the st/ directory.

    • STM32CubeIDE: This is the default sub-directory for your workspace (see further below.)

    If you ever need to clean STM32CubeIDE off your computer, delete all of these sub-directories. With the exception of the st/ sub-directory, all of the other directories are created the first time you run STM32CubeIDE

  2. Notation:

    Downloading the STM32CubeIDE is pretty involved. In the instructions below, the following notation in all capital letters shows up:

    • USER: This is your user name (e.g. alice for /home/alice).

    • PASSWORD: This is your login password. It is needed for the sudo program.

    • X: The major version of the STM32CubeIDE.

    • Y: The minor version of the STM32CubeIDE.

    • D: Decimal digits that changes from release to release.

  3. Enable sudo command:

    Run the groups command and verify that you are in the sudo group. If sudo is not present, you are not sudo enabled. Please visit How to Add User to Sudoers. You can probably skip step 1, since you probably already have a user account.

  4. Create STM Account:

    Visit the STMe2CubeIDE download page..

    Basically, you MUST create an account with ST before you can get the software. Create your account now, if you do not already have one. Fill in the forms and wait for the account to happen. STM will offer the you the wonderful opportunity to let them send you lots of marketing, but they also give you the opportunity to decline this generous offer.

  5. Download and Save .zip File:

    Now that you have the STM account, STM will let you download the software. Revisit, STMe2CubeIDE download page., and click on the [Get Software] button for the STM32CubeIDE-Lnx Generic Linux installer. The instructions below are for the Generic Linux installer, NOT the Debian installer.

    Eventually, you will get your hands on a .zip file with a long ugly name that looks basically like this:

    en.st-stm32cubeide_1-X-Y_DDDD_DDDDDDDD_DDDD_amd64_sh.zip

    Please store the .zip file someplace, just in case you need to reinstall in the future.

  6. Unzip the Downloaded .zip file:

    Now, unzip the file using the command immediately below:

    unzip -x en.en-st-stm32cubeide_1-X-Y_DDDD_DDDDDDDD_DDDD_amd64_sh.zip

    This should result in a .sh (shell) file that looks kind of like:

    st-stm32cubeide_1.X.Y_DDDD_DDDDDDDD_DDDD_amd64.sh

    The version information is always changing, so the X, Y, and D values change regularly. This is the unzipped installer file.

  7. Execute the Installer script file:

    It is going to ask you agree to a whole bunch of license agreements, install stuff in places, etc. There are also a few steps that need to be done in super user mode.

    Now execute the install script file:

    sh st-stm32cubeide_1.X.Y_DDDD_DDDDDDDD_DDDD_amd64.sh

    Roughly speaking the following output occurs. It will change over time, so do not be concerned if it looks a little different. You input response are marked with <== ...:

     Verifying archive integrity... All good.
     Uncompressing STM32CubeIDE 1.X.Y installer  100%
     STMicroelectronics Software License Agreement
     ...   <== Big long license agreement.  Type [Space] to scroll through it.
     I ACCEPT (y) / I DO NOT ACCEPT (N) [N/y]                        <== Type 'y'
     License accepted.
     Do you want to install STLinkServer and Udev rules for STLink and Jlink?
     Without these packages, you will not be able to use debugging feature.
     Install them? (you need sudo permission to do that) [Y/n]       <== Type 'Y'
     STM32CubeIDE install dir? [/home/HOME/st/stm32cubeide_1.X.Y/]   <== Type [Enter]
     Installing STM32CubeIDE into ...
     Java cacerts symlinked to /etc/ssl/certs/java/cacerts
     [sudo] password for USER:                                       <== Type your PASSWORD
     Creating directory root
     Verifying archive integrity... All good.
     Uncompressing STM udev rules installer  100%
     STMicroelectronics Software License Agreement
     ...   <= Big long license agreement.  Type [Space] to scroll through it
     I ACCEPT (y) / I DO NOT ACCEPT (N) [N/y]                        <== Type 'y'
     STMicroelectronics Software License Agreement
     ...   <== Another long license agreement.  Type [Space] to scroll through it
     I ACCEPT (y) / I DO NOT ACCEPT (N) [N/y]                        <== Type 'y'
     License accepted.
     stlink-server v2.Z.Z (ZZZZ-ZZ-ZZ-ZZ:ZZ) installation started.
     ...  <== More text that can be ignored.
     Do you want to install Segger J-Link udev rules? [Y/n]          <== Type 'n'
     STM32CubeIDE installed successfully
    
  8. Put stm32cubeide in your PATH:

    Using your favorite text editor (e.g. nano), add the following to your ~/.bashrc file near the bottom of the file:

    export PATH=$PATH:$HOME/st/stm32cubeide_1.X.Y/stm32cubeide

    Remember to use the correct values for X and Y. Now source the ~/.bashrc file as follows:

    source ~/.bashrc
    

    The command:

     which stm32cubeide
    

    should return /home/USER/st/stm32cubeide_1.X.Y/stm32cubeide. If it does, you have successfully installed stm32cubeide.

It program is run for the first time further below in the Firmware Development section. That concludes STM32CubeIDE software installation.

Robot Computer Ubuntu Installation

This section is broken into the following sub-sections:

  • Command Line Notation: This briefly discusses the command-line notation rules used.

  • Bring Up Strategy: This discusses the two initial bring up strategies. You get be pick between display/keyboard bring up vs. headless bring up.

  • Install Ubuntu onto a Micro-SD Card: A program called rpi-imager installed onto your development computer and is used to load the Ubuntu image for the Raspberry Pi4 onto a micro-SD card.

  • Raspberry Pi 4 Connector Locations: This section describes the names and locations of the various Raspberry Pi 4 connectors.

  • Initial Bring Up: The Raspberry Pi 4 is powered up to the point that it can be logged into. This is easy if you have a keyboard and display plugged into the Raspberry Pi 4 and it is significantly more difficult if you are not.

  • Login and Configuration: This takes you from login up to the point where is ready to do actual software development.

  • Remote USB Installation Remote USB is used to provide access to the ST-Link on the robot mircocontroller. Code must be installed on both the robot computer (and the development computer.)

Command Line Notation

Most of the configuration is done via typing in commands to a console interpreter (i.e. a Linux shell.) When you see block of code like:

 # Example comment
 echo hello
 # `hello` should show up.

Just type in the code one line at a time to the console. All characters after from sharp character (#) onward are a comment that does not need to be typed in.

Also, you will see some upper-case keywords in the scripts below. You should substitute the values you choose for these keywords into the scripts below. For example, when you NEWHOSTNAME you substitute in the new host name that you selected (e.g. myrobot, fun4me, etc.)

These are the current upper-case substitutions:

  • NMAP_IP_RANGE: This is a special internet protocol address that is used by the nmap program. This is for the headless install option only.

  • RPI4_NET_ADDRESS: This is a 4 decimal numbers separated by periods (.`). This is the initial internet address of the robot. This instruct

  • NEWHOSTNAME: The original host name provided by the downloaded Ubuntu image is ubuntu. This needs to be changed.

  • NEWUSERNAME: This is a new user account name that you select. Many people just use their first name (e.g. alice, bob, carol, dave, etc.)

Bring Up Strategy

For the HR2, the nominal computer for the Robot Computer is a Raspberry Pi 4 with at least 4GB. If necessary, reread the introduction to refresh your memory of what the robot computer is.

There are two installation strategies:

  • Display/Keyboard: The display/keyboard method is the easiest, but it requires:

    1. Keyboard: A Keyboard with a USB-A connector is plugged into one of the USB ports on the Raspberry Pi 4.

    2. HDMI display: While resolution does not matter, having the HDMI input connector is required.

    3. Micro HDMI to regular HDMI cable: This cable adapts between the Raspberry Pi 4 and the HDMI cable.

  • Headless:

    A computer without a keyboard/display is called "headless". It can only be administered via a network connection. For this method, the Ethernet cable is temporarily required. One end of the Ethernet cable is plugged into the Raspberry Pi 4 and the other end is plugged into your local area network. This is done with a RJ45 cable. If you normally use WiFi, you may have to search for the RJ45 connector on your cable modem. If you can not find a live RJ45 connector to plug into, you must use the display/keyboard method.

Install Ubuntu onto a Micro-SD Card

The instructions here are based on Ubuntu Install. Since web pages change all the time, the steps are summarized below:

  1. Install rpi-imager: Run the following command to install rpi-imager:

    sudo apt install -y rpi-imager

  2. Install Micro-SD Card into the computer: Install the 32GB (or larger) micro-SD into the micro-SD card adapter. Insert the micro-SC card adapter into your development computer. If you are running Ubuntu under a virtual machine (i.e. VirtualBox). it may be necessary to import the micro-SD card into the virtual environment. Once the card is installed, dismiss any pop-up windows that show up.

  3. Run rpi-imager: Type rpi-imager and a window should pop with 3 buttons on it. The first two buttons are [Choose OS] and [Choose SD Card]. The third button is a grayed out [Write] button.

  4. Choose OS: These windows change from time-to-time, so the instructions below may get a little out of date.

    1. Click on [Choose OS].

    2. Select [Other general purpose OS].

    3. Select [Ubuntu].

    4. Scroll down to Ubuntu Server 20.04.X LTS (RPI 3/4/400). This is the 64-bit server OS with long term support for arm64 architectures.

  5. Choose SD Card:

    It is extremely likely that only one card will be available. A 32GB micro-SD card might show up as 31.9 GB. Click on it.

  6. Write the Card:

    The [Write] button should no longer be grayed out. Click on it. Click on [YES] in the pop-up. It may ask for your password, type it in and click [OK]. You may click on [CANCEL WRITE] at any time, but you will have to start all over again. This should take a few minutes.

  7. Wait a while for the download to occur: While waiting, please remember that there are additional steps required, so do not unplug the micro-SD card adapter when you are done. When the rpi-imager is done, it will say remove the SC card from the reader. Do not remove the adapter, but do click on [Continue]

  8. Close rpi-imager: Dismiss the rpi-imager program by click on the [X] in the upper right corner.

  9. Remove the micro-SD card.

Raspberry Pi 4 Connector Locations

Before getting started please familiarize yourself with the locations of Raspberry Pi 4 connectors.

First, orient the Raspberry Pi 4 so that the 40-pin connector (2 rows of 20 pins) is on top and to the left.

Now find the following connectors:

  • RJ45 Ethernet connector: This is located on the right edge in the upper right.

  • 4 USB type A connectors: These are located on the right edge under the RJ45 ethernet connector. There are two USB connector in each of the two silver "bricks" under the RJ45 connector.

  • USB C Power Connector: The USB C connector is on the bottom edge to the far left.

  • 2 Micro HDMI Connectors: On the bottom edge, the two micro HDMI connectors are to the right USB C power connector.

  • 1 Micro-SD Card connector: On the left edge, but underneath the board you find the micro-SD card.

  • Red Power LED: There is a red power LED near the USB C Power Connector. It is the very small component on the left edge at the very bottom nearest the bottom left mounting holes You can not tell that it is red by looking at it. Just be aware that this component will light just as soon as power is applied to the Raspberry Pi 4.

  • Green Activity LED: There is a green activity LED immediately above the red power LED. Again, you can not tell that it is green. All you need to know is that it is there and turn on and off as various activies occur on the Raspberry Pi 4.

As a further note, there is no on/off switch on the Raspberry Pi 4. What this means that as soon as the "power cable" is connected between the battery pack and the Raspberry Pi 4, the Raspberry Pi 4 will probably start. Do not plug in any power cable until explicitly told to do so in the instructions below.

While the Raspberry Pi does not have an on/off switch, some battery packs do have an on/off switch. So depending upon your battery pack, you may have to toggle a batter power switch to provide power. Once power is applied, the Red Power LED will light up immediately and the green activity LED will start to randomly turn on and off as the Ubuntu operating system powers up. In addition, if a display is both powered up and connected, it will start to display text on power up.

Please reread section on keyboard/display vs headless install. Please follow the instructions for either Keyboard/Display Installation or Headless Installation.

Initial Bring Up

This is where the initial Raspberry Pi 4 power up occurs. This takes you as far as the login: prompt.

Perform the instructions below depending upon which bring-up strategy you selected:

Keyboard/Display Bring-up

For keyboard/display installation do the following:

  1. Plug in keyboard: Plug your keyboard into one of the USB type A connectors.

  2. Plug in micro HDMI-Cable: Plug one end of the micro-HDMI cable into either one of the Raspberry Pi 4 micro-HDMI connectors.

  3. Plug into the HDMI Display: Plug the other end of the micro-HDMI cable into your HDMI display.

  4. Plug micro-SD Card: Plug in the micro-SD card

  5. Display Power Up: Turn on the HDMI display.

  6. Before Power Up: Remember, once the power cable is connected, the Raspberry Pi will power up immediately since there is no on/off switch.

  7. Connect Power Cable and Power Up: Make sure you have a cable that is compatible between your battery pack and the USB-C connector on the Raspberry Pi 4. Your battery pack probably came with one, so plug it in and watch the show.

  8. When your display shows something with something like ubuntu login: it means you are ready to login and start configuring the Raspberry Pi. You can skip the section immediately below on headless install.

Proceed to the Initial Bring up section.

Headless Bring-up

This section concerns headless install which is significantly more complicated than the headless The overall goal of a headless install is to login into the Raspberry Pi 4 remotely via the internet.

What makes headless installation harder is that when the Raspberry Pi connects to the internet for the very first time is it will ask the network to give it an internet address via a protocol call DHCP -- Dynamic Host Configuration Protocol. We need to figure out what address was assigned by DHCP before you can log into the Raspberry Pi 4 from the development computer.

Please perform the following steps:

  1. Install the following packages on your development computer:

    Install the following packages onto your computer:

     sudo apt install -y iproute2               # Get `ip` command
     sudo apt install -y nmap                   # Get `nmap` local net scanner.
     sudo apt install -y net-tools              # Get `arp` command, ping, ifconfig, etc.
     sudo apt install -y libnss-mdns mdns-scan  # For avhi (i.e. zero-conf)
    

    For you information:

    • The ip command is used to flush something called the ARP cache. ARP stands for Address Resolution Protocol.
    • The nmap command scans your local internet looking for active internet addresses.
    • The arp command lists all of the active internet addresses.
    • The libmss-mdns and mdns-scan packages provide functionality loosely called zero-configuration networking or "zero-conf" for short. This allows us to login into a computer using its host name instead of a bunch of numbers.
  2. Verify zero-conf is working:

    Run the following command:

     ping -c 3 `hostname`.local  # Note that the accent ("`") is used instead of the single quote ("'").
    

    It should print out a few lines as follows:

     PING ??? (192.168.xxx.yyy) ...
    

    There are three internet address ranges that are reserved for local area networks.

    • Class A: 192.168.yyy.zzz where yyy is normally 1 (i.e. 192.168.1.zzz).
    • Class B: 169.124.yyy.zzz.
    • Class C: 10.xxx.yyy.zzz, where xxx is typically 1 (i.e. 10.1.yyy.zzz).
    • Something else: These headless instructions will not work; use a keyboard/display install.

    For the nmap command, you will need to specify an address space range to scan. Please use the following:

    • Class A: 192.168.yyy.0-255 where yyy is the number from you ping.
    • Class B: 169.124.0-255.0-255 .
    • Class C: 10.xxx.0-255.0-255 where xxx is from your class C network. This is called NMAP_IP_RANGE below:

    These instructions will usually work for class A and class B networks, but will frequently fail for class C networks.

  3. Determine the currently used internet addresses:

    Run the following commands:

     sudo ip neigh flush all     # Flush arp cache *BEFORE* powering up RPi4
     sudo nmap -p ssh -n NMAP_IP_RANGE  # Class A is ~10 seconds, others are about ~5 minutes.
     arp > /tmp/before.arp
    
  4. Connect network cable: Plug one end of your RJ45 cable into the raspberry Pi and the other into your local network.

  5. Before Power Up: Remember, once the power cable is connected, the Raspberry Pi will power up immediately since there is no on/off switch.

  6. Connect Power Cable and Power Up: Make sure you have a cable that is compatible between your battery pack and the USB-C connector on the Raspberry Pi 4. Your battery pack probably came with one, so plug it in and watch the show.

  7. Wait for 2 minutes: After these 2 minutes the Raspberry Pi should be up and running.

  8. Rescan for currently used internet addresses:

    Run the following commands:

     sudo ip neigh flush all   # Flush arp cache *BEFORE* powering up RPi4
     sudo nmap -p ssh -n NMAP_IP_RANGE  # Class A is ~10 seconds, others are about ~5 minutes.
     arp > /tmp/after.arp     # Note this time `after.arp` is being used instead of `before.arp`
    
  9. Find the new internet address:

    Run the following command:

     diff /tmp/before.arp /tmp/after.arp
    

    This should have on line that shows up that is the internet address of your Raspberry Pi 4. Call this RP4_NET_ADDRESS

  10. Make sure Raspberry Pi 4 is alive:

     ping -c 3 RP4_NET_ADDRESS
    

    If you gets some output. If not, the RP4_NET_ADDRESS you have is not connected to your Raspberry Pi 4 computer

  11. Use ssh to log into your Raspberry Pi 4:

    Run the following command.

     ssh ubuntu@RP4_NET_ADDRESS
    

    It might probably complain about a fingerprint issue.

    Please use the "yes" option.

    Sometimes it will complain about REMOTE HOST IDENTIFICATION HAS CHANGED! It will printout something:

    remove with:
    

    ssh-keygen -f "/home/YOUR_ACCOUNT/.ssh/known_hosts -R "AN_IP_ADDRESS"

    Just run the command and try the ssh ubuntu@RPI_NET_ADDRESS again.

  12. Wait for login prompt:

    If everything worked right, you should get a login prompt

    ubuntu login:
    

    Headless login appears to have largely succeeded.

    It is now time to proceed to the next section immediately below.

Login and Configuration

This section takes you from the login: prompt to more complete Raspberry Pi configuration.

The basic steps are as follows:

  1. Change the Login Password: The initial password is ubuntu, but the system forces you to change it to something else.

  2. Change the Host Name: It is important the change the host name from ubuntu to something else.

  3. Create a New User Account: It is useful to create a new user account with sudo access.

  4. Set Up Zero Configuration: This allows you to be able to connect to the robot with the robot name.

  5. Login into Robot from Development Computer: Now you should be able to login to the computer from your development computer.

  6. Configure Wifi: Configure your WiFi access.

  7. Remote USB Installation: This configures a system call usbip for remote access to the ST-Link device on the Robot Microcontroller.

  8. Final Configuration Notes: Some final comments on configuration.

Change the login password:

When you first login, the system will insist that you change the password for the ubuntu account. It will prompt you for the initial password (ubuntu) first, followed by your new password two times. The reason for prompting for the new password two times is just in case there is a typo. Upon success, the Raspberry Pi 4 will disconnect. You have successfully changed the password.

You will have to login again. On for the headless bring-up method, this will require that you run the ssh ubuntu@RPI_NET_ADDRESS command again. It should prompt for a password and just type in the new password.

When you are done with this step the password should be changed and you should be logged into the Raspberry Pi 4. You should get prompt that looks like ubuntu@ubuntu:~$.

Change the Host Name:

Right now you host name should be ubuntu.

If you type hostname, it should return ubuntu. This verifies that the host name is still ubuntu.

It is important to change the host name to something other than ubuntu. The reason why is because it is necessary to get each robot a unique name to make it easier to connect to it. If all robots were named ubuntu, you would have to keep typing the annoying internet address (e. g. 192.168.1.yyy`) instead.

Please come up with a fun new host name. It should be lowercase letters and digits only, with no punctuation (alice, robot4all, go2dance, etc.) In the command below NEWHOSTNAME is used in the commands, please substitute your lowercase letters and digits for NEWHOSTNAME below:

Run the following commands:

 sudo hostnamectl set-hostname NEWHOSTNAME
 # The prompt should change to `ubuntu@NEWHOSTNAME:$`
 hostname
 # You should get back `NEWHOSTNAME`
Create a New User Account:

You are welcome to continue using the ubuntu account the Raspberry Pi 4, but most people try to create their own personal accounts. Most people make their account names all lower case letters with no numbers or punctuation (greatfun, fred, etc.)

In the script below, substitute your new account name for NEWUSER:

 sudo adduser NEWUSER
 # Type in new password once
 # Type in the same password again
 # Fill in the remaining information.
 # Type `Y` when it asks `Is the information correct?

Give the new account super-user capability with the following command:

 sudo usermod -aG sudo NEWUSER
 sudo usermod -aG dialout NEWUSER

Now verify the user account with the commands below:

 su NEWUSER
 # Type in password
 # The prompt should change to `NEWUSER@NEWHOSTNAME@:~$`
 whoami
 # It should respond with NEWUSER
 sudo echo hello
 # It should prompt for the password again follow by `hello`
 exit
Set up zero configuration.

Zero configuration is a way to export your host name make it easily accessible from you development computer. This means you will no longer have to type in obscure numbers.

First, install some zero configuration packages with the command below:

 sudo apt install -y net-tools libnss-mdns mdns-scan

Now, verify that it works with the following command:

 ping -c 3 NEWHOSTNAME.local
 # You should get back several lines of code.

Now logout as follow:

 exit  # Force a logout
Login into Robot from Development Computer

It should be very easy to log into robot computer from your development computer:

 ssh [email protected]
 # It may complain about authenticity problems.
 # If so, run `ssh-keygen -f ...` command and try the `ssh [email protected]` again.
 # If it complains about fingerprints, type `Y`.
 # Type in the password.
 # You should get a prompt of `NEWUSER@NEWHOSTNAME@hr2b
Configure Wifi

The next step requires access to a WiFi router connected to your local network.

  1. Install network manager:

     sudo apt install -y network-manager   
    

    You now have a program named nmcli (Network Manager Command Line Interface).

  2. Verify WiFi is enabled:

    To verify that the wifi is enabled do the following:

     nmcli radio wifi
     # It should come back with `enabled`.
     # If `disabled` run `nmcli radio wifi on`
    
  3. Search for WiFi access points with the the following command:

     nmcli dev wifi list
     # A list of WiFi access points should show up.
    

    The name of the access point is called an SSID. Find the SSID of the WiFi access point to connect to. In the scripts, below substitute the correct name for SSID.

  4. Register a Wifi access point for logging in with the following command:

    sudo nmcli --ask dev wifi connect SSID
    # Type in your `sudo` password if prompted.
    # Type in WiFi password after the password prompt.
    
  5. Verify active connection with the following command:

    nmcli con show --active
    

You should see one active connection.

  1. Run ifconfig (Interface Configure):

    ifconfig
    

    You should get network status for eth0, lo, and wlan0. eth0 is the hardwired ethernet. lo is a LOopback pseudo interface. wanl0 is the wireless (WiFi) interface. Just in case, write down inet address. You can ignore the netmask and broadcast fields.

  2. Reboot and Unplug Ethernet Cable with the following commands:

    sudo reboot -h now  # Force an immediate reboot
    # Now unplug the ethernet cable (for the headless bring up strategy)
    # Wait a for a couple of minutes
    
  3. From your development computer, verify that the robot computer logged into the WiFi access point with the following command:

    ping -c 3 NEWHOSTNAME.local
    # You should get 3 ping responses
    
  4. Login/logout to/from the robot computer with the following commands:

    ssh NEWACCOUNT@NEWHOSTNAME
    # Type in password for prompt
    # When logged in shut down Raspberry Pi 4
    sudo halt
    # Type in password for prompt
    # The robot should turn off
    
Remote USB Installation

The robot microcontroller has an ST-Link system on it that is used for firmware download and debug. The robot microcontroller firmware is developed on the development computer. The robot computer provides a bridge between the ST-Link on the robot microcontroller and the development computer as shown immediately below:

                        IP                    USB
 Development Computer <====> Robot Computer <=====> Robot Microcontroller
    (usbip client)            (usbip host)

A system called usbip is used to provide remote access to USB devices. A usbip client is installed on the development computer and a usbip host is installed on the robot computer. When usbip properly installed, the development computer accesses the remote ST-Link subusystem as if it was locally plugged into the development computer.

This section discusses how install usbip on the robot computer. It is broken into the following sections:

Install usbip Packages

Install the following packages:

 sudo apt install -y linux-tools-common
 sudo apt install -y linux-tools-raspi
 sudo apt install -y usbutils
 sudo apt install -y linux-cloud-tools-common  # Not sure about this one (seems to help)

Install the following symbolic link:

 sudo ln -s /usr/share/misc /usr/share/hwdata  # Only need to do once

The symbolic link deals with the fact that the USB ids file got moved from /usr/share/hwdata to /usr/share/misc. It is much easier to fix this problem with a symbolic link than it is to fix the code.

Once you have installed the packages and symbolic link, verify that everything is installed.

which usbip   # Should return `/usr/bin/usbip`   # This is the `usbip` user level program
which usbipd  # Should return `/usb/bin/usbipd`  # This is the `usbip` daemon.
Install usbip Service

The Robot computer needs to do three things on start-up.

  1. Load a couple of kernel modules -- usbip-core and usbip-host.

  2. Start the usbipd daemon.

  3. Find the ST-Link and make it available for remote access.

This is done with two files:

  • /etc/systemd/system/usbip-host.service: This is a systemd unit file that properly installs the kernel modules and runs the daemon. It also invokes the usbip-host.service.sh shell file immediately below.

  • /usr/local/bin/usbip_host.service.sh: This determines if an ST-Link plugged into one of the robot computer USB ports and (if present) bind it such that it is available for external access.

The file is installed as super user:

 sudo -s  # If prompted for a password, type it in.
 # Prompt character changes from `>` to `#` to remind you that your are super-user

Now install /etc/systemd/system/usbipd.service as follows:

 cd /etc/systemd/system
 wget https://raw.githubusercontent.com/hbrobotics/hbrc_ros_robot_platform/master/bin/usbip_host.service

Now install /usr/local/bin/usbip_host.service.sh as follows:

 cd /usr/local/bin
 wget https://raw.githubusercontent.com/hbrobotics/hbrc_ros_robot_platform/master/bin/usbip_host.service.sh
 chmod +x usbip_host.service.sh
Verify usbip Installation

Plug a USB-A to USB-micro cable between the Robot Computer and the Robot Microcontroller (i.e. the Nucleo.)

Verify that both files exist:

 ls -l /etc/systemd/system/usbip_host.service  # Should print a one line directory listing
 ls -l /usr/local/bin/usbip_host.service.sh   # Should print a one line directory listing

Now enable/start the service:

 systemctl enable usbip_host.service
 systemctl start usbip_host.service

Verify that it is running:

 systemctl status usbip_host.service
 # A bunch of stuff should print out.  "Active: active (running) ..." is want is wanted.

Verify that it can find the ST-Link module:

 usbip list -l
 # It should print out `busid ...` followed by `STMicroelectronics ...`
 # If not, try to reboot.

Verify that it remotely accessible:

 usbip list -r localhost
 # Should print out `localhost`, followed by the same lines as imediately above.
 # If not, try to reboot.

Now exit super-user mode:

 exit

Things are looking good. Now comes the final test where the Robot computer is rebooted and accessed remotely from the development computer.

Force the Robot Computer to reboot.

 sudo reboot -h now
 # If you are logged via remote shell, you will be immediately logged out.

Wait 2 or 3 minutes for the Robot Computer to reboot. While you are waiting do the following in a console window on the deveopment computer:

 export HR2_REMOTE=NEWHOSTNAME.local
 # This sets the HR2_REMOTE environment variable to be the robot host name followed by `.local`.

After the 2 or 3 minutes have elapsed, you should be able to ping the Robot computer:

 ping -c 3 $HR2_REMOTE
 # You should get 3 ping messages.

If that does not work you can try to run the following commands:

 sudo ip neigh flush all   # Flush arp cache *BEFORE* powering up RPi4
 sudo nmap -p ssh -n NMAP_IP_RANGE  # Class A is ~10 seconds, others are about ~5 minutes.
 arp

Once ping is working, do the following:

 usbip list -r $HR2_REMOTE
 # Should get the pretty much listing as when this command was run on the Robot computer.

That is pretty much it. Eventually, when the firmware development software is ready for use, the .../bin/xstm32cubeide wrapper is used to access the ST-Link remotely from the development computer.

Final Configuration Notes

In general, configuration basically never ends. But this is a reasonable place to stop for now. The next major step is to install ROS2 on the robot computer

Robot Computer ROS2 Installation

The initial installation of ROS2 is pretty straight forward. The steps are:

  1. Connect to ROS2 PPA: The ROS2 organization maintains its own PPA (Personal Package Archive).

  2. Download ROS2 Foxy: The latest ROS2 release is called "Foxy".

  3. Final ROS2 Configuration: The final ROS2 configuration is pretty simple.

Connect to ROS2 PPA

The ROS2 instructions for connecting to the ROS2 PPA are a little more involved than the instructions immediately below. The instructions use apt-key rather than curl:

 sudo apt-key adv --fetch-keys https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc
 sudo apt-add-repository http://packages.ros.org/ros2/ubuntu

Download ROS2 Foxy

Next install foxy:

 sudo apt install -y ros-foxy-ros-base
 sudo apt install -y python3-argcomplete
 sudo apt install -y python3-colcon-common-extensions
 sudo apt install -y python3-vcstool

Final ROS2 Configuration

Next some modifications are made to make ROS2 more permanent:

 source /opt/ros/foxy/setup.bash
 echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

Firmware Development

Firmware development is a big topic. This document only gets you to the point where you can download and existing program and execute it on your microcontroller board (i.e. the NUCLEO-F7676ZI). The program is called blinky and it blinks the LED on the Nucleo board. A trivial change is done to the main program and the returned back to is initial state.

The STM32CubeIDE (Integrated Development Environment) uses the concepts of workspace and project:

  • Workspace: A workspace is a directory where the IDE stores miscellaneous files needed by the IDE. In particular, this is the place where the IDE keeps track of your projects. Your workspace directory is generally not keep under revision control. The workspace directory defaults to ~/STME32CubeIDE/workspace/workspace_1.X.Y/. It is recommended that you use this default workspace location.

  • Project: A project is a directory that is self contained piece of software that can be downloaded to a microcontroller. The project directory can be stored as a sub-directory in the workspace. However, for this project that is not recommended. Instead, projects are stored in a different location (the HR2 git Repository). None-the-less, the workspace can work with these projects in various different directories. Projects can easily be added and removed from a workspace.

The terms workspace and project are heavily used, so it is useful to have an idea of what they are beforehand.

Now, please follow the following steps:

  1. Start stm32cubeide:

    This starts everything rolling. stm32cubeide should be in your path. So, typing stm32cubeide in a console window should work.

  2. Select a workspace directory:

    STM32CubeIDE really wants a workspace. So the first thing you will see is a pop-up is window entitled Select a directory as workspace. The default workspace directory is /home/USER/STM32CubeIDE/workspace_1.X.Y.

    You can check [x] Use this as the default and do not ask again if you do no want see this pop-up again.

    Please click on the [Launch] button.

  3. Main Screen.

    The main screen that pops up is pretty spartan at first. It has:

    • Title Bar: The standard title is on top. The current workspace (not selected yet!) is typically displayed in the title bar.

    • Command Bar: There is the standard bar of text commands File, Edit, ... , Help.

    • Tab Window: There is a tab window has the [Information Center] tab showing. It humorous to note that this tab is rather non-informative at first. Additional tabs are forthcoming.

    • Vertical Icon Bar: There is a vertical bar on left that has some inscrutable icons in it. You can hover your mouse over the icons to get slightly more descriptive names.

  4. Open Project Explorer:

    Find the [Restore] icon in the vertical icon bar and click on it.

    Now the [Project Explorer] tab should be open.

    Click on [Import projects...]

  5. Project Import:

    The [Import] pop-up shows up. It wants you to Select an import wizard:. Please click just to the left of [General], and some additional options should show up.

    Select on [Existing Projects into Workspace] and click on the [Next>] button.

  6. Import Projects:

    The [Import Projects] window pops up.

    Now you get to (x) Select root directory and click on the [Browse...] button. Using a file chooser, select the directory $HR2_DIRECTORY/software, where $HR2_DIRECTORY is the directory that contains the local copy of the HR2 git repository.

  7. Import blinky:

    A list of predefined HR2 projects should show up. Please click [Deselect All] followed by checking off on the one named [x] blinky. When you click on the [Finish] button, this will import the blinky project to your workspace. You should now have one project in your workspace.

  8. Find main.c:

    The project explorer should show a blinky in it. This is a tree explorer. Open blinky1 => Core => Src until main.c is showing. Double click on main.c to open up the main.c file.

  9. main.c Tab:

    The main.c tab should show up. Scroll through it until you see the int main(void) function (approximately line 70.) This is the first function called by the program.

    Scroll down until you find the Infinite loop (approximately line 100.) You should see 3 HAL_GPIO_TogglePin() function calls followed by a HAL_Delay().

    Eventually, you will edit the HAL_Delay() function call, but that is a little further below.

  10. Plug in Nucleo Board:

    Now is a good time to plug the Nucleo-767ZI board into your development computer using a USB cable with male USB mini connector on it. There are two female USB connectors on the Nucleo-767ZI board. There is one next to the large RJ45 connector and there is one on the opposite end that is for the ST-Link module. Plug into the ST-Link module. A big red LED on ST-Link module should light up when you plug into it. In addition much smaller green power LED on the "main" board will light up. The big red LED is actually a bi-color LED that can switch between read and green. It changes colors as various things go on.

  11. Verify Nucleo Board Found:

    When you run lssub in a console window, you should see a line that contains STMicroelectronics ST-LINK/V2.1 or something quite similar to it. This means that your development computer sees the ST-Link board and it should be ready to use.

    If not, you have problems and need to figure what went wrong.

  12. Download and Run Blinky:

    Now you are going to run the blinky program.

    Everything happens pretty fast once you do the steps below. The following things happen one after another:

    1. The code is going to be compiled into an downloadable executable.

    2. STM32CubeIDE opens a connection to the Nucleo board. The ST-Link LED which is normally red, turns green.

    3. While program is being downloaded, the ST-Link LED flashes between red and green

    4. The program starts running and flashing its green, blue, and red LED's on the main Nucleo board.

    5. The ST-Link LED returns to red it indicate that it is no longer connected.

    There is an icon bar across the top. One of the icons looks like a green bug. The boring one to the right is the [Run] icon Without clicking, hover over the [Run] button, to see if it shows [Run main.c]

    To the right of the button is black pull hierarchical menu triangle. The menu item you need to select is two levels deep. Everything happens when you release the mouse button. Select the following:

    "[Run main.c]=>[Run As]=>[STM32/Cortex M C/C++ Application]`.

    Now watch the light show. If you missed it the first time around, you can do it again. Smile!!! You just ran blinky.

  13. Change Blink Rate.

    Got back to the [main.c] tab and find the HAL_Delay() function at approximately line 100. Edit it from 1500 to 50. The delay is in millseconds, so the LED's will flash much more quickly.

    Do the same process as the previous step, but [Save and Launch] pop up window will show up. Click on [OK] and the new program will download with the slower blinking LED's.

  14. Change Blink Rate Back.

    Change the 50 back to 1500 and download again.

  15. Exit STM32CubeIDE.

    Using the [File] menu in the upper left, select [Exit]. The STM32CubeIDE should shut down. You may also unplug your Nucleo-767ZI board.

That is it for now.

Micro-ROS

The micro-ROS documentation is still a work in progress. Reasonable starting points are:

  • micro-ROS Home Page: This is the top level page. At the time of this writing, the page is totally mangeled unless it is viewed in full screen mode. When will web page designers ever learn? (Sorry, that is a rhetorical question.)

  • micro-ROS Tutorials: The tutorials and demos are a reasonable place to start.

As an overview, various flavors of ROS2 run on different computers.

  • Development Computer: The development computer is an 64-bit x86 machine that runs stock ROS2. GUI intensive tools such as RViz, STM32CubeIDE, etc. can be run here. All of these tools are compiled to 64-bit x86 code. The Development Computer ROS2 Install is described above.

  • Robot Computer: The Robot computer computer is 64-bit Arm Raspberry Pi 4. ROS is already compiled for these platforms. The Robot Computer ROS2 Installation is described above. Only non-GUI programs are installed on the robot computer. The key program that needs to be run on the robot computer is called the micro-ROS agent and it dedicated to talking to the robot microcontroller.

  • Robot Microcontroller: The Robot microcontroller is a 32-b Arm Microcontroller (STM32F767ZI). It is currently a Nucleo-F767ZI. It has code that interfaces the to the robot sensors and actuators. It all has code to communicate with the micro-ROS agent that runs on the Robot computer.

The protocol that glues all of this together is called Data Distribution Service (DDS). All three of the computers have implementations of the DDS protocol. The one on the Robot microcontroller is a stripped down version of DDS to make it fit.

Micro-ROS on Linux

The First micro-ROS application on Linux runs everything on your Development computer. Typing the scripts in the code to follow the tutorial is a bit error prone, so there is a shell script in the HR2 bin directory call uros_linux_install.sh. This program takes one argument which is a directory to install everything into. It is perfectly acceptable to specify a directory in the /tmp directory the first time. This allows any problems to be easily deleted.

Feel free to read the shell script file as you read through the tutorial. It might make your life a little easier.

The First micro-ROS application on an RTOS builds the micro-ROS agent to run on either your development computer or on your robot computer. It also build the micro-ROS firmware which is downloadable to the Robot Microcontroller. As with the first tutorial, there is anither script in the bin directory called uros_nucleo_install.sh that will install the micro-ros code and build both the agent and the firmware. The first time you run this script do it on your Development computer. Eventually, you will rerun the same script on your Robot computer (i.e. the Raspberry Pi 4.)

Start Project`
  1. A Popup that says ? Initialize all peripherals with their default Mode? [Yes] [No] shows up. Click on [Yes].

  2. A window with 4 tabs shows up. The 4 tabs are:

    • [Pinout & Configuration]: This one shows the outline of the integrated circuit with various pins highlighted. This is the initially selected tab. For now, we ignore this tab.

    • [Clock Configuration]: This one shows the clock configuration diagram, which can be quite complicated. For now, leave this one alone.

    • [Project Manager]: This one is used for setting up the project. There are numerous things on this tab. In the next step below, this tab is used.

    • [Tools]: This is some advanced tools that are ignored for now.

  3. Select the [Project Manager] tab and fill in the following fields:

    • Project Name: Give the project a name. It is recommended that the name include at some fraction of the processor. For example, blinky_f767zi.

      • Project Location: This the WORKSPACE directory. You must either browse or manually type in the full path to this directory.

      • Toolchain / IDE: This is a selection box that is normally set to [EWARM]. It is very important to change this to [Makefile]

  4. Select the [Pinout & Configuration] tab:

    • Select the Connectivity > drop down menu and select ETH.

    • A Mode side window shows up. It probably is showing a Mode of RMII. Scroll up to the first entry of the drop down menu and select Disable. This will disable the intialization of the Ethernet device.

  5. In the upper right hand corner there is a button labeled [Generate Code]. Please click this button. After a few moments a popup window that says The Code is successfully generated under : followed by the directory of the form /...WORKSPACE/PROJECT. Whole bunch of files have been created in this project directory. The most interesting ones are

    • PROJECT.ioc: This file is the I/O configuration file.
    • Makefile: This file is used to build the project using the make program.
    • Core/Src/main.c: This is the main C program that initializes the microcontroller.

    Both the Makefile and the main.c file need to be edited.

  6. Edit the Makefile to have the following target immediately after the clean: target:

     flash: all
             openocd -f interface/stlink-v2-1.cfg -f target/stm32f7x.cfg -c "program $(BUILD_DIR)/$(TARGET).elf verify reset exit"
    

    Please make sure you use a [Tab] character as the first character on the line containing openocd. Spaces will not work.

  7. Bring up Core/Src/main.c file in your favorite text editor. Search for Infinite loop. Make sure the code looks as follows:

      /* Infinite loop */
    
      /* USER CODE BEGIN WHILE */
      while (1)
      {
        HAL_GPIO_TogglePin(LD1_GPIO_Port, LD1_Pin);
        HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
        HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
        HAL_Delay(250);
        /* USER CODE END WHILE */
    
        /* USER CODE BEGIN 3 */
      }
      /* USER CODE END 3 */
    

    This code toggles the 3 LED pins and then delay for 250 microseconds between toggles.

  8. Plug Nucleo-F767ZI into your Host Computer.

  9. Verify that Host computer found it with lsusb. It should show up as something like STMicroelectronics ST-LINK/V2.1.

  10. Build and download the code using

     make flash
    

    This should download and install the blinky code. If it does not, please carefully check M

This completes all of the steps needed to run the Blinky program.