Hello,
I have interfaced MPU accelerometer on i2c and GPS on UART. Have enabled UART and using printf to display both sensor data. To begin with, both work fine individually. On clubbing them together, the console hangs after 15secs approx. Upon debugging, I found that the program is ending up in a hardfault handler. What might be causing the issue here? How can I proceed with further debugging?
Please find the code snippet attached herewith.
while (true) { //Read accel data accel_mpu_data_read(); //Read GPS data from UART gps_data_read(); nrf_delay_ms(200); }
accel_mpu_data_read() - Read accel values from MPU 9250 and print.
gps_data_read() - Read GPS data comming from UART RX, store it in a buffer until '\r' is read and then print the line.