Discussion and technical support related to USRP, UHD, RFNoC
View all threadsHello,
I have followed the exact same steps as shown in this video:
https://www.youtube.com/watch?v=M9ntwQie9vs to create a custom RFNoC Gain
block. I successfully built the FPGA bitstream and booted the E310 device
with it.
After flashing, I confirmed that the RFNoC blocks were correctly loaded.
The output is:
RFNoC blocks on this device:
Static connections on this device:
In addition to generating the bitstream, I also created and included the
required .yml files — specifically the block descriptor (gain.yml) and
image core (e310_rfnoc_image_core.yml). I confirmed that the image builder
detects them successfully when using --log-level debug.
[image: Screenshot from 2025-06-30 11-03-14.png]
However, when I try to recreate the block diagram in GNU Radio Companion,
following the same structure as shown in the video, I encounter the
following error during Python code generation:
Generating: "/home/aufer/Projects/rfnoc-gain/rfnoc_gain_trial.py"
Generate Error: Undefined
Failure
Traceback (most recent call last):
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/gui/Application.py",
line 758, in _handle_action
generator.write()
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 86, in write
for filename, data in self._build_python_code_from_template():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 135, in _build_python_code_from_template
connections=self._connections(),
^^^^^^^^^^^^^^^^^^^
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 328, in _connections
code = template.render(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/mako/template.py", line 438, in
render
return runtime.render(self, self.callable, args, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 874, in
_render
_render_context(
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 916, in
_render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 943, in
exec_template callable(context, *args, **kwargs)
File "memory:0x77b7681a8ce0", line 32, in render_body
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 230, in
str
raise NameError("Undefined")
NameError: Undefined
This occurs when GRC attempts to generate the .py file.
Could you please advise what might be missing or misconfigured to cause
this “Undefined” error?
Best regards,
The YAML files look fine... which version of UHD and GNU Radio are you
using?
--M
On Mon, Jun 30, 2025 at 1:04 PM Ahmet Hes nirkicatal1@gmail.com wrote:
Hello,
I have followed the exact same steps as shown in this video:
https://www.youtube.com/watch?v=M9ntwQie9vs to create a custom RFNoC Gain
block. I successfully built the FPGA bitstream and booted the E310 device
with it.
After flashing, I confirmed that the RFNoC blocks were correctly loaded.
The output is:
RFNoC blocks on this device:
- 0/Gain#0
- 0/Radio#0
Static connections on this device:
- 0/SEP#0:0 ==> 0/Radio#0:0
- 0/Radio#0:0 ==> 0/SEP#0:0
- 0/SEP#1:0 ==> 0/Radio#0:1
- 0/Radio#0:1 ==> 0/SEP#1:0
- 0/SEP#2:0 ==> 0/Gain#0:0
- 0/Gain#0:0 ==> 0/SEP#2:0
In addition to generating the bitstream, I also created and included the
required .yml files — specifically the block descriptor (gain.yml) and
image core (e310_rfnoc_image_core.yml). I confirmed that the image builder
detects them successfully when using --log-level debug.
[image: Screenshot from 2025-06-30 11-03-14.png]
However, when I try to recreate the block diagram in GNU Radio Companion,
following the same structure as shown in the video, I encounter the
following error during Python code generation:
Generating: "/home/aufer/Projects/rfnoc-gain/rfnoc_gain_trial.py"
Generate Error: Undefined
Failure
Traceback (most recent call last):
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/gui/Application.py",
line 758, in _handle_action
generator.write()
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 86, in write
for filename, data in self._build_python_code_from_template():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 135, in _build_python_code_from_template
connections=self._connections(),
^^^^^^^^^^^^^^^^^^^
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 328, in _connections
code = template.render(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/mako/template.py", line 438, in
render
return runtime.render(self, self.callable, args, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 874, in
_render
_render_context(
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 916, in
_render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 943, in
exec_template callable(context, *args, **kwargs)
File "memory:0x77b7681a8ce0", line 32, in render_body
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 230, in
str
raise NameError("Undefined")
NameError: Undefined
This occurs when GRC attempts to generate the .py file.
Could you please advise what might be missing or misconfigured to cause
this “Undefined” error?
Best regards,
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.com
UHD 4.8.0.0-0-g308126a4
GNURadio version 3.10.9.2
Martin Braun martin.braun@ettus.com, 1 Tem 2025 Sal, 15:12 tarihinde şunu
yazdı:
The YAML files look fine... which version of UHD and GNU Radio are you
using?
--M
On Mon, Jun 30, 2025 at 1:04 PM Ahmet Hes nirkicatal1@gmail.com wrote:
Hello,
I have followed the exact same steps as shown in this video:
https://www.youtube.com/watch?v=M9ntwQie9vs to create a custom RFNoC
Gain
block. I successfully built the FPGA bitstream and booted the E310 device
with it.
After flashing, I confirmed that the RFNoC blocks were correctly loaded.
The output is:
RFNoC blocks on this device:
- 0/Gain#0
- 0/Radio#0
Static connections on this device:
- 0/SEP#0:0 ==> 0/Radio#0:0
- 0/Radio#0:0 ==> 0/SEP#0:0
- 0/SEP#1:0 ==> 0/Radio#0:1
- 0/Radio#0:1 ==> 0/SEP#1:0
- 0/SEP#2:0 ==> 0/Gain#0:0
- 0/Gain#0:0 ==> 0/SEP#2:0
In addition to generating the bitstream, I also created and included the
required .yml files — specifically the block descriptor (gain.yml) and
image core (e310_rfnoc_image_core.yml). I confirmed that the image
builder
detects them successfully when using --log-level debug.
[image: Screenshot from 2025-06-30 11-03-14.png]
However, when I try to recreate the block diagram in GNU Radio Companion,
following the same structure as shown in the video, I encounter the
following error during Python code generation:
Generating: "/home/aufer/Projects/rfnoc-gain/rfnoc_gain_trial.py"
Generate Error: Undefined
Failure
Traceback (most recent call last):
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/gui/Application.py",
line 758, in _handle_action
generator.write()
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 86, in write
for filename, data in self._build_python_code_from_template():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 135, in _build_python_code_from_template
connections=self._connections(),
^^^^^^^^^^^^^^^^^^^
File
"/home/aufer/gnuradio-install/lib/python3.12/site-packages/gnuradio/grc/core/generator/top_block.py",
line 328, in _connections
code = template.render(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/mako/template.py", line 438, in
render
return runtime.render(self, self.callable, args, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 874, in
_render
_render_context(
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 916, in
_render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 943, in
exec_template callable(context, *args, **kwargs)
File "memory:0x77b7681a8ce0", line 32, in render_body
File "/usr/lib/python3/dist-packages/mako/runtime.py", line 230, in
str
raise NameError("Undefined")
NameError: Undefined
This occurs when GRC attempts to generate the .py file.
Could you please advise what might be missing or misconfigured to cause
this “Undefined” error?
Best regards,
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.com
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.com
Final Update:
I decided to ignore the warnings in GNU Radio and proceeded with the Python
script.
When I construct the graph as follows:
radio_noc_block = graph.get_block("0/Radio#0")
radio_block = uhd.rfnoc.RadioControl(radio_noc_block)
rx_streamer = graph.create_rx_streamer(1, uhd.usrp.StreamArgs("fc32",
"sc16"))
graph.connect("0/Radio#0", 0, rx_streamer, 0)
graph.commit()
I’m able to receive samples successfully.
However, when I insert my custom Gain block into the chain:
radio_noc_block = graph.get_block("0/Radio#0")
radio_block = uhd.rfnoc.RadioControl(radio_noc_block)
rx_streamer = graph.create_rx_streamer(1, uhd.usrp.StreamArgs("fc32",
"sc16"))
graph.connect("0/Radio#0", 0, "0/Gain#0", 0, False)
graph.connect("0/Gain#0", 0, rx_streamer, 0)
print(graph) # Inspect the connections
graph.commit()
I no longer receive any samples.
I would really appreciate your help in identifying what might be going
wrong with the custom block connection.
Ahmet,
this is too difficult to remote-diagnose. I suggest comparing your code to
the rfnoc-gain example in UHD and see if you made a mistake in the Verilog
implementation.
--M
On Wed, Jul 2, 2025 at 2:51 PM Ahmet Hes nirkicatal1@gmail.com wrote:
Final Update:
I decided to ignore the warnings in GNU Radio and proceeded with the
Python script.
When I construct the graph as follows:
radio_noc_block = graph.get_block("0/Radio#0")
radio_block = uhd.rfnoc.RadioControl(radio_noc_block)
rx_streamer = graph.create_rx_streamer(1, uhd.usrp.StreamArgs("fc32",
"sc16"))
graph.connect("0/Radio#0", 0, rx_streamer, 0)
graph.commit()
I’m able to receive samples successfully.
However, when I insert my custom Gain block into the chain:
radio_noc_block = graph.get_block("0/Radio#0")
radio_block = uhd.rfnoc.RadioControl(radio_noc_block)
rx_streamer = graph.create_rx_streamer(1, uhd.usrp.StreamArgs("fc32",
"sc16"))
graph.connect("0/Radio#0", 0, "0/Gain#0", 0, False)
graph.connect("0/Gain#0", 0, rx_streamer, 0)
print(graph) # Inspect the connections
graph.commit()
I no longer receive any samples.
I would really appreciate your help in identifying what might be going
wrong with the custom block connection.