USRP2の設定

今まであまり深堀していなかったUSRP2について調査をする。

pick_bitrate.py

_pick_bitrate()

xrate(interpolation)及びsamples_per_symbolが決まっている場合、ビットレートを以下の式で決定している。
ビットレート = converter_rate(100Mbps) / xrate / samples_per_symbol

新しく買ったUSRP2が動かない。。

以下、./benchmark_tx.pyを実行すると発生するエラー。
>>> gr_fir_ccf: using SSE
dac_rate= 100M
samples/symbol= 2
Requested TX Bitrate: 100k Actual Bitrate: 100k
interp_rates= 500
Failed to set Rx frequency to 2.45G
Traceback (most recent call last):
  File "./test_cdma_tx.py", line 174, in <module>
    main()
  File "./test_cdma_tx.py", line 162, in main
    tb = my_top_block(mods[options.modulation], options)
  File "./test_cdma_tx.py", line 74, in __init__
    self._setup_usrp_sink(options)
  File "./test_cdma_tx.py", line 116, in _setup_usrp_sink
    raise ValueError, eng_notation.num_to_str(options.tx_freq)
ValueError: 2.45G
USRP2の送信周波数を2.45Gにセットできないそう。。ドーターボードを取り換えても
だめなので、どうやら本体に原因がある?
エラーを出している元、usrp2_impl.cc
 bool
 usrp2::impl::set_tx_center_freq(double frequency, tune_result *result)
 {
   op_config_tx_v2_cmd cmd;
   op_config_tx_reply_v2_t reply;

   init_config_tx_v2_cmd(&cmd);
   cmd.op.valid = htons(CFGV_FREQ);
   u2_fxpt_freq_t fxpt = u2_double_to_fxpt_freq(frequency);
   cmd.op.freq_hi = htonl(u2_fxpt_freq_hi(fxpt));
   cmd.op.freq_lo = htonl(u2_fxpt_freq_lo(fxpt));

   pending_reply p(cmd.op.rid, &reply, sizeof(reply));
   if (!transmit_cmd_and_wait(&cmd, sizeof(cmd), &p, DEF_CMD_TIMEOUT)) //ここでfalseが戻ってしまう。
     return false;

   bool success = (ntohx(reply.ok) == 1);
   if (result && success) {
     result->baseband_freq =
       u2_fxpt_freq_to_double(
	  u2_fxpt_freq_from_hilo(ntohl(reply.baseband_freq_hi),
				 ntohl(reply.baseband_freq_lo)));
 
     result->dxc_freq =
       u2_fxpt_freq_to_double(
	  u2_fxpt_freq_from_hilo(ntohl(reply.duc_freq_hi),
				 ntohl(reply.duc_freq_lo)));

     result->residual_freq =
       u2_fxpt_freq_to_double(
	 u2_fxpt_freq_from_hilo(ntohl(reply.residual_freq_hi),
				ntohl(reply.residual_freq_lo)));

      result->spectrum_inverted = (bool)(ntohx(reply.inverted) == 1);
   }

   return success;
 }

 bool
 usrp2::impl::transmit_cmd_and_wait(void *cmd, size_t len, pending_reply *p, double secs)
 {
   d_pending_replies[p->rid()] = p;

   if (!transmit_cmd(cmd, len)){
     d_pending_replies[p->rid()] = 0;
     return false; //こいつか(たぶんこいつ)
   }

   int res = p->wait_for_completion(secs); //それともこいつか
   d_pending_replies[p->rid()] = 0;
   return res == 1;
 }
 bool
 usrp2::impl::transmit_cmd(void *cmd_, size_t len_)
 {
   const void *cmd = cmd_;
   int len = len_;
   unsigned char tmp[64];

   if (len_ < 64){		// pad to minimum ethernet frame size
     memset(tmp, 0, sizeof(tmp));
     memcpy(tmp, cmd_, len_);
     cmd = tmp;
     len = sizeof(tmp);
   }

   return d_eth_buf->tx_frame(cmd, len) == eth_buffer::EB_OK;
 }

ここが参考になるかも
  • 結局分らなかったので、Ettus Resarchの人に聞いてみた
以下の回答の通り、XCVR2450用のファームウェアをSDカードにインストールしたら動いた!
If you're using the "classic" USRP2 interface, you'll need to use the XCVR2450-specific firmware on the USRP2:

http://code.ettus.com/redmine/ettus/attachments/71

Since "benchmark_tx.py" uses the "classic" raw-ethernet interface, you'll need the XCVR-specific firmware.

インストールコマンド
./u2_flash_tool --dev=/dev/sdb -t s/w ~/txrx_xcvr_raw_eth_20100608.bin -w


最終更新:2011年07月10日 16:56