I recently upgraded PX4 from v1.5.4 to v.1.7.3 and after sensor calibration from QGC, I see some incorrect device IDs.
The correct device ID from v1.5.4 is 4288784 (hex : 00 41 71 10) and I see -264146672 (hex : F0 41 71 10) from v1.7.3. Comparing the hex values it seems incorrect typecasting.
I think it can be a merge issue. So what can be the possible source of this error? Which module or file should I look for?
I found the issue. In DriverFramework/framework/include/DevObj.hpp
struct DeviceStructure {
enum DeviceBusType bus_type : 3;
uint8_t bus: 5; // which instance of the bus type
uint8_t address; // address on the bus (eg. I2C address)
uint8_t devtype; // device class specific device type
};
union DeviceId {
uint32_t dev_id;
struct DeviceStructure dev_id_s;
};
Since the first field of the union DeviceId is not larger it is not zero initialized and hence there is a non-zero byte.