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-31-2022 01:38 AM
You faced overflow issue. Since time tick function is 32 bit type, system couldn't generate next call time properly.
Is there any time tick function for 64 bit, then you can fix the issue.
Thanks,
09-01-2022 10:47 AM
Hi,
the tick function should not cause the overflow because it is a uint32_t, which goes to 0 after overflow.
Johannes
09-02-2022 04:54 AM
Yes, if the timefunction back to 0, the next call time and current time would be corrupted.
Therefore, we are using 64bit time function.
Thank you.
09-03-2022 05:27 PM
Problem found and solved.
The Problem was the conversion of HAL_GetTick
(int64_t)(HAL_GetTick()*1000)
mades the error, becaus the multiplication is done first, then the int64_t conversion.
((int64_t)(HAL_GetTick())*1000
works.
Johannes