Hi again,

We have written a small example that triggers this error (see the attached 
files). From what we have figured out so far, the error arise from the result 
of the p->wait_for_completion command in the transmit_cmd_and_wait function in 
the usrp2_impl.cc

Be aware of the center_freq and the interface in the *_path files so it fits 
your configuration.

Does anyone have a clue?

br,
Patrik
________________________________________
Från: discuss-gnuradio-bounces+patrik.eliardsson=foi...@gnu.org 
[discuss-gnuradio-bounces+patrik.eliardsson=foi...@gnu.org] för Patrik 
Eliardsson [patrik.eliards...@foi.se]
Skickat: den 2 september 2010 15:39
Till: discuss-gnuradio@gnu.org
Ämne: [Discuss-gnuradio] usrp2::rx_samples() failed when switching rx_path 
using the latest git_trunk

Hi,

What could be the reason for this error?

"usrp2: channel 0 not receiving
usrp2::rx_samples() failed"

>From some previously post, Johnathan said that this should be fixed in 
>releases after 3.2.2

I'm using the latest git trunk version, I've change the firmware (to 
txrx_raw_eth_20100608.bin) and the fpga image (to u2_rev3-20100603.bin) (I am 
using USRP2 + RFX2400). And the error still occur! Why?

My top_block basically contains a usrp2_sink and a usrp2_source block and a 
rx_path and a tx_path. The rx_path and the tx_path are changed during runtime 
with the following sequence:

top_block.lock()
top_block.disconnect()
top_block.connect()
top_block.unlock()

The error occurs after a random number of switches of the different paths 
(sometimes it works for 30 switches and sometimes just for 3) and the program 
requires a restart to get rid of the problem.

Br,

Patrik Eliardsson

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
#!/usr/bin/env python

from gnuradio import gr, gru
import time
import os

# from current dir
import isolate_tx_path
import isolate_rx_path

global mode
mode = "rx" #Default mode is rx

class my_top_block(gr.top_block):

    def __init__(self):

        gr.top_block.__init__(self)
        self.rxpath = isolate_rx_path.usrp_receive_path()
        self.txpath = isolate_tx_path.usrp_transmit_path()
        self.connect(self.txpath);
        self.connect(self.rxpath);

def main():
    global mode
        
    tb = my_top_block()

    r = gr.enable_realtime_scheduling()
    if r != gr.RT_OK:
        print "Warning: failed to enable realtime scheduling"
        
    print 'Blocked waiting for GDB attach (pid = %d)' % (os.getpid(),)
    raw_input ('Press Enter to continue: ')     
    
    tb.start()

    running = True
    time.sleep(3)
    while running:
        if mode == "rx":
            tb.lock()
            tb.rxpath.disconnect(tb.rxpath.u, tb.rxpath.sink)
            tb.rxpath.connect(tb.rxpath.u, tb.rxpath.idle)
            tb.txpath.disconnect(tb.txpath.src, tb.txpath.head, tb.txpath.u)
            tb.txpath.connect(tb.txpath.src, tb.txpath.u)
            tb.unlock()
            time.sleep(0.1)  
            print "."          
            mode = "tx"

        if mode == "tx":
            tb.lock()
            tb.rxpath.disconnect(tb.rxpath.u, tb.rxpath.idle)
            tb.rxpath.connect(tb.rxpath.u, tb.rxpath.sink)
            tb.txpath.disconnect(tb.txpath.src, tb.txpath.u)
            tb.txpath.connect(tb.txpath.src, tb.txpath.head, tb.txpath.u)
            tb.unlock()
            time.sleep(1)
            mode = "rx"
            
if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        pass

#
# Copyright 2009 Free Software Foundation, Inc.
# 
# This file is part of GNU Radio
# 
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# 
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
# 

from gnuradio import gr
from gnuradio import usrp2

class usrp_receive_path(gr.hier_block2):

    def __init__(self):
        '''
        See below for what options should hold
        '''
        gr.hier_block2.__init__(self, "usrp_receive_path",
                gr.io_signature(0, 0, 0),                    # Input signature
                gr.io_signature(0, 0, 0)) # Output signature
                
        self.sink = gr.null_sink(gr.sizeof_gr_complex)
        self.idle = gr.null_sink(gr.sizeof_gr_complex)
        self.u = usrp2.source_32fc("eth2","")
        self.u.set_decim(128)
        self.u.set_center_freq(2450e6)
        
        self.connect(self.u, self.sink)
#
# Copyright 2009 Free Software Foundation, Inc.
# 
# This file is part of GNU Radio
# 
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# 
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
# 

from gnuradio import gr
from gnuradio import usrp2

class usrp_transmit_path(gr.hier_block2):
    def __init__(self):
        '''
        See below for what options should hold
        '''
        gr.hier_block2.__init__(self, "usrp_transmit_path",
                gr.io_signature(0, 0, 0),                    # Input signature
                gr.io_signature(0, 0, 0)) # Output signature
        
        sample_freq = 1
        sin_freq = 0.1
        amplitude = 1
        offset = 0
        self.src = gr.sig_source_c(sample_freq, gr.GR_SIN_WAVE, sin_freq, amplitude, offset)
        n_samples = 256
        self.head = gr.head(gr.sizeof_gr_complex, n_samples)
        self.u = usrp2.sink_32fc("eth2","")
        self.u.set_center_freq(2450e6)
        self.u.set_interp(128)
        self.connect(self.src, self.head, self.u)

        
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to