You can use the Digi Application Development Environment for Linux to develop and launch your first Yocto applications in Digi ConnectCore family products.

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:

1. Install Digi Application Development Environment for Linux

Digi Application Development Environment provides a preconfigured Eclipse instance with all the required plug-ins and features to start creating Digi Embedded Yocto applications. With Digi Application Development Environment, you can:

  • Download and install Digi Embedded Yocto toolchains for different Digi platforms.

  • Create new C/C++ projects.

  • Clone existing Digi Embedded Yocto example applications.

  • Compile C/C++ and example applications using Digi Embedded Yocto toolchains.

  • Remotely launch and debug applications in your development platform.

Requirements

To install Digi Application Development Environment for Linux you need a development machine with at least:

  • Linux 64-bit system (Ubuntu 14.04 or Ubuntu 16.04)

  • 4 CPU cores

  • 4 GB of RAM

  • Free disk space:

    • Development environment: 500 MB for the development environment

    • Digi Embedded Linux toolchain: Between 3 GB and 10 GB, depending on the platform

Follow the steps below to download and install Digi Application Development Environment for Linux.

  1. Download the installer file from: ftp://ftp1.digi.com/support/digiembeddedyocto/eclipse/eclipse-dey-2.4-r3.run.

  2. You must have write permissions in the selected installation path during the installation process. The default directory is /opt/eclipse. Use the install command to create the installation directory with write permissions:

    ~> sudo install -o <your-user> -g <your-group> -d /opt/eclipse
    You can get your primary user and group using the id command.
  3. When the download is complete, double click the *.run file. Follow the steps in the installer Setup Wizard.

    You can also run it using the Linux terminal.

    ~> chmod +x <ADE4Linstaller>.run
    ~> ./<ADE4Linstaller>.run

    A README dialog appears when the installation is complete.

  4. By default, the installer launches an Eclipse instance.

2. Configure Digi Application Development Environment

After the installation, Eclipse is automatically executed. You can also double-click the shortcut on your Desktop. When Eclipse launches, follow these steps to configure it:

  1. Eclipse prompts for a workspace directory. The workspace is the directory for storing projects and configurations. Use the default or browse for a new one, and click Launch.

  2. The first time Eclipse is executed with Digi plug-ins, a popup dialog appears asking you to configure DEY toolchain settings. Click Yes to open the DEY Toolchains preference page.

  3. Click Browse and select the directory where you want to install the new toolchains, which must have write permissions. The default directory is /opt/dey.

  4. Click Download new toolchains. The Install new DEY toolchains dialog opens listing all the available Digi-provided toolchains to install:

  5. Select your device in the Platform drop-down menu to only list the available toolchains for your device.

  6. Select the newest toolchain version, the first toolchain in the list.

  7. Click Install selected. The download and installation process starts and the dialog displays its status. This process can take a while to complete depending on the size of the toolchain.

  8. Once finished, click Close.

  9. The newly installed toolchain is listed in the table. Select it to set as default.

  10. Click Apply and Close to save the changes and close the dialog.

See Install and configure toolchains for more information.

3. Create a "Hello world" application

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

  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.

  4. Type hello_world in the Project name text box.

  5. In the Project type list, expand the Executable category.

  6. Select the Hello World ANSI C Project.

  7. Select DEY Cross GCC from the Toolchains list.

  8. 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 application binary in the Project Explorer view.

  2. Click the Run toolbar button. The Run As dialog opens to select the way the application will be run.

  3. Select DEY C/C++ Remote Application. The Connection dialog opens.

  4. 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.

    4. Select your device. Click OK.

    5. You can also change the default connection name in the Connection Name text box.

    6. Click Finish to create the connection.

  5. 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.

Find the IP of your device

You can find the IP of your device with the ifconfig command. Your device and your host machine must be in the same network.

~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:22:33:22:11 
          inet addr:192.168.42.30  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: fe80::211:22ff:fe33:2211%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1071204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:81475 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:119890110 (114.3 MiB)  TX bytes:16714042 (15.9 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:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1552 (1.5 KiB)  TX bytes:1552 (1.5 KiB)
 
wlan0     Link encap:Ethernet  HWaddr 00:40:9D:8B:FB:47 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:81907 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:3087687 (2.9 MiB)

In this example, the target IP address is 192.168.42.30.

4. Create a sample GPIO application

This tutorial helps you create, build, and launch the Digi APIX GPIO example. This application uses:

  • A GPIO as input: Pin 6 of the GPIO connector (J30). To simulate a button press, connect the pin to GND.

  • A GPIO as output: the User LED on the board.

The application toggles the LED whenever the button is pressed.

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.

4.1. Create the project application

  1. Select File > New > Project to open the New Project wizard.

  2. Select DEY sample project under the C/C++ category.

  3. Click Next. The New DEY sample wizard opens.

  4. Select the Digi APIX GPIO Sample application.

  5. Click Finish to create the project. A new project called apix-gpio-sample appears in the Project Explorer view.

4.2. Build the project

  1. Select the apix-gpio-sample 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 project directory.

4.3. Launch the application

  1. Select the apix-gpio-example application binary in the Project Explorer view.

  2. Click the Run toolbar button. The Run As dialog opens to select the way the application will be run.

  3. Select DEY C/C++ Remote Application. The Connection dialog opens to allow you to select a connection to your device

  4. Select the connection you have already created from the list. Make sure the connection is established prior to running the application.

  5. Click OK. The application is automatically transferred to the device and executed.

4.4. Test the application

  1. When the application is launched, the Terminal view is displayed asking you to press the button of your device.

    [INFO] Testing interrupt blocking mode
    Press the button (for 6 events):
  2. Press the button on the board to toggle the User LED and see the output in the Terminal view.

    [INFO] Testing interrupt blocking mode
    Press the button (for 6 events):
    Press 1; toggling output GPIO
    Press 2; toggling output GPIO
    Press 3; toggling output GPIO
    Press 4; toggling output GPIO
    Press 5; toggling output GPIO
    Press 6; toggling output GPIO
    [INFO] Testing interrupt asynchronous mode
    Parent process will wait until 6 interrupts have been detected
    Parent process: waiting ...
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Input GPIO interrupt detected; toggling output GPIO
    Parent process: no remaining interrupts. Test finished

You can develop your own applications with Eclipse using Digi APIs to access the hardware interfaces available in your device, such as the SPI, I2C, or ADC. See Digi APIx for embedded.

Eclipse with Digi plugins also facilitates the debug process. See Launch remote applications.