Dear USRP Support Team,
Greetings of the day!
I am currently working with a USRP N300 device with uhd 4.7 and gnu radio 
v3.11.  I have created a simple loopback configuration in which the data flows 
through the following blocks:
Rx_Radio > DDC > DMAFifo > DUC > Tx_Radio.
However, I am encountering an issue where only the receiver is working, and the 
transmitter is not starting. My objective is to receive data and transmit it 
back without using host-side streamers, i.e., I intend to handle everything on 
the RFNoC hardware blocks directly.
I have set the configuration for the transmitter using the RadioControl blocks 
(as shown in the attached script), but I am unable to start the transmitter. It 
seems that the transmitter is not getting activated or streaming, even though 
the receiver works correctly.
Could you please guide me on how to start the transmitter without relying on 
host-side streamers? Any assistance or clarification regarding the correct 
method to achieve this will be greatly appreciated.
Thank you for your support, and I look forward to your guidance.

Regards,
Nidhi


import uhd
import time
# from gnuradio import uhd

# RFNoC Graph Initialization
graph = uhd.rfnoc.RfnocGraph('addr = 192.168.20.2')

# Transmitter Properties
radio_noc_block_tx = graph.get_block("0/Radio#0")
tx_radio_block = uhd.rfnoc.RadioControl(radio_noc_block_tx)
tx_radio_block.set_tx_frequency(400e6, 0)
tx_radio_block.set_tx_gain(45, 0)
tx_radio_block.set_tx_bandwidth(100e6, 0)
tx_radio_block.set_tx_antenna("TX/RX", 0)
tx_radio_block.set_rate(125e6)

# Receiver Properties
radio_noc_block_rx = graph.get_block("0/Radio#0")
rx_radio_block = uhd.rfnoc.RadioControl(radio_noc_block_rx)
rx_radio_block.set_rx_frequency(400e6, 0)
rx_radio_block.set_rx_gain(45, 0)
rx_radio_block.set_rx_bandwidth(100e6, 0)
rx_radio_block.set_rx_antenna("RX2", 0)
rx_radio_block.set_rate(125e6)

# DDC and DUC Properties (for downconversion and upconversion)
ddc_block = uhd.rfnoc.DdcBlockControl(graph.get_block("0/DDC#0"))
ddc_block.set_input_rate(125e6, 0)
ddc_block.set_output_rate(1e6, 0)

duc_block = uhd.rfnoc.DucBlockControl(graph.get_block("0/DUC#0"))
duc_block.set_input_rate(1e6, 0)
duc_block.set_output_rate(125e6, 0)

# DMA Block for handling the data between blocks
dma_block = graph.get_block("0/DmaFIFO#0")
# replay_block = graph.get_block("Replay#0")

# Connect blocks without host-side streamers
graph.connect("0/Radio#0", 0, "0/DDC#0", 0, True)  # Radio -> DDC Block
graph.connect("0/DDC#0", 0, "0/DmaFIFO#0", 0, False)  # DDC -> DMA FIFO
graph.connect("0/DmaFIFO#0", 0, "0/DUC#0", 0, False)  # DMA FIFO -> DUC
graph.connect("0/DUC#0", 0, "0/Radio#0", 0, False)  # DUC -> Radio

# Commit the graph after connecting all blocks
graph.commit()

# Create StreamCMD for RX and TX
rx_stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.start_cont)
rx_stream_cmd.time_spec = uhd.types.TimeSpec(0.0)  # Timestamp for start of RX

tx_stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.start_cont)
tx_stream_cmd.time_spec = uhd.types.TimeSpec(0.0)  # Timestamp for start of TX

# Start RX and TX streams directly (through RFNoC blocks, not streamers)
rx_radio_block.issue_stream_cmd(rx_stream_cmd, 0)
tx_radio_block.issue_stream_cmd(tx_stream_cmd, 0)

# Main loop to keep the program alive
counter = 0
while True:
    if counter == 2:
        break
    counter += 1
    time.sleep(5)
    print("I am alive!")

# Stop streaming when done (by stopping the RX and TX blocks)
rx_radio_block.issue_stream_cmd(uhd.types.StreamCMD(uhd.types.StreamMode.stop_cont),
 0)
tx_radio_block.issue_stream_cmd(uhd.types.StreamCMD(uhd.types.StreamMode.stop_cont),
 0)

print("Streaming closed.")

_______________________________________________
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