08-30-2022 08:45 PM
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
Solved! Go to Solution.
08-30-2022 09:37 PM
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,
08-30-2022 10:20 PM
08-30-2022 10:55 PM
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.
08-30-2022 11:06 PM
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