Show Contents

# 3. Create a "Hello world" application

This tutorial demonstrates how to create and launch your first application on your device using Eclipse and Digi plug-ins.

Before starting development for your ConnectCore platform, make sure your device is correctly connected, powered, and running. See Step 2: Set up the hardware and Step 3: Program the Yocto firmware.

Once your device is ready for development, follow these steps:

- 3.1. Create the project
- 3.2. Build the project
- 3.3. Launch the application

## 3.1. Create the project

1. Select File > New > Project to open the New Project wizard
2. Select C Project under the C/C++ category.
3. Click Next. The C Project wizard opens.

1. Type hello_world in the Project name text box.
2. In the Project type list, expand the Executable category.
3. Select the Hello World ANSI C Project.
4. Select DEY Cross GCC from the Toolchains list.
5. Click Finish to create the project.
   The hello_world project appears in the Project Explorer view.

## 3.2. Build the project

1. Select the hello_world project in the Project Explorer view.
2. Click the Build Active Configuration toolbar button .
   The build output appears in the Console view. The application binary is generated inside the Debug project directory.

## 3.3. Launch the application

1. Select the hello_world project in the Project Explorer view.
2. Right click and select Run As > DEY C/C++ Remote Application from the context menu. The Connection dialog opens.
3. Select a connection to your device:
   1. Click New Connection. The New Connection wizard opens.
   2. Select Generic Connection. Click Next.
   3. Click Browse to look for devices. The Select Target dialog opens. It lists all the targets in the neighborhood with their corresponding IP.

   > > How to find the IP of your device

   > > Find the IP of your device with the ifconfig command:

   > >     root@ccimx6ulsbc:~# ifconfig
   > >     eth0      Link encap:Ethernet  HWaddr 00:40:9D:98:A6:37
   > >               UP BROADCAST MULTICAST  MTU:1500  Metric:1
   > >               RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   > >               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
   > >               collisions:0 txqueuelen:1000
   > >               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

   > >     eth1      Link encap:Ethernet  HWaddr 00:40:9D:98:A6:36
   > >               inet addr:192.168.42.30  Bcast:10.101.2.255  Mask:255.255.255.0
   > >               inet6 addr: fe80::240:9dff:fe98:a636%lo/64 Scope:Link
   > >               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   > >               RX packets:1360759 errors:0 dropped:0 overruns:0 frame:0
   > >               TX packets:172594 errors:0 dropped:0 overruns:0 carrier:0
   > >               collisions:0 txqueuelen:1000
   > >               RX bytes:163158464 (155.5 MiB)  TX bytes:29408643 (28.0 MiB)

   > >     lo        Link encap:Local Loopback
   > >               inet addr:127.0.0.1  Mask:255.0.0.0
   > >               inet6 addr: ::1%1/128 Scope:Host
   > >               UP LOOPBACK RUNNING  MTU:65536  Metric:1
   > >               RX packets:22 errors:0 dropped:0 overruns:0 frame:0
   > >               TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
   > >               collisions:0 txqueuelen:1
   > >               RX bytes:1581 (1.5 KiB)  TX bytes:1581 (1.5 KiB)

   > >     wlan0     Link encap:Ethernet  HWaddr 00:40:9D:98:A6:38
   > >               UP BROADCAST MULTICAST  MTU:1500  Metric:1
   > >               RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   > >               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
   > >               collisions:0 txqueuelen:1000
   > >               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

   > >     wlan1     Link encap:Ethernet  HWaddr 02:03:7F:D7:00:01
   > >               inet addr:192.168.46.30  Bcast:192.168.46.255  Mask:255.255.255.0
   > >               inet6 addr: fe80::3:7fff:fed7:1%lo/64 Scope:Link
   > >               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   > >               RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   > >               TX packets:21770 errors:0 dropped:3 overruns:0 carrier:0
   > >               collisions:0 txqueuelen:1000
   > >               RX bytes:0 (0.0 B)  TX bytes:6312817 (6.0 MiB)

   > > In this example, the target IP address is 192.168.42.30.

   > > Note Your device and your host machine must be in the same network.

   1. Select your device. Click OK.
   2. You can also change the default connection name in the Connection Name text box.
   3. Click Finish to create the connection.
4. Select the new created connection and click OK.
   The application is automatically transferred to the device and executed.
   When the application is launched, the Terminal view displays the "Hello world" message.

You have successfully created and executed a Hello World application in your ConnectCore device. Follow the next steps to create another application to interact with your hardware.

© 2018 Digi International Inc. All rights reserved.
3. Create a "Hello world" application updated on 24 January 2018 10:24:40 AM