Hi Marcus,

In the app I'm writing, for now I'm just setting the time to '0.0' after 
startup, like:
   usrp->set_time_now(uhd::time_spec_t(0.0));

For the "test_timed_commands.cpp" test app, I'm just executing what is here:
https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpp

It doesn't appear to matter, but my E320 is setup to use an internal reference, 
the N320 is external.

Thanks,
Jim


________________________________
From: Marcus D. Leech <patchvonbr...@gmail.com>
Sent: Tuesday, February 1, 2022 1:59 PM
To: usrp-users@lists.ettus.com <usrp-users@lists.ettus.com>
Subject: [USRP-users] Re: Timed Commands Not Working

On 2022-02-01 13:55, Jim Palladino wrote:
Hello,

I've been trying to get an app working with timed commands for an E320 or N320 
using UHD 4.1. It seems that all commands are processed immediately, not at the 
time I tell them to. Setting the time to start RX streaming does seem to work 
fine, but that is a time_spec passed to the streaming function -- not a "timed 
command".

If, on the other hand, I use timed commands to set a series of RX frequency 
tunes in the future -- to retune says every 100ms -- that isn't working. All 
retunes get processed immediately, one after another, with no 100ms gap in 
between. I would post the code I'm using here, but I went ahead and ran the 
UHD-included "test_timed_commands" example on both the E320 and N320. The 
example application does not seem to work right on either device and exhibits 
the same behaviour I'm seeing with my code. You can see from the results below, 
that instead of a 100ms gap between get_time_now() calls, as the example app is 
setup to do, the calls to get_time_now() return immediately.

Here is the output of "test_timed_commands" on the N320. The code is unmodified 
from the provided example source:
--------------------------------
$ ./test_timed_commands

Creating the usrp device with: ...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: 
mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2
[INFO] [MPM.PeriphManager] init() called with device args 
`fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'.
[INFO] [MPM.Rhodium-0] init() called with args 
`fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
[INFO] [MPM.Rhodium-1] init() called with args 
`fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
Using Device: Single USRP:
  Device: N300-Series Device
  Mboard 0: n320
  RX Channel: 0
    RX DSP: 0
    RX Dboard: A
    RX Subdev: Rhodium
  RX Channel: 1
    RX DSP: 1
    RX Dboard: B
    RX Subdev: Rhodium
  TX Channel: 0
    TX DSP: 0
    TX Dboard: A
    TX Subdev: Rhodium
  TX Channel: 1
    TX DSP: 1
    TX Dboard: B
    TX Subdev: Rhodium


Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
 Difference between paired reads: 2016.288086 us

Testing control timed command:
 Span      : 100000.000000 us
 Now       : 416299.532064 us
 Response 1: 418303.910319 us
 Response 2: 420352.290853 us
 Difference of response time 1: -97995.621745 us
 Difference of response time 2: -195947.241211 us
 Difference between actual and expected time delta: -97951.619466 us

About to start streaming using timed command:
 Received packet: 100 samples, 0 full secs, 0.524535 frac secs
 Stream time was: 0 full secs, 0.524535 frac secs
 Difference between stream time and first packet: 0.000000 us

Done!
---------------------------------------------------

Any thoughts on this would be appreciated, as timed commands are important to 
the application we are developing.

Thanks,
Jim



How are you setting device time at startup?


_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to