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.

Example C67x code for SWI / TRAP

I found the SWI TRAP Initialization, declarartion and calling for using Chip Support Library in the forum but I don't use DSP BIOS and CSL.

Where can I find the example code not using CSL to setup SWI table and enable it? Thanks.

I have DSP TMSC32C6726B and CCS 5.3.

 

  • Hi Joshua,

    As per my knowledge we do not have other then CSL based example projects for C672x Devices.
    Which you can download from below mentioned link.
    http://www.ti.com/tool/sprc223

    But for reference you can check with C674x starterware example projects and can develop your own code.

    You can download starterware projects from below mentioned link.
    processors.wiki.ti.com/.../StarterWare
  • Joshua,

    Where did you find the references that you mentioned that call for CSL? I would like to understand the context of your concerns.

    Normally speaking, SWI is a creation of DSP/BIOS, so it by definition only exists within DSP/BIOS and not otherwise.

    If what you have found uses CSL, there is no reason I know of to avoid using CSL. It is just a collection of functions that you can use. There is no other overhead associated with pure CSL. In fact, you can just pull out a single function that you want to use and add that code to your own project as source code.

    With your references, perhaps I will understand better what you have seen and found, and what feature of the C6726 you are trying to use.

    Regards,
    RandyP
  • Hi Randy,

    I found that in a thread in DSP Forum. Below is my note from reading the thread. Not sure it is usisng CSL. It is not clear to me where I could register SWI as I did for interrup vector table. Is the following all I need to create a SWI and use it without DSP/BIOS? Thanks.

     

    SWI TRAP Initialization:

      IRQ_clear(SINT31_EVENT);

      IRQ_plug(SINT31_EVENT, &SWI31Routine);

      IRQ_enable(SINT31_EVENT);

    The interrupt routine has to be declared with interrupt keyword:

    interrupt void SWI31Routine(void)

    {...}

    Calling the interrupt routine:

      asm(" INTR #31");

    or

      asm(" TRAP #31");*/

    Joshua

  • Joshua,

    Sorry, but I cannot comment on an unknown thread somewhere in the forum. Without context for this, I cannot know how to clarify or correct anything.

    In the C67x+ CPU & Instruction Set Reference Guide, I did not find either the INTR or the TRAP assembly instructions. Either I missed them in my search or the code you show is not for the DSP you are using.

    IRQ_xxxx() functions are CSL functions.

    If you are not using an OS like TI-RTOS, what do you need an SWI to do? What problem are you trying to solve that would not be solved by calling a function instead of defining it to be an SWI and then calling it?

    Regards,
    RandyP
  • Randy,

    The place to call SWI or a function is in a interrupt service routine.
    I want to minimize the ISR as small as possible. If I call a function it will finish the function before end of the ISR. If I trigger a SWI I can leave ISR and program counter would jump into SWI afterwards. Is there any way to solve that regardless with or without SWI. Thanks.
  • Joshua,

    What you need is TI-RTOS (SYS/BIOS). That is exactly the scheduler that is the fundamental nature of an O/S, and TI-RTOS is a simple, configurable O/S that will do exactly what you need.

    Otherwise, you will have to write your own scheduler. But I strongly recommend you re-look at using TI-RTOS and get your project built and running. The time you save will be considerable.

    There is no instruction that will implement this feature.

    Regards,
    RandyP