discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] USRP control thread in GR block - how do I pass a


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] USRP control thread in GR block - how do I pass a USRP sptr?
Date: Thu, 4 Feb 2016 20:47:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hi Andy,

On 04.02.2016 20:32, Andy Walls wrote:
> On Thu, 2016-02-04 at 17:53 +0000, Nowlan, Sean wrote:
>
>> Thanks, Andy. I haven't yet encountered any issues from initializing
>> USRP settings (freq/gain/antenna/etc.) from "main" thread and polling
>> PPS from another thread,
> Neither have I.  (FWIW, I poll the GPSDO NMEA strings and USRP timestamp
> synchronized to the USRP PPS output pulse provided to the host's serial
> port DCD line at RS-232 levels.)
It's probably OK, but: There's no guarantees what will happen if thread
A (main) writes to a specific device register, e.g. to read back
something from the USRP in the next call, and then thread B (e.g. the
thread in which the usrp_sink block runs in) simultaneously reads
something from the device.
This is multithreading with external hardware; be vary, here be race
conditions.
>
>>  since the polling thread doesn't actually start until the main thread
>> calls "start" on my OOT block until after it's finished configuring
>> the USRP at startup.
> Ah, smarter than what I did.  My block's polling thread just waits 1
> second at startup, and then drops into a loop around a
> blocking ::time_pps_fetch() call.
>
>> Regarding the order of instantiation, I should update what I said
>> about the USRP block alias: Under the USRP Sink config settings in
>> GRC, the user can set the block alias under the Advanced tab.
> OK, I never noticed that.
:) forgot about that completely!
>
> -Andy
>
>>  I set this to the same value as what I pass to my OOT block:
>>
>> // gr-my-oot/include/my-oot/clock_manager.h
>> class MY_OOT_API clock_manager : virtual public gr::block
>> {
>> …
>> public:
>>     static sptr make(const std::string &usrp_alias);
>> …
>> }
>>
>>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]