Post Go back to editing

Modification of Analog Devices' API for programming ADRV9026 on a custom/ad hoc board

Category: Software
Product Number: ADRV9026
Software Version: Windows 11 (64-bit); Vivado/Vitis 2022.2; ADRV9026 TRx Evaluation Software (GainTables: 6.4.0.1, Api: 6.4.0.14, Firmware: 6.4.0.6, Gui: 6.4.0.17)

Dear all,

We are starting to implement the script for programming the RF-TRx ADRV9026 (its initial sequence, for now). Since there is the API provided by Analog, we intended to use it but we were not quite sure which files (.c, .h) should be modified such that the API work with our custom/ad hoc board.

Although the dev. guide (UG1727) indicates that adi_platform.c and adi_platform.h should be the primarily files to be modified, we would like to know which other ones needed to be edited.

Best regards,

  • Although the dev. guide (UG1727) indicates that adi_platform.c and adi_platform.h should be the primarily files to be modified, we would like to know which other ones needed to be edited.

    Yes, the platform.c and platform.h files need to be modified . 

    The HAL layer modifications needs to be done that connect to ADI HAL function pointer in the adi_platform.c file.

    The  BBIC SPI master configurations also need to be modified .

    All the BBIC related functions in the JESD Bringup - Initialization , TX  Bringup and Rx Bringup  should be replaced with the platform specific code (respective BBIC used ).

    Please go through  the procedure from "SOFTWARE INTEGRATION PROCESS " section(page 10)  from UG 1727 .

    ADS9 Linux Application example build procedure for reference .

     https://ez.analog.com/rf/wide-band-rf-transceivers/design-support-adrv9026/w/documents 

  • Yes, the platform.c and platform.h files need to be modified . 

    The HAL layer modifications needs to be done that connect to ADI HAL function pointer in the adi_platform.c file.

    I have a few questions regarding the first step:

    1. Does the necessary modifications to the adi_platform.c only regard the HAL layer? I mean, Does it only regard replacing NULL by our platform functions: ourPlatform_HwOpen, ourPlatform_HwClose, ourPlatform_HwReset, etc...?
      case ADI_UNKNOWN_PLATFORM:
              adi_hal_HwOpen = NULL;
              adi_hal_HwClose         = NULL;
              adi_hal_HwReset         = NULL;
              adi_hal_DevHalCfgCreate = NULL;
              adi_hal_DevHalCfgFree   = NULL;
              adi_hal_HwVerify = NULL;
      
              adi_hal_SpiInit              = NULL; /* TODO: remove?  called by HwOpen() */
              adi_hal_SpiWrite             = NULL;
              adi_hal_SpiRead              = NULL;
              adi_hal_CustomSpiStreamWrite = NULL;
              adi_hal_CustomSpiStreamRead  = NULL;
      
              adi_hal_LogFileOpen  = NULL;
              adi_hal_LogLevelSet  = NULL;
              adi_hal_LogLevelGet  = NULL;
              adi_hal_LogWrite     = ads8_LogWrite;
              adi_hal_LogFileClose = NULL;
      
              adi_hal_Wait_us = NULL;
              adi_hal_Wait_ms = NULL;
      
              /* only required to support the ADI FPGA*/
              adi_hal_BbicRegisterRead   = ads8_BbicRegisterRead;
              adi_hal_BbicRegisterWrite  = ads8_BbicRegisterWrite;
              adi_hal_BbicRegistersRead  = ads8_BbicRegistersRead;
              adi_hal_BbicRegistersWrite = ads8_BbicRegistersWrite;
              break;
    2. Should these functions be implemented (in ourPlatform_init.c) based on/similar to the functions for the ADI platform - ADS9 (ads9_init.c)?
    3. Would it be appropiate to implement ourPlatform_logging.c, ourPlatform_spi.c, ourPlatform_timer.c, ourPlatform_bbic_control.c based on the scripts for ADI platform - ADS9?
    Please go through  the procedure from "SOFTWARE INTEGRATION PROCESS " section(page 10)  from UG 1727 .

    In addition, I read the SOFTWARE INTEGRATION chapter of UG-1727. In my opinion, it presents a general view of the procedure to use the provided API in a custom hardware/software environment. Honestly, I still do not understand how to properly carry it out.

    Best regards,

  • Does the necessary modifications to the adi_platform.c only regard the HAL layer? I mean, Does it only regard replacing NULL by our platform functions: ourPlatform_HwOpen, ourPlatform_HwClose, ourPlatform_HwReset, etc...?

    If you are using any other platform other than ads8 or ads9 , the modifications done are correct in the adi_hal_PlatformSetup() function  .

    Should these functions be implemented (in ourPlatform_init.c) based on/similar to the functions for the ADI platform - ADS9 (ads9_init.c)?

    Yes, correct .

    Would it be appropiate to implement ourPlatform_logging.c, ourPlatform_spi.c, ourPlatform_timer.c, ourPlatform_bbic_control.c based on the scripts for ADI platform - ADS9?

    Yes you should implement all the functions based on your platform used .

    In addition, I read the SOFTWARE INTEGRATION chapter of UG-1727. In my opinion, it presents a general view of the procedure to use the provided API in a custom hardware/software environment.

    Once the  Madura API's are integrated , you should be integrating all the transceiver specific files like stream, FW files , gain tables, profiles etc.

    Then Integrate the drivers in the  HAL layer and then try compiling and programming the chip .

    The below ADS9 Linux Application example build procedure document can be checked up for reference .

     https://ez.analog.com/rf/wide-band-rf-transceivers/design-support-adrv9026/w/documents 

  • If you are using any other platform other than ads8 or ads9 , the modifications done are correct in the adi_hal_PlatformSetup() function  .

    As I mentioned in the very first post, we would like to program the ADRV9026 which will be integrated in our custom/ad hoc board. Therefore, we will not use either ADS8 or ADS9 platform.

    case ADI_UNKNOWN_PLATFORM:
            adi_hal_HwOpen          	= carrier_HwOpen;
            adi_hal_HwClose         	= carrier_HwClose;
            adi_hal_HwReset         	= carrier_HwReset;
            adi_hal_DevHalCfgCreate 	= carrier_DevHalCfgCreate;
            adi_hal_DevHalCfgFree   	= carrier_DevHalCfgFree;
            adi_hal_HwVerify        	= carrier_HwVerify;
    
            adi_hal_SpiInit              = carrier_SpiInit; /* TODO: remove?  called by HwOpen() */
            adi_hal_SpiWrite             = carrier_SpiWrite;
            adi_hal_SpiRead              = carrier_SpiRead;
            adi_hal_CustomSpiStreamWrite = NULL;
            adi_hal_CustomSpiStreamRead  = NULL;
    
            adi_hal_LogFileOpen  		= NULL;
            adi_hal_LogLevelSet			= NULL;
            adi_hal_LogLevelGet  		= NULL;
            adi_hal_LogWrite     		= NULL;
            adi_hal_LogFileClose 		= NULL;
    
            adi_hal_Wait_us 			= carrier_TimerWait_us;
            adi_hal_Wait_ms 			= carrier_TimerWait_ms;
    
            /* only required to support the ADI FPGA*/
            /*adi_hal_BbicRegisterRead   = ads8_BbicRegisterRead;
            adi_hal_BbicRegisterWrite  = ads8_BbicRegisterWrite;
            adi_hal_BbicRegistersRead  = ads8_BbicRegistersRead;
            adi_hal_BbicRegistersWrite = ads8_BbicRegistersWrite;*/
            break;

    Moreover, I would like to know if I understood correctly: 

    Should adi_hal_PlatformSetup() function look like this? Where "carrier" refers to our board.

    Should our HAL functions (carrier_HwOpen, _HwClose, _HwReset, _DevHalCfgCreate, _DevHalCfgFree, _HwVerify, _SpiInit, _SpiWrite, _SpiRead, _TimerWait_us, _TimerWait_ms) be implemented based on our board's HDL design, but following the structure of ADI's ADS8/9 HAL functions?

    Are the files inside the "platform" and "app" folder the only ones to be modified for the ADI's API to work with our custom/ad hoc boardI am asking this because some variables inside ADS8/9 HAL functions depend on other .c/.h files outside the aforementioned folders. For instance, halCfg->spiCfg.interfaceEnabled is initialized in adi_motherboard_trx.c and evaluated in ads9_init.c.

  • , we would like to program the ADRV9026 which will be integrated in our custom/ad hoc board. Therefore, we will not use either ADS8 or ADS9 platform.

    Yes, you should give your platform specific file name instead of ADS9 or ADS8 platform .

    (carrier_HwOpen, _HwClose, _HwReset, _DevHalCfgCreate, _DevHalCfgFree, _HwVerify, _SpiInit, _SpiWrite, _SpiRead, _TimerWait_us, _TimerWait_ms) be implemented based on our board's HDL design, but following the structure of ADI's ADS8/9 HAL functions?

    You should be implementing all the HAL layer functions following the structure of your custom board but not the ads8/ads9 platforms.

    Please follow the API initialization setup document which provides brief understanding on the custom integration.

    PDF