You can use the Digi Application Development Environment for Linux to develop and launch your first Digi Embedded 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.
-
Download the installer file from: https://ftp1.digi.com/support/digiembeddedyocto/eclipse/eclipse-dey-3.2-r3.run.
-
You must have write permissions in the selected installation path during the installation process. The default directory is
/opt/eclipse
. Use theinstall
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. -
When the download is complete, double click the
eclipse-dey-3.2-r3.run
file. Follow the steps in the installer Setup Wizard.You can also run it using the Linux terminal.
$ chmod +x eclipse-dey-3.2-r3.run $ ./eclipse-dey-3.2-r3.run
A README dialog appears when the installation is complete.
-
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:
-
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.
-
The first time Eclipse is executed with Digi plug-ins, a popup dialog appears asking you to configure Digi Embedded Yocto toolchain settings. Click Yes to open the Digi Embedded Yocto Toolchains preference page.
-
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
. -
Click Download new toolchains. The Install new DEY toolchains dialog opens listing all the available Digi-provided toolchains to install:
-
Select your device in the Platform drop-down menu to only list the available toolchains for your device.
-
Select the newest toolchain version, the first toolchain in the list.
-
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.
-
Once finished, click Close.
-
The newly installed toolchain is listed in the table. Select it to set as default.
-
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
-
Select File > New > Project to open the New Project wizard.
-
Select C Project under the C/C++ category.
-
Click Next. The C Project wizard opens.
-
Type hello_world in the Project name text box.
-
In the Project type list, expand the Executable category.
-
Select the Hello World ANSI C Project.
-
Select DEY Cross GCC from the Toolchains list.
-
Click Finish to create the project. The hello_world project appears in the Project Explorer view.
3.2. Build the project
-
Select the hello_world project in the Project Explorer view.
-
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
-
Select the hello_world application binary in the Project Explorer view.
-
Click the Run toolbar button. The Run As dialog opens to select the way the application will be run.
-
Select DEY C/C++ Remote Application. The Connection dialog opens.
-
Select a connection to your device:
-
Click New Connection. The New Connection wizard opens.
-
Select Generic Connection. Click Next.
-
Click Browse to look for devices. The Select Target dialog opens. It lists all the targets in the neighborhood with their corresponding IP.
Your device and your host machine must be in the same network. -
Select your device. Click OK.
-
You can also change the default connection name in the Connection Name text box.
-
Click Finish to create the connection.
-
-
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.
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:40:9D:98:A6:37
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)
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
-
Select File > New > Project to open the New Project wizard.
-
Select DEY sample project under the C/C++ category.
-
Click Next. The New Digi Embedded Yocto sample wizard opens.
-
Select the Digi APIX GPIO Sample application.
-
Click Finish to create the project. A new project called apix-gpio-sample appears in the Project Explorer view.
4.2. Build the project
-
Select the apix-gpio-sample project in the Project Explorer view.
-
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
-
Select the apix-gpio-example application binary in the Project Explorer view.
-
Click the Run toolbar button. The Run As dialog opens to select the way the application will be run.
-
Select DEY C/C++ Remote Application. The Connection dialog opens to allow you to select a connection to your device
-
Select the connection you have already created from the list. Make sure the connection is established prior to running the application.
-
Click OK. The application is automatically transferred to the device and executed.
4.4. Test the application
-
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):
-
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. |