Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Compiling and testing BME680 on Custom hardware based on STM32MP157C (Cortex A7 - armv7-a)

    New Poster

    Compiling and testing BME680 on Custom hardware based on STM32MP157C (Cortex A7 - armv7-a)

    The device is running 4.19 Kernel and it supports bme680 kernel driver , i have added defconfig  entries to build the driver 

     

    CONFIG_BME680=m
    CONFIG_BME680_SPI=m

     


    https://github.com/STMicroelectronics/linux/tree/v4.19-stm32mp/drivers/iio/chemical

    How do i check the driver is functioning properly in runtime , dmesg did not show any probe success log for bme680.
    Need help Cross compiling userspace library for  STM32MP157C ,
    Toolchain can be found in STM SDK

    command to cross compile a normal c file
    /SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gcc -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/SDK/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi spi-led_duty_off.c -o spi-led_duty_off

    export AR=/SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-ar
    export CC=/SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gcc
    export CXX=/SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-g++

    The device is running linux distribution ST OpenSTLinux - Weston - (A Yocto Project Based Distro).

    How can i compile userspace application and test the response from the sensor.

    Please help!

    Thank you
    Sooraj

    3 REPLIES 3
    Highlighted
    Community Moderator

    Re: Compiling and testing BME680 on Custom hardware based on STM32MP157C (Cortex A7 - armv7-a)

    I am not very familar with ST OpenSTLinux, would you be able to confirm whether this platform would support any of our standard compilers typ. use in bare metal (e.g. GCC or ARMCC)? There is for example here another release for the A7 too, but using the standard GNU Arm Embedded Toolchain.

    Otherwise we would need to evaluate and implement this toolchain, which if possible to use could take significantly more time.

    Highlighted
    New Poster

    Re: Compiling and testing BME680 on Custom hardware based on STM32MP157C (Cortex A7 - armv7-a)

    I am not sure about compiler type but here is some info on compiler

     

     

    /SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gcc -v
    Using built-in specs.
    COLLECT_GCC=/home/ssd/STM/Stinger96/STM32MP15-Ecosystem-v1.0.0/Developer-Package/SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gcc
    COLLECT_LTO_WRAPPER=/home/ssd/STM/Stinger96/STM32MP15-Ecosystem-v1.0.0/Developer-Package/SDK/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi/../../libexec/arm-openstlinux_weston-linux-gnueabi/gcc/arm-openstlinux_weston-linux-gnueabi/8.2.0/lto-wrapper
    Target: arm-openstlinux_weston-linux-gnueabi
    Configured with: ../../../../../../work-shared/gcc-8.2.0-r0/gcc-8.2.0/configure --build=x86_64-linux --host=x86_64-openstlinux_weston_sdk-linux --target=arm-openstlinux_weston-linux-gnueabi --prefix=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr --exec_prefix=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr --bindir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi --sbindir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/bin/arm-openstlinux_weston-linux-gnueabi --libexecdir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/libexec/arm-openstlinux_weston-linux-gnueabi --datadir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/share --sysconfdir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/etc --sharedstatedir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/com --localstatedir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/var --libdir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/lib/arm-openstlinux_weston-linux-gnueabi --includedir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/include --oldincludedir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/include --infodir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/share/info --mandir=/opt/st/stm32mp1/2.6-openstlinux-4.19-thud-mp1-19-10-09/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/opt/STM/workspace/workdir/openstlinux/build-stm32mp1/tmp-glibc/work/x86_64-nativesdk-openstlinux_weston_sdk-linux/gcc-cross-canadian-arm/8.2.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-openstlinux_weston-linux-gnueabi- --without-local-prefix --enable-lto --disable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/8.2.0 --with-build-time-tools=/opt/STM/workspace/workdir/openstlinux/build-stm32mp1/tmp-glibc/work/x86_64-nativesdk-openstlinux_weston_sdk-linux/gcc-cross-canadian-arm/8.2.0-r0/recipe-sysroot-native/usr/arm-openstlinux_weston-linux-gnueabi/bin --with-sysroot=/not/exist --with-build-sysroot=/opt/STM/workspace/workdir/openstlinux/build-stm32mp1/tmp-glibc/work/x86_64-nativesdk-openstlinux_weston_sdk-linux/gcc-cross-canadian-arm/8.2.0-r0/recipe-sysroot --without-long-double-128 libgcc_cv_powerpc_float128=no --enable-poison-system-directories --disable-static --enable-nls --enable-initfini-array
    Thread model: posix
    gcc version 8.2.0 (GCC)

    I was able to download ,just to be sure i have downloaded the right file

    BSEC_1.4.7.4_azure_SDK_20191217.zip

    How do i use/execute the file libalgobsec.a ?
    I could not find example code or steps to compile , please advise .

    Highlighted
    Community Moderator

    Re: Compiling and testing BME680 on Custom hardware based on STM32MP157C (Cortex A7 - armv7-a)

    The version you linked was made for a different platform (esp. a different compiler, that comes with the Azure SDK, gcc-arm-linux-eabi-hf). I was thinking about the release 'BSEC_1.4.7.4_Cortex-A7_with_fPIC.zip', that was built to run on bare metal A7 (gcc-arm-none-eabi). Another alternative for your MCU would be to run BSEC in the M4 core of your MCU, that should be compatible with the binaries from the standard BSEC package on our website.

    I will forward the request internally whether we can support your specific platform (arm-openstlinux_weston-linux-gnueabi-gcc), but be aware that deploying BSEC on a new platform can take up to several weeks.

    EDIT: I also just realized that in your initial post your were not able to successfully communicate with the BME680. Unless you are using  our BME680 sensor API, I would recommend that you get platform-specific support from your driver provider.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist