set_smb_mode() throws UNSUPPORTED error

Having issues with the site, hardware, source code, or any other issues?
Post Reply
sandeep
Posts: 4
Joined: Mon Jul 08, 2024 4:41 am

set_smb_mode() throws UNSUPPORTED error

Post by sandeep »

Hi All, I am trying to use the trigger functionality to achieve sample level synchronization between two bladeRF devices (one xA4 and an xA9) by following the documentation given in (https://www.nuand.com/libbladeRF-doc/v2 ... r_i_g.html). The documentation recommends the use of synchronized clock for the two boards, which can be achieved by configuring one of the boards to output the CLK using set_smb_mode() command, and the other board to accept the CLK via SMB ports of the respective devices. The following is the code snippet that I use to configure CLKOUT and CLKIN using set_smb_mode(). While running this code, I get an error in the execution of set_smb_mode() command. The error code (-8) reads UNSUPPORTED. I tried connecting just one board to the USB and ran bladeRF-cli to see if I can configure it to output CLK, again using set_smb_mode command in bladeRF-cli. There also, it reports the error UNSUPPORTED. Can anyone help me on this?

Code: Select all

int main() {
    bladerf *dev_master;
    bladerf *dev_slave;
    //struct bladerf *dev = NULL
    int status;

    status = bladerf_open(&dev_master, "*:instance=0");
    if (status != 0) {
        std::cout << "Failed to open bladeRF device MASTER: " << std::endl;
        return 1;
    }
	
    status = bladerf_open(&dev_slave, "*:instance=1");
    if (status != 0) {
        std::cout << "Failed to open bladeRF device SLAVE: " << std::endl;
        return 1;
    }	
	
	status = bladerf_set_smb_mode(dev_master,BLADERF_SMB_MODE_OUTPUT);
    if (status != 0) {
        std::cout << "Failed to set SMB CLKOUT in MASTER: " << std::endl;
        std::cout<<status<<std::endl;
        return 1;
    }
	status = bladerf_set_smb_mode(dev_slave,BLADERF_SMB_MODE_INPUT);
    if (status != 0) {
        std::cout << "Failed to set SMB CLKIN in SLAVE: " << std::endl;
        std::cout<<status<<std::endl;
        return 1;
    }	
	
    std::cout<<"cofiguring master"<<std::endl;
    configure_bladerf_master(dev_master); //MASTER will transmit and receive
    std::cout<<"cofiguring slave"<<std::endl;
    configure_bladerf_slave(dev_slave); // SLAVE is receive only
    
robert.ghilduta
Posts: 162
Joined: Thu Feb 28, 2013 11:14 pm

Re: set_smb_mode() throws UNSUPPORTED error

Post by robert.ghilduta »

SMB is only supported on x40 and x115. On the bladeRF 2.0 micro, please use the clock input and out selection APIs:

https://www.nuand.com/libbladeRF-doc/v2 ... e_c_t.html
https://www.nuand.com/libbladeRF-doc/v2 ... p_u_t.html
sandeep
Posts: 4
Joined: Mon Jul 08, 2024 4:41 am

Re: set_smb_mode() throws UNSUPPORTED error

Post by sandeep »

Thanks Robert. The clock configuration now works with the clock selection from bladeRF2.h. I could not yet achieve sample level synchronization between two bladeRF device using trigger mechanism. I will continue with the experiments to resolve this issue.
Post Reply