[USRP-users] E312 - Migrating OOT Modules to the USRP

EJ Kreinar ejkreinar at gmail.com
Thu Nov 21 16:48:51 EST 2019


Okay, great...

You might want to try increasing the log level. Export
UHD_LOG_CONSOLE_LEVEL=trace or debug and try to make sure the correct xml
file is getting applied to the block correctly.

There's also something like a "--tree" parameter in the uhd_usrp_probe so
try running the probe with the tree option to print out the device tree and
look for the arguments assigned to your new block.

Let's see if any of that helps figure out what's going on...
EJ

On Thu, Nov 21, 2019, 4:01 PM Jonathan Lockhart <jlockhartrt at gmail.com>
wrote:

> Also, when I compiled from the OOT directory for ARM, I used this command,
> which I pieced together from the RFNoC build guide, and the release-4 guide
> for cross-compiling gr-ettus.
>
> cmake
> -DCMAKE_TOOLCHAIN_FILE=~/rfnoc/src/gnuradio/cmake/Toolchains/oe-sdk_cross.cmake
> -DCMAKE_INSTALL_PREFIX=/usr
> -DUHD_FPGA_DIR="/home/jon/rfnoc/src/uhd/fpga-src/" ../
>
> Regards,
> Jon
>
> On Thu, Nov 21, 2019 at 3:48 PM Jonathan Lockhart <jlockhartrt at gmail.com>
> wrote:
>
>> Greetings EJ,
>>
>> So, from the tutorial, they have you edit the gain.xml file, and this is
>> what I have for it.
>>
>> <?xml version="1.0"?>
>> <!--Default XML file-->
>> <nocblock>
>>   <name>gain</name>
>>   <blockname>gain</blockname>
>>   <ids>
>>     <id revision="0">B7DD64941A952AAC</id>
>>   </ids>
>>   <!-- Registers -->
>>   <registers>
>>     <setreg>
>>       <name>Gain</name>
>>       <address>128</address>
>>     </setreg>
>>   </registers>
>>   <!-- Args -->
>>   <args>
>>     <args>
>>       <name>gain</name>
>>       <type>double</type>
>>       <value>1.0</value>
>>       <check>GE($gain, 0.0) AND LE($gain, 32767.0)</check>
>>       <check_message>Invalid Gain!</check_message>
>>       <action>
>>         SR_WRITE("GAIN", IROUND($gain))
>>       </action>
>>     </args>
>>   </args>
>>   <!--One input, one output. If this is used, better have all the info
>> the C++ file.-->
>>   <ports>
>>     <sink>
>>       <name>in0</name>
>>       <type>sc16</name>
>>     </sink>
>>     <source>
>>       <name>out0</name>
>>       <type>sc16</name>
>>     </source>
>>   </ports>
>> </nocblock>
>>
>> There is an args value and it is declared as gain.
>>
>> So from there, I followed your second suggestion and tried to find where
>> it was installed when I did the cross compile. It was not placed in the
>> "GRC_BLOCKS_PATH" of "/share/gnuradio/grc/blocks" like the default RFNoC
>> blocks. It was instead placed in "/share/uhd/rfnoc/bocks" so I added that
>> to the setup.env file, included below.
>>
>> LOCALPREFIX=~/newinstall/usr
>> export PATH=$LOCALPREFIX/bin:$PATH
>> export LD_LOAD_LIBRARY=$LOCALPREFIX/lib:$LD_LOAD_LIBRARY
>> export LD_LIBRARY_PATH=$LOCALPREFIX/lib:$LD_LIBRARY_PATH
>> export PYTHONPATH=$LOCALPREFIX/lib/python2.7/site-packages:$PYTHONPATH
>> export PKG_CONFIG_PATH=$LOCALPREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
>> export
>> GRC_BLOCKS_PATH=$LOCALPREFIX/share/gnuradio/grc/blocks:$GRC_BLOCKS_PATH
>> export UHD_RFNOC_DIR=$LOCALPREFIX/share/uhd/rfnoc/
>> export UHD_IMAGES_DIR=$LOCALPREFIX/share/uhd/images
>> export
>> GRC_BLOCKS_PATH=$LOCALPREFIX/share/uhd/rfnoc/blocks:$GRC_BLOCKS_PATH
>>
>> Unfortunately, after re-sourcing the setup.env, I still get the same
>> message.
>>
>>   File "rfnoc_myGain_usrp.py", line 223, in <module>
>>     main()
>>   File "rfnoc_myGain_usrp.py", line 212, in main
>>     tb = top_block_cls(fpga_path=options.fpga_path,
>> rx_gain=options.rx_gain, rx_digital_gain=options.rx_digital_gain,
>> rx_freq=options.rx_freq, host_ip_addr=options.host_ip_addr)
>>   File "rfnoc_myGain_usrp.py", line 117, in __init__
>>     self.tutorial_gain_0.set_arg("gain", rx_digital_gain)
>>   File
>> "/home/root/newinstall/usr/lib/python2.7/site-packages/tutorial/tutorial_swig.py",
>> line 315, in set_arg
>>     return _tutorial_swig.gain_sptr_set_arg(self, *args)
>> RuntimeError: LookupError: Path not found in tree:
>> /mboards/0/xbar/gain_0/args/0/gain/value
>>
>> I looked at some of your examples (which have been very helpful to get me
>> this far) from what I believe is your github someone linked me. Everything
>> appears to match what it should, for what gain is trying to accomplish.
>>
>> Regards,
>> Jon
>>
>> On Thu, Nov 21, 2019 at 3:27 PM EJ Kreinar <ejkreinar at gmail.com> wrote:
>>
>>> Hi Jon,
>>>
>>> The rfnoc "nocscript" xml definition can create arguments and attach to
>>> the device tree like you are trying to set there (it's not compiled
>>> directly, but rather created dynamically from the xml definition)
>>>
>>> Recommended debugging...
>>> 1. Check your OOT gain block xml (in rfnoc/blocks) and make sure it has
>>> a "gain" field in the "args" list. You'll also want to make sure it writes
>>> your desired register, but I don't think you're even getting that far
>>> 2. Make sure the block xml is installed on the e310 embedded prefix and
>>> is found at run time during uhd_usrp_probe and when running your
>>> application. If it's not in the right place or not attaching to your block
>>> then it won't create the gain argument
>>>
>>> I'm guessing it's one of those two possibilities...
>>> EJ
>>>
>>> On Thu, Nov 21, 2019, 3:19 PM Jonathan Lockhart via USRP-users <
>>> usrp-users at lists.ettus.com> wrote:
>>>
>>>> Greetings,
>>>>
>>>> I was able to get the ARM cross compile working. I removed the build
>>>> directory and re-sourced the dev environment and then the cross-compile
>>>> used the -mfloar=hard flag. Not sure what caused the issue earlier and why
>>>> it wasn't picking it up.
>>>>
>>>> Now I have a different issue. So I have completed this guide:
>>>> https://kb.ettus.com/Getting_Started_with_RFNoC_Development
>>>>
>>>> I modified the GNURadio just a bit so that the output from gain was
>>>> placed on a ZMQ push, and the graphics were on the host to graph the signal
>>>> (seen in the screenshots below).
>>>>
>>>> [image: Screenshot from 2019-11-21 15-06-33.jpg]
>>>>
>>>> [image: Screenshot from 2019-11-21 15-010-44.jpg]
>>>>
>>>> However, when I run the top file for the USRP, I am running into this
>>>> error.
>>>>
>>>> Traceback (most recent call last):
>>>>   File "rfnoc_myGain_usrp.py", line 223, in <module>
>>>>     main()
>>>>   File "rfnoc_myGain_usrp.py", line 212, in main
>>>>     tb = top_block_cls(fpga_path=options.fpga_path,
>>>> rx_gain=options.rx_gain, rx_digital_gain=options.rx_digital_gain,
>>>> rx_freq=options.rx_freq, host_ip_addr=options.host_ip_addr)
>>>>   File "rfnoc_myGain_usrp.py", line 117, in __init__
>>>>     self.tutorial_gain_0.set_arg("gain", rx_digital_gain)
>>>>   File
>>>> "/home/root/newinstall/usr/lib/python2.7/site-packages/tutorial/tutorial_swig.py",
>>>> line 315, in set_arg
>>>>     return _tutorial_swig.gain_sptr_set_arg(self, *args)
>>>> RuntimeError: LookupError: Path not found in tree:
>>>> /mboards/0/xbar/gain_0/args/0/gain/value
>>>>
>>>> No where else in building GNURadio scripts and .bit files does this
>>>> "/mboards" arise, and I have looked through my verilog file for gain
>>>> (gain.v) and it is correct per the instructions in the linked guide, and I
>>>> built the python and gnuradio hook exactly as the instructions stated to.
>>>>
>>>> Anyone have an troubleshooting ideas b/c I am currently at a loss. It
>>>> did past the test bench they have you build with no issues.
>>>>
>>>> Regards,
>>>> Jon
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Nov 20, 2019 at 3:21 PM Jonathan Lockhart <
>>>> jlockhartrt at gmail.com> wrote:
>>>>
>>>>> Greetings,
>>>>>
>>>>> I am having some issues completing the RFNOC build tutorial on the
>>>>> Ettus E312. The reference documentation is using an X3xx series radio, and
>>>>> from the final python script it appears to be running the GNR script
>>>>> natively on the host. I built the exact script from the KB but when running
>>>>> on the radio it fails stating it can't "import tutorial." I realized all
>>>>> the files that were installed were placed on the host but not cross
>>>>> compiled for the E3xx using the SDK and ARM cross compile tool. I tried to
>>>>> complete this task, but unfortunately the compilation dies here.
>>>>>
>>>>> /home/jon/rfnoc/oe/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h:7:11:
>>>>> fatal error: gnu/stubs-soft.h: No such file or directory
>>>>>  # include <gnu/stubs-soft.h>
>>>>>            ^~~~~~~~~~~~~~~~~~
>>>>> compilation terminated.
>>>>>
>>>>> Now I did find the stubs-soft.h file in the libc6-dev-armel-cross in
>>>>> the apt repo. I installed it and tried to cp the file into the
>>>>> /home/jon/rfnoc/oe/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/include/gnu/
>>>>> location but it still doesn't like that. I verified that on my echo $CC
>>>>> that the -mfloat is set to hard as shown here.
>>>>>
>>>>> jon at jon-OptiPlex-9020:~/rfnoc/src/rfnoc-tutorial$ echo $CC
>>>>> arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon
>>>>> --sysroot=/home/jon/rfnoc/oe/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi
>>>>>
>>>>> So I am not sure why the gain module in the tutorial is looking for
>>>>> the soft file.
>>>>>
>>>>> If anyone has experience in porting their OOT modules over to the
>>>>> E-series of radios I would appreciate the help.
>>>>>
>>>>> Regards,
>>>>> Jon
>>>>>
>>>> _______________________________________________
>>>> USRP-users mailing list
>>>> USRP-users at lists.ettus.com
>>>> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20191121/c1aff931/attachment.html>


More information about the USRP-users mailing list