Post Go back to editing

ADRV9026 in internal digital loopback not working

Category: Software
Product Number: ADRV9026
Software Version: Windows 11 (64-bit); Vivado/Vitis 2022.2; Petalinux 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 getting the following error while trying to configure the ADRV9026 in digital internal loopback (De-framer -> Framer):

Connecting
Connected
SPI Write Address 0x6689: 0xd5
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseUInt32(String value, NumberStyles options, NumberFormatInfo numfmt)
   at adrv9010_dll.SubClasses.Adrv9010Hal.SpiByteRead(UInt16 addr, Byte& readdata)
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at Adi.Tpg.IronPythonWindow.ScriptHost.Execute(String expression)

The testing-setup is the following:

Loop-back testing-setup

We took the script shared by PVALAVAN in the following post: Link

Incidentally, we only modified it such that the value to be written was 0xD5 (for setting up the desired configuration). The Iron Python code is the following:

#################################################################################
#GUI Version: 5.0.0.76
#DLL Version: 5.0.0.57
#Cmd Server Version: 5.0.0.57
#FPGA Version: 0xD9000007
#ARM Version: 5.0.0.32(ADI_ADRV9025_ARMBUILD_TESTOBJ)
#StreamVersion: 8.0.0.5
#################################################################################

#Import Reference to the DLL
import System
import clr
import time
from System import Array
clr.AddReferenceToFileAndPath("C:\\Program Files\\Analog Devices\\ADRV9025 Transceiver Evaluation Software_x64_FULL\\adrvtrx_dll.dll")
from adrv9010_dll import AdiEvaluationSystem
from adrv9010_dll import Types
from adrv9010_dll import Ad9528Types

def spiRead(address):
    data = adrv9010.Hal.SpiByteRead(address, 0)
    print "SPI Read Address " + hex(address) + ": " + hex(data[1])

def spiWrite(address, data):
    adrv9010.Hal.SpiByteWrite(address, data)
    print "SPI Write Address " + hex(address) + ": " + hex(data)

#Create an Instance of the Class
link = AdiEvaluationSystem.Instance	
connect = False

if (link.IsConnected() == False):
    connect = True
    link.platform.board.Client.Connect("192.168.10.10", 22) 
    print "Connecting"

if (link.IsConnected()):
    adrv9010 = link.Adrv9010Get(1)
    print "Connected"
    ##### YOUR CODE GOES HERE #####

    #spiWrite(0x6689, 0x29)
    spiWrite(0x6689, 0xD5)
    #print spiRead(0x6689)
    spiRead(0x6689)
else:
    print "Not Connected"

if (connect):
    link.platform.board.Client.Disconnect()
    print "Disconnected"

It seems there is an error regarding the function adrv9010.Hal.SpiByteRead(address, 0) which we are still trying to solve.

In addition, since the spiWrite(0x6689, 0xD5) cmd. seemed to run properly, we disregarded the spiRead(0x6689) cmd. to test the loop-back, but no data (‘0’s) was observed at the FPGA’s framer. Hence, it led us to think that the loop-back was not properly configured.

It is worth noting that the ADRV9026’s initialization was completed successfully. Moreover, the JESD204B Rx & Tx links were properly brought up. The deframer 0 status was 0x87 and framer 0 status was: [status|framerSyncNeCount|qbfStateStatus|syncNSel] = [A|4|D|0].

We would appreciate any suggestion.



