BMI160 Error due to libiio Component

I am facing the following error for BMI160 program…

my .cdef file looks like this…

Required libiio component is in the below mention location…

Please help me, how to link that component in .cdef file to avoid the error…

Thanks,
Raj

Your screenshot is somewhat truncated, but I I think the problem is that the MANGOH_ROOT environment variable is not defined. I’m not a dev studio user, so I’m not sure how to resolve the problem in that context.

@dfrey
This is the error line

Description Resource Path Location Type
Legato builder: ** ERROR: /home/mangoh/devstudio-5.3.1-linux64/workspace/RajFifoRead/RajFifoReadComponent/Component.cdef:10:7: error: Couldn’t find component ‘/components/libiioComponent’. RajFifoRead C/C++ Problem

Please suggest me, how to declare the environment variable in dev studio
OR
Just tell me the step by step procedure to run the below link program without error. As i am new to this MangOH


As it is designed by you.

Thanks

Hi @rajmohans

you should be able to specify the MANGOH_ROOT variable through Right-click menu on the project > Properties > C/C++ Build > Environment

@daav
Thank you sir…
Error is resolved with your previous post… $CURDIR

Still i don’t know, how to declare MANGOH_ROOT in Environment.
@dfrey @daav But i am having one more problem…
I am getting receipt for target failed… Please help me resolve that issue… Thanks

Hi @rajmohans

Please share the content of the Console view with the full build log; will probably be easier to troubleshoot.

HI @daav,
Thanks for the reply,

Here is the content of console view,

 15:30:53 **** Incremental Build of configuration Target_Legato_Debug for project RajFifoRead ****

make -C Target_Legato_Debug all
make: Entering directory ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/RajFifoRead/Target_Legato_Debug’
cd …;mkapp -t wp77xx -o Target_Legato_Debug -w Target_Legato_Debug -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/wifi” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/portService” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/logDaemon” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/airVantage/legacy” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/airVantage” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/atServices” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/modemServices” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/secureStorage” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/supervisor” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/positioning” -i “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/interfaces/watchdog” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/assetDataTest” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/dataConnectionService/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/suspendResume” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/timeseries” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/test/watchdogChain” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/airVantage” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/modules/WiFi/apps/tools/wifi” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/positioning” -s “RajFifoReadComponent” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/secStore” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/portService” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/uartMode/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/modemServices/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/avcIntegrationTest” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/audio/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/3rdParty” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/tools” -s “.” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/assetPush” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/fwupdate/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/airVantageConnectorUnitTest” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/dataConnectionService” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/modules/WiFi/service” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/airVantage/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/fwupdate” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/session” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/positioning/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/avDataUnitTest” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/devMode” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/secStore/platformAdaptor/default” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/mqttClient” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/modemServices” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/atServices” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/components/uartMode” -s “/home/mangoh/legato/packages/com.swi.spm.legato.framework.0.0.0.4c5ec1a6-03c6-45f5-bfd7-d4a92832fda4/resources/legato/apps/platformServices/airVantageConnector/apps/test/packageDownloadHost” -C -g -X -g -L -g RajFifoRead.adef
[1/9] Compiling C source
[2/9] Compiling C source
[3/9] Compiling C source
[4/9] Linking C library
FAILED: Target_Legato_Debug/staging/read-only/lib/libComponent_RajFifoReadComponent.so
/home/mangoh/legato/packages/legato.toolchain.0.18.5.00.SWI9X06Y_02180500-wp77xx-native-x86_64-201808171525/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/mangoh/legato/packages/legato.toolchain.0.18.5.00.SWI9X06Y_02180500-wp77xx-native-x86_64-201808171525/resources/native/sysroots/armv7a-neon-poky-linux-gnueabi -shared -o Target_Legato_Debug/staging/read-only/lib/libComponent_RajFifoReadComponent.so Target_Legato_Debug/component/b2935a8110502ef2b8a91aea1ad841bd/obj/b28adcc05891cf724b1c33a293e1d15e.o Target_Legato_Debug/component/b2935a8110502ef2b8a91aea1ad841bd/obj/_componentMain.c.o -g -liio -liio -liio -LTarget_Legato_Debug/staging/read-only/lib -Wl,–enable-new-dtags,-rpath="$ORIGIN/…/lib" “-L$LEGATO_BUILD/framework/lib” -llegato -lpthread -lrt -lm
/home/mangoh/legato/packages/legato.toolchain.0.18.5.00.SWI9X06Y_02180500-wp77xx-native-x86_64-201808171525/resources/native/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -liio
/home/mangoh/legato/packages/legato.toolchain.0.18.5.00.SWI9X06Y_02180500-wp77xx-native-x86_64-201808171525/resources/native/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -liio
/home/mangoh/legato/packages/legato.toolchain.0.18.5.00.SWI9X06Y_02180500-wp77xx-native-x86_64-201808171525/resources/native/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -liio
make: *** [target] Error 1
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Makefile:37: recipe for target ‘target’ failed
make: Leaving directory ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/RajFifoRead/Target_Legato_Debug’

15:30:57 Build Finished (took 4s.219ms)

According to the libiio component CDEF (https://github.com/mangOH/mangOH/blob/master/components/libiioComponent/Component.cdef), I wonder if you shouldn’t need to:

  • define the MANGOH_BOARD var in the project settings (like explained above)
  • add a linker setting to point to the location where the lib is built by the external build statement (e.g. an ldflags with a -L option pointing to ${MANGOH_ROOT}/build/${MANGOH_BOARD}_${LEGATO_TARGET}/libs)
    This lib path is probably contributed by the main MangOH Makefile when building through CLI, but if you want to use a DS project (which doesn’t use the main Makefile), you need to tweak a bit…

I am trying to use FIFO read. Though I am able to build and install the app in the mangOH red device. The application crashes because of assertion after calling iio_create_local_context().

Please help!!

Regards,
Devaiah

I found the issue. But now I am unable to find BMI160