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.

entry point determination.

Other Parts Discussed in Thread: CCSTUDIO

I am using a C5502 in CCS4.  I would like to use the rom bootloader to download an image via the HPI.  In spru911c page 13, the final thing you need to do is write the entry point of your exe to 0x60/61.

How do you determine you entry point address?

I have set up my vector table to byte address 300.  Is the relocatable vector table address changed in the cinit code before jumping to main? Or do I have to worry about changing this?

Thanks,

Robert

  • I get my entry point address from the .MAP file produced during the compile.  I think you can set the linker options to create this file if you don't have it.

    I use the C28xx, so I think my vector table experience may not apply: the vector table location is determined by the VMAP, M0M1MAP, and ENPIE setting combination according to my "System Control and Interrupts Reference Guide"

  • Robert,

    The entry point is where in your code you want execution to start from when the DSP starts executing.  Typically this will be where your Reset vector is pointing.  In most applications (unless you need to do some special HW configuration) you would point to _c_int00 which is the boot function in the RTS library.

    Regards.

  • Hi TommyG,

    Thanks for the confermation.  I did look in the .map and saw it glaring in my face on the 7th line.  I also verifed that the jump address was in the reset vector of the interrupt table which I have relocated to 0x200 and 0x300 byte address.  So I am good to go there.

    One additional question, does _c_int00 set up the stack pointer and adjust the core registers for the relocatable interrupt vector table address?  I under stand that out of reset, the vector table pointer registers are pointing to ROM in the 0xFFFF00 space.  Ie, in both my applications, I put the vector table at 0x200 and 0x300 byte address address.  I believe I can confirmed this by viewing the core registers after downloading the code, but the debugger does start out at main() and I guess executes from _c_int00 before giving control to the user.

    (Actually, I note that only the DSP/Bios build sets up the IVPD/H registers, and not the project that includes just the CSL and no DSP/Bios.  Ie, I have two builds, one with CSL and DSP/Bios which is the application, and one with just CSL which is the bootloader and they both live in memory space at the same time, but only one is executing)

    Thanks,

    Robert

  • Robert,

    You are correct that _c_int00 sets up stack and some of the CPU registers, but doesn't setup IVPD/H registers because it doesn't know where you want the vector table to be located.  That needs to be done by you.  You can see what the function does by looking at boot.asm in the RTS source release that comes with the compiler.  I am looking at CGT 4.3.6 in the rtssrc.zip file.

    You can start your code from anywhere you want by defining an entry point in the Build Options dialog under the Linker tab.

    You can program the IVPD/H either in your initialization code after you get to main(), or some people put the code in their vectors.asm file (or whatever you call it).  The vectors.asm approach is a good one if you want to preconfigure other HW (like EMIF for instance).  Here is an example of what I mean:

    ;**********************************************************************************
            .sect "vector"
            .align  256        
    ;**********************************************************************************

    ;****************************************************************************
    ;* Interrupt vector definitions go here
    ;****************************************************************************
     .def _RST
    _RST:  .ivec    reset_isr, USE_RETA; Reset / Software Interrupt #0
      etc.

    ;

    ****************************************************************************
    ;* Reset
    ;****************************************************************************

      .text
      .def reset_isr
      .ref _c_int00
      
            .align 2  
    reset_isr:
         @IVPD_L = #(_RST >> 8) || mmap()
         @IVPH_L = #(_RST >> 8) || mmap()
       

        OTHER STUFF

     goto _c_int00

     

  • This topic is closely tied to the vector initialization and stack pointer:

    http://processors.wiki.ti.com/index.php/55x_FAQ#How_do_I_change_stack_modes.3F

     

  • Dear Tommy,

    I am trying specify the entry point reset_isr but without sucess.

    First, I included on .cmd file the -e  reset_isr but the console shows the bellow error:

    undefined first referenced
      symbol       in file    
     --------- ----------------
     reset_isr

    error: unresolved symbols remain

    Second, I removed from my .cmd file and put it on Symbol Management: -entry_point, -e = reset_isr but the error still.

    Third, I tried both together but does not work.

    My link options are:

    -z -m"CSL_MMCSD_SdCardFSExtExample_Out.map" --warn_sections -i"C:/Arquivos de programas/Texas Instruments/ccsv4/tools/compiler/C5500 Code Generation Tools 4.3.7/lib" -i"C:/Arquivos de programas/Texas Instruments/ccsv4/tools/compiler/C5500 Code Generation Tools 4.3.7/include" -i"C:/Arquivos de programas/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/lib/c5500" -i"C:/Arquivos de programas/Texas Instruments/bios_5_41_02_14/packages/ti/bios/lib" -i"C:/Arquivos de programas/TMS320C55XXCSL-LOWPWR/c55xx_csl/ccs_v4.0_examples/cslVC5505" -i"C:/Arquivos de programas/TMS320C55XXCSL-LOWPWR/c55xx_csl/ccs_v4.0_examples/mmc_sd/CSL_MMCSD_SdCardFSExtExample" -i"c:/CCSTUD~1.3/C5500/csl/lib" -i"C:/CCStudio_v3.3/bios_5_31_02/packages/ti/rtdx/lib/c5000" --reread_libs --entry_point=reset_isr --rom_model

    My vectors.asm file is attached. I am using Code Generation Tools 4.3.7 on a c5515 ezdsp.

    4645.vectors.pdf

    Please, could you help me?

    Andrea

     

  • Andrea,

    I'm not an expert on this, and I've been working on other aspects of my own projects recently, but I compared what you posted to my own xxx.asm file and to my linker options and the things I think are the important parts look the same.

    The only thing I can think to ask is whether you are sure you performed "Project->Add Files to Active Project" in Code Composer Studio for vector.asm (or vectors.asm, whichever you named it).  If so, it should appear somewhere under your project name in the "C/C++ Projects" tab of CCS and should not be tagged as "[Excluded from build]".  Then, when you build the project, vector.asm should be referenced somewhere in Debug\Src\subdir.mk, where it gets assembled into vector.obj, and vector.obj should be referenced somewhere in Debug\makefile, where it gets linked in.  (If you performed "Project->Link Files to Active Project" into your project from a folder somewhere else, I think that subdir.mk and makefile may also be somewhere else; I'm not sure how that works.)

    Dan