Iron Python code was added
[edited by: JNPH at 3:43 PM (GMT -4) on 11 Oct 2024]
  • Please check with this:

    #################################################################################
    #GUI Version: 5.0.0.76
    #DLL Version: 5.0.0.57
    #Cmd Server Version: 5.0.0.57
    #FPGA Version: 0xD9000007
    #ARM Version: 5.0.0.32(ADI_ADRV9025_ARMBUILD_TESTOBJ)
    #StreamVersion: 8.0.0.5
    #################################################################################
    
    #Import Reference to the DLL
    import System
    import clr
    import time
    from System import Array
    clr.AddReferenceToFileAndPath("C:\\Program Files\\Analog Devices\\ADRV9025 Transceiver Evaluation Software_x64_FULL\\adrvtrx_dll.dll")
    from adrv9010_dll import AdiEvaluationSystem
    from adrv9010_dll import Types
    from adrv9010_dll import Ad9528Types
    
    def spiRead(address):
        data = adrv9010.Hal.SpiByteRead(address, 0)
        print "SPI Read Address " + hex(address) + ": " + hex(data[1])
    
    def spiWrite(address, data):
        adrv9010.Hal.SpiByteWrite(address, data)
        print "SPI Write Address " + hex(address) + ": " + hex(data)
    
    #Create an Instance of the Class
    link = AdiEvaluationSystem.Instance	
    connect = False
    
    if (link.IsConnected() == False):
        connect = True
        link.platform.board.Client.Connect("192.168.1.10", 55556) 
        print "Connecting"
    
    if (link.IsConnected()):
        adrv9010 = link.Adrv9010Get(1)
        print "Connected"
        ##### YOUR CODE GOES HERE #####
    
        spiWrite(0x6689, 0x29)
        spiRead(0x6689)
    
    else:
        print "Not Connected"
    
    if (connect):
        link.platform.board.Client.Disconnect()
        print "Disconnected"

  • We tried the loop-back with the provided script, but unfortunately it did not work. It is worth noting that the IPv4 and port used were "192.168.10.10" and "22" (SSH) because our board is a custom-made one (which is connected via ethernet to the PC) instead of an ADI evaluation one. Moreover, the same error was issued upon running the code: 

    Connecting
    Connected
    SPI Write Address 0x6689: 0x29
    System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseUInt32(String value, NumberStyles options, NumberFormatInfo numfmt)
       at adrv9010_dll.SubClasses.Adrv9010Hal.SpiByteRead(UInt16 addr, Byte& readdata)
       at CallSite.Target(Closure , CallSite , CodeContext , Object , Object , Object )
       at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
       at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
       at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
       at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
       at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
       at Adi.Tpg.IronPythonWindow.ScriptHost.Execute(String expression)

    I was wondering if there is a way to set the TRx in internal digital loop-back through the API instead of Iron Python.

  • I would like to mention that we have tried to use the following functions without success:

    • adrv9010.Control.ProductIdGet() -> Error: System.FormatException: Input string was not in a correct format.
    • adrv9010.Tx.TxAttenGet() -> Error: System.FormatException: Input string was not in a correct format.
    • adrv9010.DataInterface.DeframerStatusGet() -> Error: System.ArgumentException: respString parameter did not have enough comma separated values to correctly parse
    • adrv9010.RadioCtrl.RxTxEnableGet() -> Error: System.ArgumentException: respString parameter did not have enough comma separated values to correctly parse

    Here is our code: test_ADRV9026conn.py

    We are not sure whether these errors are related to the ADRVTRX Eval. Soft. because we got a few errors during the installation:

    Error 1Error 2

  • Please provide the FPGA details used in your setup?

    Are you using the ADRV9026 -SDCARD image from here ADRV9029 Datasheet and Product Info | Analog Devices

    adrv9010.Hal.SpiByteRead(address, 0) which we are still trying to solve.

    Could you please try writing and reading from Scratch pad register 0x00A multiple iterations to check SPI functionality.

  • Are you using the ADRV9026 -SDCARD image from here

    No, we are not. Since our board is custom-made (as mentioned in a previous reply), we are using our own SD card featuring Petalinux. It is worth mentioning that we imported all necessary files regading the ADI API into Vitis for building and launching the application.

    As long as we use the API, we are able to initialize, configure and monitor the transciever. Therefore, we are pretty sure the SPI is up and running properly.

    Could you please try writing and reading from Scratch pad register 0x00A multiple iterations to check SPI functionality.

    The very same error was issued when we tried to read the indicated register. A time.sleep(0.5) cmd. was added after both the spiWrite() and spiRead() ones, although they are not shown in the code below. In fact, they were removed because strangely the time.sleep() cmd. was not allowed to be present in the inserted code.

    Code:

    #################################################################################
    #GUI Version: 6.4.0.17
    #DLL Version: 6.4.0.14
    #Cmd Server Version: 
    #FPGA Version: Not Connected
    #ARM Version: Not Connected
    #StreamVersion: 9.4.0.1
    #################################################################################
    
    #Import Reference to the DLL
    import System
    import clr
    import time
    from System import Array
    clr.AddReferenceToFileAndPath("C:\\Program Files\\Analog Devices\\ADRV9025 Transceiver Evaluation Software_x64_FULL\\adrvtrx_dll.dll")
    from adrv9010_dll import AdiEvaluationSystem
    from adrv9010_dll import Types
    from adrv9010_dll import Ad9528Types
    
    def spiRead(address):
        data = adrv9010.Hal.SpiByteRead(address, 0)
        print "SPI Read Address " + hex(address) + ": " + hex(data[1])
    
    def spiWrite(address, data):
        adrv9010.Hal.SpiByteWrite(address, data)
        print "SPI Write Address " + hex(address) + ": " + hex(data)
    
    #Create an Instance of the Class
    link = AdiEvaluationSystem.Instance
    connect = False
    
    if (link.IsConnected() == False):
        connect = True
        #link.platform.board.Client.Connect("192.168.1.10", 55556)
        link.platform.board.Client.Connect("192.168.10.10", 22)
        print "Connecting"
    
    if (link.IsConnected()):
        adrv9010 = link.Adrv9010Get(1)
        print "Connected"
        ##### YOUR CODE GOES HERE #####
        
    	for i in range(10):
    		spiWrite(0x00A, i+1)
    		spiRead(0x00A)
    
    else:
        print "Not Connected"
    
    if (connect):
        link.platform.board.Client.Disconnect()
        print "Disconnected"

    Issued error:

    Connecting
    Connected
    SPI Write Address 0xa: 0x1
    System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseUInt32(String value, NumberStyles options, NumberFormatInfo numfmt)
       at adrv9010_dll.SubClasses.Adrv9010Hal.SpiByteRead(UInt16 addr, Byte& readdata)
       at CallSite.Target(Closure , CallSite , CodeContext , Object , Object , Object )
       at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
       at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
       at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
       at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
       at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
       at Adi.Tpg.IronPythonWindow.ScriptHost.Execute(String expression)

    Moreover, the "System.Net.Sockets.SocketException (0x80004005): An established connection was aborted by the software in your host machine" error was issued, when we tried to write the indicated register more than two times.

    Code:

    #################################################################################
    #GUI Version: 6.4.0.17
    #DLL Version: 6.4.0.14
    #Cmd Server Version: 
    #FPGA Version: Not Connected
    #ARM Version: Not Connected
    #StreamVersion: 9.4.0.1
    #################################################################################
    
    #Import Reference to the DLL
    import System
    import clr
    import time
    from System import Array
    clr.AddReferenceToFileAndPath("C:\\Program Files\\Analog Devices\\ADRV9025 Transceiver Evaluation Software_x64_FULL\\adrvtrx_dll.dll")
    from adrv9010_dll import AdiEvaluationSystem
    from adrv9010_dll import Types
    from adrv9010_dll import Ad9528Types
    
    def spiRead(address):
        data = adrv9010.Hal.SpiByteRead(address, 0)
        print "SPI Read Address " + hex(address) + ": " + hex(data[1])
    
    def spiWrite(address, data):
        adrv9010.Hal.SpiByteWrite(address, data)
        print "SPI Write Address " + hex(address) + ": " + hex(data)
    
    #Create an Instance of the Class
    link = AdiEvaluationSystem.Instance
    connect = False
    
    if (link.IsConnected() == False):
        connect = True
        #link.platform.board.Client.Connect("192.168.1.10", 55556)
        link.platform.board.Client.Connect("192.168.10.10", 22)
        print "Connecting"
    
    if (link.IsConnected()):
        adrv9010 = link.Adrv9010Get(1)
        print "Connected"
        ##### YOUR CODE GOES HERE #####
        
    	for i in range(10):
    		spiWrite(0x00A, i+1)
    		# spiRead(0x00A)
    
    else:
        print "Not Connected"
    
    if (connect):
        link.platform.board.Client.Disconnect()
        print "Disconnected"

    Issued error:

    Connecting
    Connected
    SPI Write Address 0xa: 0x1
    SPI Write Address 0xa: 0x2
    System.Net.Sockets.SocketException (0x80004005): An established connection was aborted by the software in your host machine
       at AdiCmdServerClient.CmdServerClient.Query(String writeString)
       at adrv9010_dll.SubClasses.Adrv9010Hal.SpiByteWrite(UInt16 addr, Byte data)
       at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
       at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
       at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
       at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
       at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
       at Adi.Tpg.IronPythonWindow.ScriptHost.Execute(String expression)

    We tend to think these errors suggest that it might not be possible to use Iron Python for completely configure and monitor the transceiver in our specific case.

  • Can you try running a basic script printing "Hello world" using Iron python in your setup and confirm that the environment is fine?

  • Upon running the suggested basic script, we concluded the environment was working just fine.Hello World

  • Is there any new update here?

    Can you try writing a different register and readback if its successful?

  • We got the very same errors as before. We continue to be unable to use Iron Python for completely configure and monitor the transceiver in our specific case and custom board.