Open jliphard opened 7 years ago
always freezes around TH = 288.
might be related to memory consumption / memory leak somewhere....
Problem caused by repeated call of BME280_Read_PTH(&resultPTH_1[0]);
something in the underlying TWI/I2C bus....
void readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest) { ret_code_t err_code = 0; //0xF7 to 0xFE (temperature, pressure and humidity) //readBytes(BME280_ADDRESS_1, BME280_PRESS_MSB, 9, &rawData[0]);
m_xfer_done = false;
err_code = nrf_drv_twi_tx(&i2c, address, subAddress, 1, true);
while (m_xfer_done == false) {};
//comes back with error code
//SEGGER_RTT_printf(0, "ReadBytes code: %d\n", err_code);
//here is the problem????
//APP_ERROR_CHECK(err_code);
if (err_code == NRF_SUCCESS)
{
m_xfer_done = false;
//NRF_LOG_DEBUG("readBytes - Reading\r\n");
err_code = nrf_drv_twi_rx(&i2c, address, dest, count);
//SEGGER_RTT_printf(0, "ReadBytes RX code: %d\n", err_code);
//APP_ERROR_CHECK(err_code);
while (m_xfer_done == false) {};
};
//NRF_LOG_DEBUG("readBytes done\r\n");
//NRF_LOG_FLUSH();
}
disabling this cures the problem.... err_code = nrf_drv_twi_rx(&i2c, address, dest, count);
resolved - was RTC1 issue.
Issue not related to either FLASH or ADC. Issue not related to time, since when you slow down the timer, it still freezes after same number of cycles *Might be related to NRF_LOG_DEBUG output, which freezes things after a certain number of characters have been sent to the JLinkRTTClient