In trying to debug I2C usage of BNO055 device, I've sprinkled NRF_LOG_INFO around in my code.
This is Very simple stuff, yet I am seeing erratic behavior of the logging. In this code snippet:
result = imu_init();
nrf_delay_ms(1000);
NRF_LOG_INFO("AAAAAAAA");
u8 chip_id_u8;
s8 errval = bno055_read_chip_id(&chip_id_u8);
// nrf_delay_ms(100);
NRF_LOG_INFO("errval = %d, chipid = %d, ctr=%d", errval, chip_id_u8, ctr++);
// nrf_delay_ms(100);
NRF_LOG_INFO("BBBBBBBBBB");
nrf_delay_ms(100);
NRF_LOG_INFO("CCCCCCCCCC");
====> The code above appears in my main() function, prior to a loop on idle_state_handle();
The output I see is:
1 <info> app: AAAAAAAA
2 <info> app: BNO055_I2C_bus_read err = 0 (from bno055_read_chip_id call)
3 <info> app: errval = 0, chipid = 0, ctr=0
4 <info> app: Temperature: 0 Celsius degrees. (from lower-level code)
5 <info> app: errval = 0, chipid = 0, ctr=0 <===== NOTE THE DUPLICATE OUTPUT
6 <info> app: Temperature: 0 Celsius degrees.
7 <info> app: BBBBBBBBBB
8 <info> app: CCCCCCCCCC
So, I thought perhaps slowing things down a bit might be helpful. Adding delay right after
the bno055_read_chip_id call results in output of Only lines 1-4.
FWIW, I changed the SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN from 16 to 256;
no effect. Anyone have any idea what I might be doing wrong here?
Thanks!