Hi everyone,

I just found a very strage bug and would like to confirm that this is a bug and if someone can explain/fix this. I read the time from the USRP using get_time_now() and do a lot of stuff with it. Mainly to time commands like frequency hopping and starting of streams. I noticed that the time in the USRP seemed to run slower than expected, actually by a factor of two. Please find a program attached that demonstrates this effect. It prints the internal USRP time roughly every second (using sleep) but the USRP time increments only by 0.5 seconds in each step. What is going on?

The program can be compiled using:
g++ -std=c++14 -O2 main.cpp -luhd -lboost_system -o main

I am using a single (or multiple - does not have an effect) X310 with two TwinRX. UHD is "linux; GNU C++ version 5.5.0 20171010; Boost_105800; UHD_3.15.0.git-89-gf93c5227" from yesterday. FPGA image is also from yesterday using the download script - where can I find the version number? I am running an up-to-date Ubuntu 16.04.
--
--------------------------------------------------
M.-Sc. Fabian Schwartau
Technische Universität Braunschweig
Institut für Hochfrequenztechnik
Schleinitzstr. 22
38106 Braunschweig
Germany

Tel.:   +49-(0)531-391-2017
Fax:    +49-(0)531-391-2045
Email:  fabian.schwar...@ihf.tu-bs.de
WWW:    http://www.tu-braunschweig.de/ihf
--------------------------------------------------

// g++ -std=c++14 -O2 main.cpp -luhd -lboost_system -o main

#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/utils/thread.hpp>
#include <iostream>

using namespace std;

int UHD_SAFE_MAIN(int, char*[])
{
    uhd::set_thread_priority_safe();

    // Init USRP
    std::string args = "addr0=192.168.41.2";
    uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);

    for(int i = 0; i < 10; i++)
    {
        cout<<usrp->get_time_now().get_real_secs()<<endl;
        sleep(1);
    }

    return 0;
}

_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to