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.

a simple question

Hello, I am a newbie, and currently I have a simple question. I tried to google but found no help.

so basically I have some source code

http://sranger.cvs.sourceforge.net/viewvc/sranger/SRanger/TiCC-project-files/MK3-A810_spmcontrol/

they should be compiled to make a .out file, which then will be loaded into the firmware of

http://www.softdb.com/dsp-products-MK3-PLL.php

I have all these at hand.

And now I am reading the c6000 user's guide. But I am quite confused where to get started?Where can I type the 'cl6x'  command in and compile the code I have? Currently I am working on a ubuntu system. Any detailed tutorial will be of great use.

I guess it is

http://www.ti.com/dsp/docs/dspcontent.tsp?contentId=70830

but the link is not good.

Thanks.

  • Hello,

    If you are willing to use CCS, you can create a CCS project and add the files to the project and have CCS build it. CCS will then call all the necessary build tools (like cl6x) for you. CCSv5.2 supports Linux and has been tested on Ubuntu.

    Since you are new to CCS, I suggest you study the CCSv5 Getting Started Guide:

    http://processors.wiki.ti.com/index.php/CCSv5_Getting_Started_Guide

    The CCSv5 Fundamentals workshop is also useful. Look at the one for C2000. To do the hands-on part, you need a F28069 but I suggest you just read the slides. It is still useful even if you don't do the lab part. While the workshop shows using a C2000 device, most of the concepts you learn apply for all devices.

    http://processors.wiki.ti.com/index.php/CCSv5_Fundamentals_Workshop

    Thanks

    ki

  • Thanks very much.

    I found the board I am using relates to

    http://www.softdb.com/dsp-products-SR-MK3-PRO.php

    so I choose the C6424 board.

    In building it, there come a lot of errors, most of which is from an assembly file.

    I am wondering if that is because I didn't get the correct board for the project.

    Thanks.

  • Can you post the error messages?

  • Here's the two situations I have come across.

    1. When I tried to build in CCS, and I select C6424 and after compiling,

    **** Build of configuration Debug for project spm_control ****

    /opt/ti/ccsv5/utils/bin/gmake -k all
    Building file: ../mul32.asm
    Invoking: C6000 Compiler
    "/opt/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mv64+ -g --define=c6424 --include_path="/opt/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="mul32.pp"  "../mul32.asm"
    "../mul32.asm", ERROR!   at line 22: [E0002] Illegal mnemonic specified
            .mmregs

    "../mul32.asm", ERROR!   at line 31: [E0002] Illegal mnemonic specified
            .ARMS_off                     ;enable assembler for ARMS=0
    48 Assembly Errors, No Assembly Warnings


    >> Compilation failure
    "../mul32.asm", ERROR!   at line 32: [E0002] Illegal mnemonic specified
            .CPL_on                       ;enable assembler for CPL=1

    All errors in an assemble file below.

    ;***********************************************************
    ; Version 2.40.00
    ; Modified by Alex Boudreau
    ;    - Bug: The AR5 register was set to zero by the function and following the register conventions
    ;           of the C runtime, AR5 must be preserved by the child. The AR5 was not used anyway in the rest
    ;           of the function...
    ;    - T3 was not preserved by the function. Save and restore operations have been added.
    ;                                                                        
    ;***********************************************************
    ; Function:    mul32
    ; Processor:   C55xx
    ; Description: Implements a vector add using a single-MAC
    ;              approach.  This routine is C-callable.
    ; fixed description -- P.Zahl
    ; Usage: ushort oflag = mul32 (LDATA *x,
    ;                              LDATA *y,
    ;                              LDATA *r,
    ;                              ushort nx)
    ;
    ;****************************************************************

        .mmregs

        .asg    ar0, ar_x  ; used for mul32
        .asg    ar1, ar_y
        .asg    ar2, ar_z

        .asg     T0, oflag            ;returned value

    ;*****************************************************************************
        .ARMS_off                     ;enable assembler for ARMS=0
        .CPL_on                       ;enable assembler for CPL=1
        .mmregs                       ;enable mem mapped register names

        .global    _mul32
        .even
        .text

    _mul32:

          PSH    mmap(ST0_55)
          PSH    mmap(ST1_55)
          PSH    mmap(ST2_55)  
          PSH    mmap(ST3_55)
          PSH   mmap(T3)

    ;
    ; Configure the status registers as needed.
    ;----------------------------------------------------------------

          AND #01FFh,mmap(ST0_55)       ;clear all ACOVx,TC1, TC2, C
          OR #4140h,mmap(ST1_55)        ;set CPL, SXMD, FRCT
          AND #0F9DFh,mmap(ST1_55)       ;clear M40, SATD, 54CM
          AND #07A00h,mmap(ST2_55)       ;clear ARMS, RDM, CDPLC, AR[0-7]LC
          AND #0FFDDh,mmap(ST3_55)       ;clear SATA, SMUL
      ; Setup passed parameters in their destination registers
    ; Setup circular/linear CDP/ARx behavior
    ;----------------------------------------------------------------

    ; x pointer - passed in its destination register, need do nothing

    ; y pointer - - passed in its destination register, need do nothing

    ; r/z pointer - passed in its destination register, need do nothing
        
        MOV mmap(T0),AC0      ;RPTB count
        SUB     #1, AC0
        MOV        AC0, mmap(BRC0)              

         MOV    #0,    T3
         MOV #2,T0           ; for indexing
         MOV #3,T1           ; for indexing

    ;
    ;     mpy    *ar_x+,a        ; a = 0 and XH adjustment
        MPYM     *ar_x+, T3, AC0  

        ; long data are stored in XH[0],XL[0], XH[1],XL[1], XH[2],XL[2], ...
        rptblocal    _eloop-1         ;                    
          
    *    macsu    *ar_x-,*ar_y+,a     ; a  = XL*YH    (1)
        MPYM    uns(*ar_x-), *ar_y+, AC0

    *    macsu    *ar_y-,*ar_x,a        ; a += XH*YL    (1)
        MACM    *ar_x, uns(*ar_y-), AC0
         
    *    ld    a,-16,a         ; a >>= 16                
    *    mac    *ar_x+0%,*ar_y+0%,a    ; a += XH*YH        (1)
        MACM     *(ar_x+T1), *(ar_y+T0), AC0 >> #16
        
    *    st    a,*ar_z+ || ld *ar_zero,t;                (1)
    *    stl    a,*ar_z+        ;                        
        MOV    AC0, dbl(*ar_z+);                                         Total loop cycles = 4

    _eloop:

    ;
    ; Check if overflow occurred, and setup return value
    ;----------------------------------------------------------------

        MOV    #0, oflag        ;clear oflag

        XCCPART    _check1, overflow(AC0)    ;clears ACOV0
        ||MOV    #1, oflag        ;overflow occurred

    _check1:

          POP    mmap(T3)
          POP    mmap(ST3_55)
          POP    mmap(ST2_55)
          POP    mmap(ST1_55)
          POP    mmap(ST0_55)
        RET

    ;end of file. please do not remove. it is left here to ensure that no lines of code are removed by any editor

    2. I tried to read the Makefile in the folder, ( as I didn't install the TI in /opt/, I changed the first three lines with the correct directory in my machine)

    C6X_C_DIR   = /opt/ti/bios_5_41_13_42/packages/ti/bios/include
    C6X_LIB_DIR = /opt/ti/bios_5_41_13_42/packages/ti/bios/lib
    C6X_BIN_DIR = /opt/ti/ccsv5/tools/compiler/c6000_7.3.4/bin



    C            = $(C6X_BIN_DIR)/./cl6x
    CL           = $(C6X_BIN_DIR)/./lnk6x
    CS           = $(C6X_BIN_DIR)/./strip6x
    CFLAGS       = -O3 -mv 6400+ --mem_model:const=far --mem_model:data=far -i $(C6X_C_DIR) -c
    CLFLAGS      = --stack_size=0x1000 -i $(C6X_LIB_DIR) -c
    LIBS         = CMD_SR3.cmd SR3PRO_A810Driver.lib PAC_pll.lib

    C_OBJECTS = FB_spm.obj dataprocess.obj \
        FB_spm_statemaschine.obj \
        FB_spm_areascan.obj FB_spm_offsetmove.obj \
        FB_spm_autoapproach.obj FB_spm_probe.obj \
        FB_spm_CoolRunner_puls.obj FB_spm_dsoszi.obj \
        spm_log.obj \
        ReadWrite_GPIO.obj

    ASM_OBJECTS = LogAsmSR3Pro.obj timerasm.obj vector.obj

    FB_spmcontrol.out: $(C_OBJECTS) $(ASM_OBJECTS) $(LIBS)
        @echo
        @echo binding objects...
        $(CL) $(CLFLAGS) $(C_OBJECTS) $(ASM_OBJECTS) $(LIBS) -m FB_spmcontrol.map -o FB_spmcontrol.out
    #    @echo
    #    @echo stripping debug info from FB_spmcontrol.out...
    #    @echo $(CS) FB_spmcontrol.out
        @echo
        @echo FB_spmcontrol.out is ready to load into the DSP.
        @echo

    $(C_OBJECTS) : dataprocess.h  FB_spm_analog.h  FB_spm_dataexchange.h  FB_spm.h  FB_spm_statemaschine.h

    $(C_OBJECTS): %.obj: %.c
        $(C) -c $(CFLAGS) $<

    $(ASM_OBJECTS): %.obj: %.asm
        $(C) -c $(CFLAGS) $<

    # .PHONY : load
    # load: FB_spmcontrol.out
    #     ln -sf ../../loadusb64/kernel.out .
    #     ../../loadusb64/loadusb FB_spmcontrol.out

    .PHONY : clean
    clean :
        rm -f ${C_OBJECTS} ${ASM_OBJECTS} FB_spmcontrol.out FB_spmcontrol.map

    When I tried to type

    make FB_spmcontrol.out

    errors come as

    binding objects...
    /opt/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/./lnk6x --stack_size=0x1000 -i /opt/ti/bios_5_41_13_42/packages/ti/bios/lib -c FB_spm.obj dataprocess.obj FB_spm_statemaschine.obj FB_spm_areascan.obj FB_spm_offsetmove.obj FB_spm_autoapproach.obj FB_spm_probe.obj FB_spm_CoolRunner_puls.obj FB_spm_dsoszi.obj spm_log.obj ReadWrite_GPIO.obj LogAsmSR3Pro.obj timerasm.obj vector.obj CMD_SR3.cmd SR3PRO_A810Driver.lib PAC_pll.lib -m FB_spmcontrol.map -o FB_spmcontrol.out
    warning: automatic RTS selection:  attempt to automatically link in index
       library "libc.a" failed; file not found
    warning: entry-point symbol "_c_int00" undefined

     undefined first referenced              
      symbol       in file                   
     --------- ----------------              
     __divi    dataprocess.obj               
     __divli   PAC_pll.lib<SR3PRO_PLLAPI.obj>

    error: unresolved symbols remain
    warning: no suitable entry-point found; setting to 0
    error: errors encountered during linking; "FB_spmcontrol.out" not built
    make: *** [FB_spmcontrol.out] Error 1
    caven@dethklok:~/workspace_v5_2/spm_control$

    This FB_spmcontrol.out is the only to be made and put into the firmware. I tried to google, someone say it is because the proper library is not linked.

    Thanks.

  • You are feeding a C5500 assembly file to the C6000 compiler, which cannot work.  If you must use that assembly file, you must use C5500.  If you must use the C6000 compiler, you need a different assembly file.