Installing software and tools on a Windows 7 PC
The BeagleBoard is fast by embedded standards and it will give your embedded system a run for its money, but it is not designed for some complicated tasks, such as compiling piles of source code to get an executable Linux kernel. Therefore, the widely-accepted practice for embedded system development is to develop and build software on a powerful desktop PC system (host PC) and then transfer the resulting executable software to the target system (which is the BeagleBoard in this book).
Target and host PC systems
Compared to the target embedded system, the host PC usually has a much more powerful CPU and huge memory. In theory, you can write your code and compile them at your target hardware, the BeagleBoard. This approach is called native complier, as you have a compiler installed at the BeagleBoard to build your software. However, compiling is time and resource consuming, especially when you are developing large software. It is not a reasonable task for embedded systems, which will take much longer than compiling at a PC.
In practice, we usually have a host PC working as a software development machine for coding, compiling, and debugging. This approach is called cross-compiler, as the host PC usually has different hardware and software infrastructure. It does not matter whether the host PC platform runs Linux, Windows, or Mac, as long as it can communicate with the BeagleBoard over a serial port and/or Ethernet.
In this book, we are using a common laptop running Windows 7 operating system on our host PC. This section shows how to install support software and tools for BeagleBoard hardware at the Windows 7 host PC.
Finding the COM port for a RS232-USB adapter cable
As mentioned in step 1 of connecting the RS232-to-USB cable to a spare USB port on the host PC, you usually will get a Found New Hardware Wizard window on your Windows 7 PC.
You may get the following message:
Your device is ready to use
Device driver software installed successfully.
If you see the preceding message, please go to step 3 of finding COM port in Windows Device Manager as explained in the following steps.
If the error message Device driver software was not successfully installed pops up, the RS232-USB cable is not recognized correctly and will be identified as an Unknown Device. Simply close the pop-up window and follow these steps:
- Download the driver for your RS232-to-USB adapter cable. If it is necessary, please contact the manufacturer to download the driver.
- Go to the Windows device manager by navigating to Start | Control Panel | Device Manager, and navigate the device tree to find the Unknown Device. Right-click on the Unknown Device and click on Update Driver Software. And follow the instructions therein to finish the driver installation.
- Navigate to Start | Control Panel | Device Manager, then navigate the device tree, expand the item Ports (COM & LPT) and check if a COM port has been created successfully, as shown in the following screenshot.
Write down the port number. For example, the port number is 4 in the following following screenshot:
Note
If you have more than one COM port listed in your device manager, disconnect and reconnect the RS232-USB cable; the COM port that disappears and then shows up again is the correct port for BeagleBoard communication. In some cases, the USB serial port adapters do not appear immediately after you install the driver. To solve this issue, simply disconnect and reconnect the cable, or reboot your host PC.
Configuring the IP address of the host PC
Once we have connected the BeagleBoard to the host PC either directly through an Ethernet cable or through an Ethernet hub, we need to set up correct IP configurations at both the host PC and the BeagleBoard sides. In this section, we will look at the IP configuration at the host PC side. The IP configuration at the BeagleBoard side will be examined in the section Installing Ubuntu for BeagleBoard on a Windows 7 PC.
Provided the BeagleBoard and host PC are connected via an Ethernet hub with DHCP services, it is recommended to have your host PC obtain an IP address from the DHCP server. DHCP is a network service that automatically configures the IP settings for Ethernet devices. Follow the given steps to let your host PC obtain the IP address automatically:
- Open the control panel of Windows 7, choose Network and Internet, and then click on Network and Sharing Center. Then on the left panel, select Change adapter settings to list the network adapters of your host PC, as shown in the following screenshot:
- Find the Local Area Connection that is used for your BeagleBoard and double click on it to open the Local Area Connection Properties dialog.
- Double click on Internet Protocol Version 4 (TCP/IPv4) in the item box of the dialog window to open the Internet Protocol Version 4 (TCP/IPv4) Properties window.
- In the Internet Protocol Version 4 (TCP/IPv4) Properties window, select Obtain an IP address automatically radio button and select Obtain DNS server address automatically (as shown in previous screenshot).
- Click on the OK buttons of these windows to finish the IP configuration.
Tip
Manually assign IP addresses
If the BeagleBoard is directly connected to an Ethernet port on the host PC, you need to assign static IP addresses to both the host PC and the BeagleBoard. To do so, in the previous step 4, you need to select Use the following IP address radio button and manually set the IP address. For example, you may use the following configuration for the host PC, enter IP address as
192.168.2.1
, Subnet mask as255.255.255.0
, and Default gateway as192.168.2.1
. Please also note that, in static IP assignment, we also need to manually set the BeagleBoard with an IP address in the same network segment as the host PC. For example, enter IP address as192.168.2.2
and Subnet mask as255.255.255.0
for the BeagleBoard.
Installing MATLAB and the BeagleBoard support package
For rapid prototyping a BeagleBoard embedded audio/video processing system, we are making use of the BeagleBoard hardware support package and automatic code generation provided by MATLAB and Simulink. We will look at how to install MATLAB/Simulink with the BeagleBoard support package.
What are MATLAB and Simulink
MATLAB and Simulink are computing and simulation tools developed by MathWorks, the world's leading developer of technical computing software for engineers, scientists, and economists in industry and education. MATLAB (matrix laboratory) is a numerical computing environment that allows matrix manipulations, data plotting, implementation of data processing algorithms, and interfacing with programs written in other languages, including C, C++, Java, and Fortran. Simulink is a graphical programming tool for modeling, simulating, and analyzing dynamic systems. The graphical block diagramming interface in Simulink allows you to develop your computing algorithms by dragging-and-dropping blocks and connecting blocks by signal wires.
Why we use MATLAB/Simulink for rapid prototyping
The attracting features of using MATLAB/Simulink for BeagleBoard software development are the automatic code generation and the performance optimization by tuning parameters on the fly. This is a fast and inexpensive way for hobbyists and engineers to verify and evaluate their designs early, so that design defects can be found and fixed early.
You can design your data processing algorithms in a user-friendly graphical modular environment and then, in a few minutes time and without intensive manual coding, you see your algorithms running as standalone applications on the BeagleBoard. This is particularly useful when your application involves complicated audio/video processing and needs many trial-and-error iterations for performance optimization.
The advantages of rapid prototyping by MATLAB/Simulink are as follows:
- Focus on innovation and data processing algorithm design.
- Allows you to work in design, coding, deployment, and testing and move quickly between each process.
Tip
You can perform design-testing iterations in minutes rather than weeks.
- Simulink models and data processing algorithms can be auto-coded to C, compiled, and deployed as standalone applications at BeagleBoard.
- Graphical modular programming and automatic code generation make embedded software development easier.
- Obvious advantages for small research project and student DIYs in terms of shorter development time and easier learning curves.
- Intensive simulation to enable "right-first-time" design.
And most importantly, the BeagleBoard support from MATLAB/Simulink now has wide availability and easy access for free. Since MATLAB 2012a, Simulink has a built-in support for BeagleBoard. This BeagleBoard support is also available in MATLAB and Simulink Student Version. You may also ask MathWorks for a trial version (https://www.mathworks.co.uk/products/matlab/trial.html) which also includes the built-in BeagleBoard support.
Installing MATLAB
Suppose you have got a Student Version of MATLAB and Simulink (2013a) and want to install it on your Windows 7 computer. A typical installation requires around 4GB disk and at least 1GB RAM. Follow these steps to install MATLAB:
- Before you begin, make sure your computer is connected to the Internet and you have administrator privileges to install the software. You may register for a free MathWorks account by clicking on Create Account on the webpage www.mathworks.com. Alternatively, you can create one during the installation process.
- If you have the installation DVD, insert the DVD; it will automatically start the installation. If you download the installation files at your local hard drive, or the DVD installation does not start automatically, double-click on the installer
setup.exe
in the DVD or the folder where you saved your downloaded installation files. - Following the instructions of the installer to complete the installation. During the installation, the Product Selection dialog will ask you to select the products you want to install and you should have MATLAB, Simulink, MATLAB Coder, and Embedded Coder selected.
- At the end of installation, you will be asked for activation. Follow the instructions therein to activate it. You will need your e-mail address, MathWorks account information, and the digital image of the proof of your student status.
More details and a step-by-step tutorial of installing and activating a Student Version of MATLAB and Simulink can be found at http://www.mathworks.com/help/install/sv/installing-and-activating-student-version.html.
Installing the built-in BeagleBoard support package
Once you have MATLAB installed and activated on your Windows 7 host PC, run the MATLAB program as administrator and type targetinstaller
in the MATLAB command window followed by pressing the Enter key. This starts the BeagleBoard Support Package Installer. Simply follow the instructions and default settings provided by the Support Package Installer to complete the installation.
This process downloads and installs a Simulink block library called Simulink Support Package for BeagleBoard Hardware, demo examples, and some third-party tools (such as SDL, Wget for Windows and 7-zip) on your host computer.