BME680 stops measuring after 1 hour and is stuck in a sleep loop, also IAQ resets using STM32

Hello Bosch-Community,

 

I'm using the reference-code with bme680_task.c which was recommended here for my STM32L4P. After a little more than one hour my BME680 stops blinking, which indicates that it stopped measuring. Analyzing the code, he's stuck in a HAL_Delay. I was wondering if

int64_t time_stamp = 0;
[...]
sleep((uint32_t)time_stamp_interval_ms);

should actually be uint64_t? So far it didn't resolve my issues yet.

Also my IAQ_Accurarcy resets after each transmission via LoRaWAN, though every variable is declared as static and is not reset. Could it be, that  they are also timestamp issues here? It's hard to resolve the issues on it's own when the functions needed are hidden in another libary.

Thank you in advance.

Sincerely

 

Crackl1ng

Best reply by BSTRobin

Hello Crackl1ng,

HAL_Delay was a delay funtion. You could change you code to this and try it again.

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

View original
3 replies
Resolved