Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    STM32 + BME680 stop running

    STM32 + BME680 stop running

    JohFlo
    Member

    Hi,

    I use a STM32 (Lora-e5 from seeedstudio) and a BME680. I use the standard code and it runs without error until about 70 minutes. Then the hole system stops. I can't find any error (no HardFault, no Reset error).

    As you can see in the 3 runs, the system stops at about 70 minutes

    Run 1:
    timestamp=4285452000000, iaq=52.282635, iaq_accuracy=1, temperature=26.185341, humity=48.137348, pressure=97256.000000, 			raw_temperature=26.250000, raw_humity=47.952000, gas=70242.000000, bsec_status=0, static_iaq=36.917850, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    timestamp=4288453000000, iaq=53.524483, iaq_accuracy=1, temperature=26.185341, humity=48.130924, pressure=97256.000000, 			raw_temperature=26.250000, raw_humity=47.945999, gas=70301.000000, bsec_status=0, static_iaq=37.460327, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    timestamp=4291454000000, iaq=55.823166, iaq_accuracy=1, temperature=26.195341, humity=48.132305, pressure=97256.000000, 			raw_temperature=26.260000, raw_humity=47.970001, gas=70009.000000, bsec_status=0, static_iaq=38.464458, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    timestamp=4294455000000, iaq=58.610989, iaq_accuracy=1, temperature=26.185341, humity=48.141125, pressure=97256.000000, 			raw_temperature=26.250000, raw_humity=47.952000, gas=69778.000000, bsec_status=0, static_iaq=39.682259, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    
    
    Run 2: 
    timestamp=4288458000000, iaq=31.793253, iaq_accuracy=3, temperature=26.065340, humity=55.043007, pressure=97656.000000, 			raw_temperature=26.129999, raw_humity=54.842999, gas=65094.000000, bsec_status=0, static_iaq=30.531034, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    timestamp=4291459000000, iaq=32.244247, iaq_accuracy=3, temperature=26.065340, humity=55.058163, pressure=97658.000000, 			raw_temperature=26.129999, raw_humity=54.855999, gas=65094.000000, bsec_status=0, static_iaq=30.898035, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    timestamp=4294460000000, iaq=32.077911, iaq_accuracy=3, temperature=26.075340, humity=55.057304, pressure=97656.000000, 			raw_temperature=26.139999, raw_humity=54.879002, gas=65245.000000, bsec_status=0, static_iaq=30.762417, co2_equivalent=0.000000, 			breath_voc_equivalent=0.000000
    
    
    Run3:
    timestamp= 4285456000000, iaq=48.260956, iaq_accuracy=3, temperature=25.855341, humity=56.058548, pressure=97780.000000, 			raw_temperature=25.920000, raw_humity=55.867001, gas=69319.000000, bsec_status=0, static_iaq=40.013836, co2_equivalent=560.055359, 			breath_voc_equivalent=0.627387
    timestamp= 4288457000000, iaq=47.317497, iaq_accuracy=3, temperature=25.845341, humity=56.080513, pressure=97780.000000, 			raw_temperature=25.910000, raw_humity=55.858002, gas=69547.000000, bsec_status=0, static_iaq=39.404381, co2_equivalent=557.617554, 			breath_voc_equivalent=0.621634
    timestamp= 4291458000000, iaq=46.868843, iaq_accuracy=3, temperature=25.845341, humity=56.091778, pressure=97780.000000, 			raw_temperature=25.910000, raw_humity=55.870998, gas=69490.000000, bsec_status=0, static_iaq=39.114323, co2_equivalent=556.457275, 			breath_voc_equivalent=0.618914
    timestamp= 4294459000000, iaq=45.965576, iaq_accuracy=3, temperature=25.845341, humity=56.090401, pressure=97780.000000, 			raw_temperature=25.910000, raw_humity=55.870998, gas=69662.000000, bsec_status=0, static_iaq=38.530884, co2_equivalent=554.123535, 			breath_voc_equivalent=0.613479

     

    For me looks like a overflow of an uint32_t but I can't find the problem.

    Some code files are in the attachment.

     

    Johannes

     

    8 REPLIES 8

    Minhwan
    Community Moderator
    Community Moderator

    Hi JohFlo, 

     

    You didn't upload file, but this problem was certainly caused by system time. 

    As you can see that, the your system time is too big. 

    You should check that your time call function and real running time is same. 

    Thanks, 

    Hi,

    thanks for your answer. I use the standard funkction, where timestamp is int64_t.

    Now the files. It seems that the upload of zip files does not work.

    Minhwan
    Community Moderator
    Community Moderator

    Hi JohFlo, 

     

    Thanks for upload. 

    I reviewed your code and here is the one thing. 

    int64_t get_timestamp_us()
    {
        int64_t system_current_time = 0;
        // ...
        // Please insert system specific function to retrieve a timestamp (in microseconds)
        // ...
        system_current_time =(int64_t)(HAL_GetTick()*1000);
        return system_current_time;
    }
    

    Why you multiply 1000 for HAL_GetTick? Is this function nano unit based? 

    Otherwise, your integration was wrong. 

    Please check here. 

    And, if you still have problem, please upload your output log as well. (Problem spot +- 1min)

    Thank you. 

    Hi,

     

    HAL_GetTick provides milliseconds, so I must multiply with 1000.

     

    /**
      * @brief Provides a tick value in millisecond.
      * @note This function is declared as __weak to be overwritten in case of other
      *       implementations in user file.
      * @retval tick value
      */
    __weak uint32_t HAL_GetTick(void)
    {
      return uwTick;
    }

     

    Johannes

    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