Post Go back to editing

No OS example code and common.c file for zc706

I have a customer using the AD9371, No OS, on the ZC706 platform. He's looking for an example of a common.c file, is frustrated overall because there does not seem to be any example code available, no examples folder in the API .zip file.

 

This is direct from the customer;

 

Problem is that the  No-OS API download does not contain an examples folder.

I understand that this and other files like common.c are to be customized for my custom target platform, but I am not there yet. I need to start with the a working platform which is the ZC706 ADVR9371reference platform. So if there was any code at all that works with the reference platform it would save a LOT of time and false starts trying to figure out how to get everything working from the ground up. That's one of the main purposes of a reference design, the other being for evaluation, which the TES application and IO Scope applications along with others provide nicely.

 

thanks...................Steve

common.c.zip
  • Hi Folks,

    Customer is getting anxious, can we get an answer. I don't think this one is that difficult.

    thanks!

    Steve

  • What I really need is the no-os common.c file for the ZC706. I can manage the rest.

  • You can use Linux 'common.c' as a reference which is shipped along with API source code.

  • Looks like 'common.c' has been removed from latest API release. I can share one for you if you don't have one from older release.

  • YES!! I've been struggling with this trying to get something working. I found one but it is incomplete -for example the hardware rest function is stubbed out. Please yes share a more complete common.c with you ASAP.

    Please to expedite this send direct to my email cellis@vanteon.com as an attachment as well as attach to a reply here.

    Thank you!!

  • Please see the attachment in main query in top.

  • Thanks Gaurav, you've been a tremendous help, I think we are seeing the light at the end of the tunnel now, almost there.

    Charlie and I have read, and we understand, the programming interface for the AD9528 in the AD9371 API files. However, we are looking for an example script that shows what AD9528 reg values to program for given conditions. When a user is working with the transceiver evaluation software (TES), there is an option to generate a script file for the AD9371 which contains the AD9371 settings currently used in the GUI. Can the TES software also be set up to generate a script for the AD9528 settings in the TES GUI?

    If not, do you have an example of an AD9528 script we can look at?

    thanks!

    Steve

  • You can generate C script from GUI which will generate C script having AD9371 and AD9528 settings in two different files.

    For configuring AD9528 refer to 't_ad9528.h in 'source code in AD9528 folder in API source code which can be downloaded from here

    http://www.analog.com/en/design-center/landing-pages/001/transceiver-evaluation-software.html

  • Thanks Gaurav,

    Charlie nearly has the entire system up and running now, running into a problem with verifying AD9528 initialization.

    Steve

    Problem is described as follows;

    So first here is where I am at:

    • Using the common.c provided by Gaurav as a reference I have what I believe is now a fully functional common.c for the zc706 reference platform:
      • Reset to the AD9528 is working properly as verified by scope on the ADRV9371 board
      • Reset to the AD9371 is working properly as verified by scope on the ADRV9371 board
      • SPI bus common to AD9528 and AD9371  is working correctly as verified by both ILA I added to the Zynq FPGA and scope on the ADRC9371 board
      • SPI SlaveSel to AD9528 and AD9371  are working correctly as verified by both ILA I added to the Zynq FPGA and scope on the ADRC9371 board
      • I am able to read AD9528 Product ID register correctly, verified against expected value AD9528 data sheet
      • I am able to read AD9371 Version ID register but no idea if it is correct
    • I have a full project built using FreeRTOS in Xilinx SDK. Project consists of:
      • MYKONOS generic API provided by ADI – unmodified
      • AD9528 generic API provided by ADI – unmodified
      • All files generated by RadioVerse – headless.c  ad9528_init and Mykonos_init
      • My modified common.c
      • My attempt to initialize and start up the AD9528 early in the application execution
      • FPGA hardware definitions exported from Vivado and built from Xilinx reference design for zc706

     

    I am stuck right now on AD9528 initialization. ADI provides only the reference data structures generated by RadioVerse and the AD9528 API. I had to add the code to call the AD9528 API functions which seemed simple straightforward – reset the chip and then initialize it. I am stuck in the initialization code for the ad9528. The sequence I am doing is 1) reset AD9528 2) call AD9528Initialize with data structures provided by RadioVerse. It is failing on reading back the Status register after going through the setup steps. Here is where the code fails in ad9528.c:

     

       CMB_setTimeout_ms(1000);

         do{

             CMB_SPIReadByte(device->spiSettings, AD9528_ADDR_STATUS_READBACK0, &reg508);

             if(CMB_hasTimeoutExpired() > 0)

             {

                 return ADIERR_FAILED;

             }

  • So the bits that are present in the status register x508 (0xF2) may reflect the fact that I don't have a clock source connected possibly.

    If ADI could confirm or deny this for me please?

    I have a clock generator on order should arrive in the next day or so.

    Charlie