In the AP_GPS.cpp there is a loop in detect_instance with the condition of:
while (initblob_state[instance].remaining == 0 && _port[instance]->available() > 0
&& new_gps == nullptr) {
Currently have 2 GPS connected to a navio2 board but it never seems to be able to GPSX_RAW from both at the same time. It currently only gets data from only the one which is set as the primary. e.g. If GPS_PRIMARY is set to 0. Only GPS_RAW will have data and GPS2_RAW will be all 0 (as if it were never initialised.)
When I started debugging the code I see that:
-initblob_state[instance].remaining is 97
-_port[instance]->available() is 0
-new_gps is 0x0
Therefore, we will never enter the loop to initialise another GPS. It jumps down to “found_gps” and since new_gps is still 0x0 it will exit, never initialising a GPS.