Building EdgeApp

Building for the CTEC Target

  1. Extract the SDK contents.
    Linux: tar -xvf CTEA_SDK-.tar.gz
    Windows: Use Windows tools to unzip CTEA_SDK-.zip

  2. Change directories to the SDK root.
    cd CTEA

  3. Create a build directory.
    mkdir debug

  4. Move to the build directory.
    cd debug

  5. Create the build environment.
    Linux: cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Toolchain-arm-oe-linux-gnueabi.cmake ..
    Windows: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../Toolchain-armv7m-none-eabi.cmake ..

  6. Customize EdgeApp.
    make menuconfig
    642

  7. Select the LMU build target by pressing Space Bar or Enter when “LMU build target” is selected. Use the arrow keys to select the appropriate device and press Enter to select the build target and return. Note that LMU3040 and LMU3240 will not build in a Windows environment and LMU3040m will not build in a Linux environment.
    644

  8. Use the arrow keys to highlight “EdgeApp version…” and press Enter. Type an appropriate version up to seven characters and press Enter.
    642

  9. Use the arrow keys to highlight “EdgeApp name…” and press Enter. Enter an appropriate EdgeApp name up to 15 characters.
    643

  10. Use the arrow keys to highlight “CalAmp Components”. Press Enter twice to select this group and display available CalAmp components. Select or deselect desired components.
    642

  11. Press Esc to exit the CalAmp Components menu. Note that if the C-Script or HA translator components are selected, additional menus become available in the main menu.
    642

  12. Use the arrow keys to highlight “Example Components”. Press Enter twice to select this group and view the available components. Select or deselect components as needed.
    642

  13. Press Esc to exit the Example Components menu.

  14. Use the arrow keys to highlight “Customer Components”. Press Enter twice to select this group and view the available components. Note that by default there are no customer components created and group won’t open. Once a customer component is created, this menu will open.
    642

  15. Press Esc to exit the Customer Components menu.

  16. If the C-Script CalAmp component was selected, use the arrow keys to highlight “C-Scripts”. Press enter once to display the currently selected C-Script.
    642

  17. Press enter a second time to display all available scripts. Use the arrow keys to select the appropriate script and press Enter. Note that only one script may be selected.
    642

  18. Press Esc to return to exit the C-Scripts menu.

  19. If the HA Translator CalAmp component was selected, use the arrow keys to select “HA-Apps”. Press enter once to display the currently selected HA App.
    642

  20. Press ‘q' to quit and, when prompted, 'Y’ to save configuration.

  21. Compile the EdgeApp.
    make

  22. Generate the final binary image.
    make image

    Creating a New Component

  23. Move to the template directory.
    cd source/components/src/cust_comp/template

  24. Create a new component from the template.
    Linux: ./create_new_comp.sh <some_cmp>
    Windows: create_new_comp.sh <some_cmp>

  25. Change directories to the new component root.
    cd ../src/cust_comp/<some_cmp>

  26. Get a license file from Customer Support.

  27. Put the license file in the include directory of the new component.

  28. Edit the Kconfig file and update the full, default name in the second line, if desired.
    vi ./Kconfig

  29. Refer to “Building for the CTEC Target” for steps on building in the new component.

    Creating a New C-Script

  30. Move to the template directory.
    cd source/externals/src/csript/cust_cscript/template

  31. Create a new C-Script from the template.
    ./create_new_cscript.sh <new_name>

  32. Move to the debug directory.
    cd ../../../../../../debug

  33. Start menuconfig.
    make menuconfig

  34. Use the arrow keys to select CalAmp Components and press Enter twice.
    644

  35. Use the arrow keys to select the CalAmp C-Script Component and press Enter.
    645

  36. Press Esc to exit the CalAmp Components menu.

  37. Use the arrow keys to select C-Scripts and press Enter twice.
    644

  38. Use the arrow keys to select the new C-Script and press Enter. In this example, the “new” script is called myscript.
    644

  39. Press ‘q' to quit and, when prompted, 'Y’ to save configuration.

  40. Compile the EdgeApp.
    make

    Adding a 32-bit Hosted App

  41. Move to the ha32_app directory.
    cd source/externals/src/ha32_app

  42. Copy the 32-bit Hosted App folder into the ha32_app.

  43. Run the integrate_ha script using the folder name of the 32-bit Hosted App that was just copied.
    ./integrate_ha <folder_name>

  44. Move to the debug directory.
    cd ../../../../debug

  45. Start menuconfig.
    make menuconfig
    644

  46. Use the arrow keys to select the CalAmp HA Translator.
    644

  47. Press Esc to exit the CalAmp Components menu.

  48. Use the arrow keys to select HA-apps and press Enter twice.
    644

  49. Use the arrow keys to select the new Hosted app and press Enter. In this example, the “new” Hosted App is called myHa.
    645

  50. Press ‘q' to quit and, when prompted, 'Y’ to save configuration.

  51. Compile the EdgeApp.
    make

    Running Clang Static Analyzer (Linux only)

  1. Change directories to the SDK root.
    cd CTEA

  2. Create a debug directory.
    mkdir debug

  3. Move to the debug directory.
    cd debug

  4. Create the build environment
    cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Toolchain-arm-oe-linux-gnueabi.cmake ..

  5. Select components for static analysis.
    make menuconfig

  6. Move to SDK root directory.
    cd ..

  7. Create a static build directory.
    mkdir static_debug

  8. Copy component selections.
    cp debug/.config static_debug/

  9. Move to the build directory.
    cd static_debug

  10. Create the build environment.
    scan-build-6.0 cmake -DRUN_CLANG_STATIC_ANALYZER=1 -DAPP_ID=1001 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Toolchain-arm-oe-linux-gnueabi.cmake ..

  11. Run the static analyzer.
    scan-build-6.0 -o scan_build -enable-checker alpha -disable-checker alpha.clone.CloneChecker --keep-going --use-cc=/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc --use-c++=/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++ make_

    Formatting the Source Code with Astyle

  1. Change directories to the debug directory
    cd debug

  2. Format the source code
    make astyle

    Creating Documentation with Doxygen

  1. Change directories to the debug directory
    cd debug

  2. Generate documentation for custom components
    make doc

    Sideload EdgeApp to Linux Target

  3. Change directories to the debug directory
    cd debug

  4. Deploy image to target and install
    make deploy

  5. When prompted (twice), enter the password
    welcome123

    Sideload EdgeApp to RTOS Target

  6. Open a TeraTerm (or other terminal program) session to the USB Serial Port for the LMU3040m.

  7. If required, enter the device password.
    at$pw <device_password>

  8. Enter the download command.
    at$app fdnldser

  9. From the TeraTerm File menu, select Transfer, YMODEM, then Send…

  10. Browse to select the EdgeApp image.

  11. After the download is complete, program the image.
    at$app frog 3 0

  12. To start the EdgeApp, reset the device.
    atreset


Did this page help you?