Hi Risa, 

the chances of us getting mad are extremely slim :)

I presume you've already made progress in this; if not: what line exactly does 
your debugger say your segmentation fault happens? If you haven't worked with a 
debugger before (in your case, probably gdb), it's a skill that pays to learn 
within days, if not hours, of coding.

Best regards,
Marcus

On 11 May 2018 01:06:05 GMT+02:00, risa asir via USRP-users 
<usrp-users@lists.ettus.com> wrote:
>Hi all,
>I am a newbie in USRP and UHD. Please dont be mad at me if I am wrong.
>I am
>currently trying to implement SRSLTE using multi usrp. However I have
>been
>stuck for days trying to contain real data from the buffer received. If
>I
>try to assign the buffs_ptr with the data_c, it says core Segmentation
>fault (core dumped). I attach my piece of code below. Please help me
>for
>some idea to solve this. I am very grateful for your help.
>
>Thank you.
>
>Regards,
>Risa
>
>
>
>
>int multi_usrp_recv_with_time_multi(void *h,
>                                   void *data[SRSLTE_MAX_PORTS],
>                                   uint32_t nsamples,
>                                   bool blocking,
>                                   time_t *secs,
>                                   double *frac_secs) {
>    md = rx_md_first;
>    size_t rxd_samples = 0;
>   const size_t rx_nof_samples = rx_stream_handle->get_max_num_samps();
>    int trials = 0;
>    if (blocking) {
>        uint32_t n = 0;
>        while (n < nsamples && trials < 100) {
>            void *buffs_ptr[4];
>            for (size_t i=0;i<rx_nof_channel;i++) {
>                cf_t *data_c = (cf_t*) data[i];
>                buffs_ptr[i] = &data_c[n];
>            }
>            size_t num_samps_left = nsamples - n;
>            size_t num_rx_samples = (num_samps_left > rx_nof_samples)
>? rx_nof_samples : num_samps_left;
>           // printf("testing1");
>            rxd_samples = 0;
>            rxd_samples =
>rx_stream_handle->recv(buffs_ptr,num_rx_samples, md,1.0,false);
>            printf("rxd_samples: %lu", rxd_samples);
>         if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) {
>                printf("ERROR_CODE_TIMEOUT");
>            };
>     if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND){
>                printf("ERROR_CODE_LATE_COMMAND");
>            };
>     if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_BROKEN_CHAIN){
>                printf("ERROR_CODE_BROKEN_CHAIN");
>            };
>         if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_OVERFLOW){
>                printf("ERROR_CODE_OVERFLOW");
>            };
>        if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_ALIGNMENT){
>                printf("ERROR_CODE_ALIGNMENT");
>            };
>       if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_BAD_PACKET){
>                printf("ERROR_CODE_BAD_PACKET");
>            };
>
>            md = rx_md;
>            n += rxd_samples;
>            trials++;
>        }
>    } else {
>     rxd_samples = rx_stream_handle->recv(data,nsamples, md,0.0,false);
>    }
>    if (secs && frac_secs) {
>        *secs = md.time_spec.get_full_secs();
>                *frac_secs = md.time_spec.get_frac_secs();
>
>    }
>    return nsamples;
> }

-- 
This was written on my cellular phone. whilst an impressive piece of 
engineering, this might not be the perfect device to write emails on - please 
excuse my brevity.
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to