EttusResearch / uhd

The USRP™ Hardware Driver Repository
http://uhd.ettus.com
Other
942 stars 644 forks source link

USRP E312 No GPSDO Clock Source #727

Closed fwilliams42 closed 4 months ago

fwilliams42 commented 4 months ago

Issue Description

We have multiple USRP E312s intended to be synchronised via GPSDO. However, none of them are able to set the clock source to GPSDO, only the time source. Therefore building examples such as sync_to_gps fails at runtime with the GPSDO clock source, and GNURadio blocks cannot select GPSDO as a clock source. GPS time tags in GNURadio are wildly inaccurate while the gpsmon utility shows them correctly.

Using the devices in GNURadio with sync on next PPS as GPSDO and time source GPSDO with clock source as internal (only option that doesn't fail) the initial time tag for two E312s connected to the same network switch running in the same block diagram emitted UTC time differing by over 125 seconds. SSH'ing into the devices simultaneously and running gpsmon shows the GPS time synced correctly however.

The combination of these issues means we cannot synchronise the devices via GPS as intended.

Setup Details

Tested using UHD 4.4.0.0 and UHD-4.6 on two separate USRP E312s with both the SD card and FPGA images updated using the UHD utilities. Devices are connected to a network switch also connected to a desktop computer. Devices are outside in clear view with active GPS receivers on the GPS ports of the device. Desktop is running Ubuntu 22.04 LTS with matching version of UHD installed. GNURadio is built after UHD.

Expected Behavior

uhd_usrp_probe should show GPSDO as a valid clock source. The E312s should allow GPSDO to be set as the clock source. The GNURadio UHD Source block should have 2 devices emit GPS times very close to each other (< 100ns) in the initial tag.

Actual Behaviour

uhd_usrp_probe lists only internal as a valid option for clock source, while it lists GPSDO as a timing source and gps_time as a sensor.

When running uhd_usrp_probe:

 Mboard: ni-e31x-3284A0D
|   |   dboard_0_pid: 272
|   |   dboard_0_serial: 32828AA
|   |   fs_version: 20231113194348
|   |   mender_artifact: v4.6.0.0_e310_sg3
|   |   mpm_sw_version: 4.6.0.0-g50fa3baa
|   |   pid: 30675
|   |   product: e310_sg3
|   |   rev: 9
|   |   rpc_connection: remote
|   |   serial: 3284A0D
|   |   type: e3xx
|   |   MPM Version: 5.3
|   |   FPGA Version: 6.1
|   |   FPGA git hash: 6a990d9.clean
|   |   RFNoC capable: Yes
|   |   
|   |   Time sources:  internal, external, gpsdo
|   |   Clock sources: internal
|   |   Sensors: ref_locked, gps_locked, temp_fpga, temp_mb, gps_gpgga, gps_sky, gps_time, gps_tpv

When running sync_to_gps:

Synchronizing mboard 0: e310_sg3
[ERROR] [RPC] Cannot set to invalid clock source: gpsdo

Error: RuntimeError: Error during RPC call to `set_clock_source'. Error message: Cannot set to invalid clock source: gpsdo
This could mean that you have not installed the GPSDO correctly.

However, the GPSDO is in-built into the E312s and there is no guidance to modify them to enable GPSDO.

Steps to reproduce the problem

Connect a USRP E312 updated to UHD-4.6 SD and FPGA images to host computer also running the same version of UHD. Run usrp_probe_device and observe.

Connect 2 USRP E312s into a GNURadio flowgraph with a head block and time sink to view the initial tags being wildly incorrect (devices UTC time should not be off by minutes). Use gpsmon on the devices to observe that the raw devices seem to be correctly synchronised to the same time as each other.