Page 1 of 1

Problem when adding source files for Nios2

Posted: Thu Feb 24, 2022 3:39 am
by naos

I am using BladeRF micro 2.0 A9 ,

bladeRF-cli version : 1.8.0
libbladeRF version : 2.2.1
Firmware version : 2.3.2
FPGA version : 11.0.0

I am trying to automatically set rx frequency, gain, samplerate ect... when a reception occures. To do that i added new source files in bladeRF_nios folder and to set rx parameters i use rfic_command_write_immed() function. The code compile well and i can generate the bitstream but when i load it on the FPGA i get the following errors:

-Failed to receive Nios2 response : operation timed out
-Failed to read FPGA version : operation timed out

(When i use the JTAG i don't have this problem).

Any advance users of BladeRF here that is keen to point me to the right direction?



Re: Problem when adding source files for Nios2

Posted: Sat Jun 11, 2022 6:17 am
by robertbaruch
looking into the code, it appears that it's throwing an exception, why though?

double bladerf_common::set_sample_rate(double rate, bladerf_channel ch)
int status;
struct bladerf_rational_rate rational_rate, actual;

rational_rate.integer = static_cast<uint32_t>(rate);
rational_rate.den = 10000;
rational_rate.num = (rate - rational_rate.integer) * rational_rate.den;

status = bladerf_set_rational_sample_rate(_dev.get(), ch,
&rational_rate, &actual);
if (status != 0) {
BLADERF_THROW_STATUS(status, "Failed to set sample rate");

return actual.integer + (actual.num / static_cast<double>(actual.den));