Using no-OS code (ad9361-2015_R1) with ZC706 / FMCOMMS5 boards I found that the MCS process is failing. Consequently, no RF carriers are being generated. I added an iLA to debug and found that l_clk was not being generated by the axi_ad9361_0 ipcore.
Stepping through the code I found that the l_clk was present after initialization and RF carriers are present at the SMAs until the ad9361_do_mcs function is executed. Investigating further, I found that the function ad9361_mcs was aborting in case 2 and case 4 when the function gpio_is_valid was executed (causing the sync signal not to be strobed).
break; <- this is where it breaks on gpio_sync = -1
I found that originally the gpio_sync pin is configured properly in main.c line 381…
default_init_param.gpio_sync = GPIO_SYNC_PIN;
default_init_param.gpio_cal_sw1 = GPIO_CAL_SW1_PIN;
default_init_param.gpio_cal_sw2 = GPIO_CAL_SW2_PIN;
But the later on line 419 it overwrites gpio_sync = -1 here...
default_init_param.id_no = 1;
default_init_param.gpio_resetb = GPIO_RESET_PIN_2;
default_init_param.gpio_sync = -1; <-Line 419 in main.c. Why is this here?
default_init_param.gpio_cal_sw1 = -1;
default_init_param.gpio_cal_sw2 = -1;
default_init_param.rx_synthesizer_frequency_hz = 2300000000UL;
default_init_param.tx_synthesizer_frequency_hz = 2300000000UL;
Uncommented the -1 settings does make the MCS state machine sequence executing and the sync signals are now being strobed. But this change does not render MCS working since the l_clk signal (and RF carrier) are still not present after the ad9361_do_mcs code is executed.
By the way, I don’t know if this was intentional but in the ad9361_mcs function case 0 does not have a break so case 1 gets executed twice (when called from for loop in ad9361_do_mcs).
The carrier signals I measure at J112 and J213 SMAs are centered at 2.15GHz and 2.3GHz respectively however the 2.3G is the only valid frequency. Deault for default_init_param tx_synthesizer_frequency_hz is 2.4GHz with an override at main.c line 423 with ad9361_init for ad9361_phy_b. So expected to see carriers at 2.3GHz and 2.4GHz.
Perhaps related: I find the definitions for peripheral SPI 1 ( line 549: #define XPAR_PS7_SPI_1_DEVICE_ID 1) but it is not used in the no_OS software. Only SPI 0 is redefined and used in parameters.h (#define SPI_DEVICE_ID XPAR_PS7_SPI_0_DEVICE_ID). Is the second AD9361 is not being configured? What am I missing?