Hi Sean, thanks for your feedback.. I'm still trying to get this working but the problem persists. Every time I use the "uhd::device_addr_t addr" class necessary to initialize an "uhd::usrp::multi_usrp::make" object, the GRC program fails.
Do I need to do something in the swig.i or the Python files to use "uhd::device_addr_t addr" class? I will send you my .cc and .h files, y«if you can take a look on those I will be very thankful. Thanks again. Best regards, *Nelson Pina* Product Developer Hardware *[email protected]* *T* +351 220 301 596 (PT) *T* +44 114 213 2712 (UK) *www.tomorrow-options.com *Porto // Portugal Sheffield // United Kingdom <http://www.tomorrow-options.com/> <http://www.linkedin.com/company/tomorrow-options> <http://www.facebook.com/pages/Porto-Portugal/Tomorrow-Options/214846405104> <http://twitter.com/TomorrowOptions> <http://www.youtube.com/user/TomorrowOptionsTube> On Tue, Apr 23, 2013 at 8:31 PM, Sean Nowlan <[email protected]>wrote: > On 04/23/2013 02:06 PM, Nelson Pina wrote: > > Hi everyone, > > I have been trying to make a gnuradio out-of-the-tree block that is able > to control the four GPIOs, currently attached to LED's, of the SBX > daughter-boards working with an USRP motherboard. > > I wonder if anyone can help me on this, making a functional draft code of > such a block: > > 1 integer input - that will define the state of the GPIOs > 1 parameter - to define the motherboard serial number > > I believe that for people with knowledge of C++, and Python this is a > very simple module, unfortunately that is not my area since I'm a hardware > engineer and I only work with C. > > I tried some approaches, using the gr_modtool to create the module, but > it always fails with GRC running errors like: > > ********************** > > Traceback (most recent call last): > File > "/home/to-nelsonpina/Desktop/locus_gnuradio/GRC_files/top_block.py", line > 16, in <module> > import gpio > File "/usr/local/lib/python2.7/dist-packages/gpio/__init__.py", line 45, > in <module> > from gpio_swig import * > File "/usr/local/lib/python2.7/dist-packages/gpio/gpio_swig.py", line > 26, in <module> > _gpio_swig = swig_import_helper() > File "/usr/local/lib/python2.7/dist-packages/gpio/gpio_swig.py", line > 22, in swig_import_helper > _mod = imp.load_module('_gpio_swig', fp, pathname, description) > ImportError: /usr/local/lib/libgnuradio-gpio.so: undefined symbol: > _ZN3uhd4usrp10multi_usrp4makeERKNS_13device_addr_tE > > ************************* > > > This is most likely a failure to define the SWIG header file > appropriately, or possibly you've _declared_ a class that SWIG found but > you haven't _defined_ it. Finally because I just found this out the hard > way, if you're using the new code structure with block.h, block_impl.h, and > block_impl.cc, be aware that block.h needs to declare an abstract class and > its method declarations need to be pure virtual. block_impl.h declares the > concrete class and block_impl.cc provides concrete method definitions. > > If you want to unmangle that symbol, type this: > > c++filt _ZN3uhd4usrp10multi_usrp4makeERKNS_13device_addr_tE > > I will appreciate all the help I can get from you guys. > > Best regards, > __ > *Nelson Pina* > Product Developer > Hardware > > > > > > > > > > > *[email protected]* > *T* +351 220 301 596 (PT) > *T* +44 114 213 2712 (UK) > > *www.tomorrow-options.com > *Porto // Portugal > Sheffield // United Kingdom > > <http://www.tomorrow-options.com/> > <http://www.linkedin.com/company/tomorrow-options> > <http://www.facebook.com/pages/Porto-Portugal/Tomorrow-Options/214846405104> > <http://twitter.com/TomorrowOptions> > <http://www.youtube.com/user/TomorrowOptionsTube> > > > > _______________________________________________ > Discuss-gnuradio mailing > [email protected]https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > > > > > _______________________________________________ > Discuss-gnuradio mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > >
locus_gpio_vv.cc
Description: Binary data
/* -*- c++ -*- */
/*
* Copyright 2013 <+YOU OR YOUR COMPANY+>.
*
* This 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.
*
* This software 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 this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_LOCUS_GPIO_VV_H
#define INCLUDED_LOCUS_GPIO_VV_H
#include <locus_api.h>
#include <uhd/usrp/multi_usrp.hpp>
#include <gr_block.h>
class locus_gpio_vv;
/*class GR_UHD_API uhd_usrp_source : virtual public gr_sync_block{
public:*/
/*typedef boost::shared_ptr<locus_gpio_vv> locus_gpio_vv_sptr;
Locus_API locus_gpio_vv_sptr locus_make_gpio_vv (const uhd::device_addr_t &device_addr);*/
Locus_API boost::shared_ptr<locus_gpio_vv> locus_make_gpio_vv(
const char* dev_addr
);
class Locus_API locus_gpio_vv : virtual public gr_block
{
// The friend declaration allows locus_make_localizer_ff to
// access the private constructor.
//friend Locus_API locus_gpio_vv_sptr locus_make_gpio_vv ( const uhd::device_addr_t &device_addr );
/*!
* \brief localizer a stream of floats.
*/
//locus_gpio_vv ( const uhd::device_addr_t &device_addr );
public:
//~locus_gpio_vv();
int general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
#endif /* INCLUDED_LOCUS_GPIO_VV_H */
_______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
