This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE7950: where to find the "spi_convert.py"?

Part Number: AFE7950
Other Parts Discussed in Thread: LMK04828

Tool/software:

hello

      sbau412a said that,    In the AFE79xx Secure folder you can find a script called ‘SPI_Convert.py’, which is used to convert the generated SPI logs into the correct format. This script should be opened in the AFE79xx GUI and after running the script two files called ‘AFEspiwrites.c’ and ‘LMKspiwrites.c’ will be generated.

      but I can't find that script. can you send me one?

  • hello

           I found latte v2.60 finished the converstion from log file to C file. but the LMK04828 spi initial code can not found.

  • Hi Xiao,

    To enable logging of the LMK register writes you can add the below code to the end of your LMK configuration script. Then once you have generated the file you can use the additional code below to convert the LMK SPI writes.

    Enable LMK Logging: 

    lmklogDumpInst=mLogDump.logDump(ASTERIX_DIR+DEVICES_DIR+r"\Afe79xxPg1lmk.txt")

    lmklogDumpInst.logFormat=0x1 

    lmk.logClassInst = lmklogDumpInst

    lmk.rawWriteLogEn=1

    LMK SPI Write Convert: 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    inpFile = open(ASTERIX_DIR+DEVICES_DIR+r"\Afe79xxPg1lmk.txt",'r') #Path and filename for Latte's dump file
    lines = inpFile.readlines()
    f2 = open(DEVICES_DIR+r"\LMKspiwrites.txt",'w') #Path and filename for SPI output file
    lineNo = 1
    for line in lines:
    if line[0]=='S':
    if line[3]=='W': #SPIWrite
    addr = int(line[8:13],16)
    data = int(line[14:16],16)
    f2.write("\tLMK04828_RegWrite(0x%x,0x%x);\n"%(addr,data))
    lineNo=lineNo+1
    f2.write('\n')
    inpFile.close()
    f2.close()
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    David Chaparro