In this article we will discuss how to start developing applications using the Helix App Cloud cloud platform. Namely, let's talk about the development for Intel Galileo Gen 2 and consider working with the x86-emulator.
Rocket Device Preparation
Connect to the Helix App Cloud and prepare the Rocket Device - a set of settings and development environment for the selected hardware or emulated platform. In order to start working with the Helix App Cloud cloud service, you need a web browser running on Windows or Linux, and an account on
app.cloud.windriver.com . If you do not have such an account yet - register, it is fast, easy and free. After logging in to the account, create a Rocket Device.
1. Click the
New Device button at the top of the page.
')
2. In the pop-up window that appears, click the
Create a new device link
...3. In the list, find
Wind River Rocket for the device you plan to connect to the cloud. For example -
Wind River Rocket for Intel Galileo Gen 2 .
4. Click the
Next Step button.
5. Enter the name of the new Rocket Device.
6. Click the
Create Device button.
After that, the
My Devices section of the site will be opened, and when a card with the name Rocket Device appears there, it will mean that it has been created. For example, this is how it looks in our case.
Now you can generate and download an OS image for installation on the device and start developing applications for it. Details can be found in the Getting started with ... page, which can be downloaded from the Rocket Device details page. For example, here’s what a link to such a document looks like for the Rocket OS distribution for the emulator.
Development for Galileo Gen 2
Rocket Device is ready to work, now you need to configure Galileo Gen 2 and a virtual gateway (Virtual Gateway). After that we will be able to create and compile applications for the target hardware platform, download them to the device, run, debug.
Galileo Gen 2 Setup
To configure Galileo Gen 2 you will need to download and install the Rocket bootloader on the Galileo microSD card. In order to achieve success in this, you will need the following components:
- Fee Intel Galileo Gen 2.
- MicroSD card of at least 1 GB.
- MicroSD card reader
- Serial cable TTL-232R-3V3
- Set Grove Starter Kit Plus
It is understood that by this time you have already created a Rocket Device for Galileo Gen 2 by connecting to the Helix App Cloud cloud service, as described above. If this is not the case, create it, and after everything is ready, follow these steps. Here we use the Windows OS.
1. Connect the MicroSD card to the computer using an external or built-in card reader.
2. When the computer recognizes the card, right-click on its icon and select
Format .
3. Select the type of file system FAT32. Typically, when formatting drives in Windows, this format is set by default, but it’s worth checking that it is.
4. Connect the Galileo Gen 2 board to the computer using a TTL-232R-3V3 cable. Below is a board with a properly connected cable. Pay attention to the color marking.
5. On the Rocket Device property page, in your account, click the
Generate & Download Device Image link.
6. Unzip the downloaded zip archive.
7. Copy the EFI folder from the archive to the microSD card.
8. Disconnect the power cord from Galileo Gen 2.
9. Disconnect the MicroSD card from the computer and insert it into the appropriate slot on Galileo Gen 2.
10. Connect the power cable to Galileo Gen 2.
Galileo Gen 2 will reboot using the image that is in the EFI folder.
Configure Virtual Gateway
Now we will configure and launch the Virtual Gateway (Virtual Gateway), a computer application that will connect the Rocket Device and Galileo Gen 2.
1. Download the Virtual Gateway application.
- Click the Download link in the Device Virtual Gateway Instructions section of the Rocket Device property page.
- Unzip the downloaded zip file.
- Open the folder extracted from the archive and run a file with the name of the type Name-virtual-gateway.bat .
2. In the command prompt window, you will be prompted for the name of the serial port to which Galileo Gen 2 is connected. Enter it.
If you do not know which particular port is connected to the device, find out by using the
Device Manager . After opening it, look at the
Ports section
(COM and LPT) and find the port to which Galileo Gen 2 is connected. After the application connects to Galileo, it will report this.
Pay special attention to the fact that this command line window should be open until you exit Helix App Cloud.
3. Check if Galileo Gen 2 is connected to the Helix App Cloud service. To do this, go to the Rocket Device property page and make sure that there is a green
Gateway icon on it. If this is so, then everything is ready to create applications for Galileo Gen 2 and launch them on the device.
4. This step is optional, but if you are using a USB serial adapter, it will be useful to note that reducing the
Timeout parameter (Latency timer) can significantly increase the speed of debugging applications. To configure this parameter, follow the steps below.
- Open the Windows Device Manager
- Expand the Ports group (COM and LPT) and select the USB serial port adapter. The adapter name may look like “USB to serial adapter”, other options are possible. For example - "USB Serial Port (COMx)".
- Right click on the adapter icon.
- In the menu that appears, select Properties .
- In the device properties window open the Port Settings tab and click the Advanced button.
- In the advanced settings window, set the Timeout (ms) parameter to 4 ms.
Creating an application project for Galileo Gen 2 based on a template
Create an application project using one of the existing templates.
1. On the Rocket Device property page, in the
Application Projects section, click the
Create new project link.
2. In the dialog box that appears, fill in the
Project name field by entering the project name.
3. In the same window, select from the list of
Project template the template for which you want to build the project. For example -
GPIO Read and write .
4. Click
OK and wait until the new project card appears in the
Application projects section. This will mean that the project has been created.
5. Click the
Open button on the project card.
The project will be opened in the Cloud9 integrated cloud development environment.
Build a project for Galileo Gen 2
Now we, using the capabilities of the Cloud9 development environment, will assemble the project and prepare it for launch on the device. To do this, simply click on the
Build icon, which is located on the Cloud9 toolbar.
The
Build window will open (build session terminal), into which service messages will be displayed, allowing you to monitor the progress of work.
When starting the build process, the
outdir directory was created. The application image, the ELF file, will go to this folder after assembly.
Download and run the application on Galileo Gen 2
In order to run the application on Galileo Gen 2, simply click on the
Run Project icon on the Cloud9 toolbar.
The application file will be automatically downloaded to the target device connected to the computer. The
Run Terminal window will open, displaying information about downloading the application. After downloading, the application will start on Galileo Gen 2. We used the application template, which makes the LEDs on the board blink. Their blinking will allow you to make sure that the program has really started on Galileo.
Work with the emulator Intel x86
Wind River Rocket allows you to develop applications and immediately test them on an Intel x86 emulator.
First you need to create a new Rocket Device for the emulator. This process is similar to the one we discussed above. The main difference is that you need to choose
Wind River Rocket for Intel x86 Simulator from the list of available platforms. Next, you need to start the emulator, for this is the
Start Device Simulation button on the Rocket Device property page. Since the emulator is a virtual device, all work with it is carried out in the cloud.
After the emulator starts (it happens very quickly), the status of the Rocked Device will change from
Offline to
Online . When you are done, you can stop the emulator by clicking the
Stop Device Simulation button.
Now create a learning project based on the template. Everything here, in general, is the same as in the above example of working with Intel Galileo Gen 2. The main difference is a different list of templates. For experiments, we will choose the
Dining Philosophers template.
The project is built and run from the Cloud9 integrated cloud interface. It looks the same as when working with Galileo Gen 2, namely, the
Build command is used to
build , resulting in an ELF file. To run the program on the emulator, use the
Run Project icon on the Cloud9 toolbar or the
Run button in the header of the terminal panel.
The x86 emulator application, created using the
Dining Philosophers pattern, displays messages to the Cloud9 terminal window.
If you saw them, then the program on the emulator earned. To stop the program, click the
Stop icon in the header of the terminal window.
Results
We talked about how to work on the Helix App Cloud cloud platform with the Wind River Rocket operating system. How to connect to the cloud hardware devices using Virtual Gateway, how to use IDE Cloud9. These tools have great potential.
If today you made your first acquaintance with Rocket, then you, having gone from the registration on the site to the flashing Intel Edison LEDs, are quite ready to deal with these possibilities. And after you have mastered enough, you can, for example, start developing programs for
spacecraft .