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.

Wheher I can call HWI_enter in SWE handler?

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

Hi experts:

When I reading the document spru403n.pdf<<TMS320C6000 DSP/BIOS 5.31 Application Programming Interface (API) Reference Guide>>

I got following pieces of information. but not clean on the reasion, Not sure whether you can explain more.

        1. Do not call HWI_enter, HWI_exit, or any other DSP/BIOS functions
from a non-maskable interrupt (NMI) service routine.

 (question1: Software-generated exceptions. System calls that generate a SWE instruction are treated as exceptions. this exception share the same vector to NMI exception, whether we can call HWI_enter /HWI_exit in SWE handler?)

 (question2: could you explain on more detail on why HWI_enter /HWI_exit can not be called from NMI handler ?)

        due to details of the ’C6000 architecture, NMI disrupts the
code it interrupts to the point that it cannot be returned to. Therefore,
NMI should not be used to respond to run-time events. NMI should
be used only for exceptional processing that does not return to the
code it interrupted.

 (question3: Whether it is possible to return from SWE exception?)
 (question4: If I dynamically change one DSP code instruction to SWE instruction, then whe program execute to this instruction, a SWE exception will be trigger, whether it is possible to safely return from this SWE exception?)

Thanks.

 

 

  • Qin Yungao,

    Which Single Core DSP device are you using?

    You mention an old version of TI-RTOS that makes me wonder if you should consider moving to a newer release. That is most likely not relevant to your immediate questions, except that this question could be better address in the TI-RTOS Forum. If you would like this thread moved ot the TI-RTOS Forum, please let me know and a Moderator will more it for you.

    The DSP/BIOS 5.xx API Reference Guide mentions the EXC_dispatch function which it says will make a special call for SWE exceptions. You may need to look at the source for EXC_dispatch that is provided with DSP/BIOS. You may want to search the API document for EXC_dispatch to learn of its uses.

    Q1. You will have to be very careful with the SWE handler. This should not be considered a place to do a lot of O/S-related processing. Please refer to the API Guide and the EXC_dispatch source code to figure out if an HWI_enter/exit sequence is needed.

    Q2. The C6000 architecture is an unprotected pipeline. There are critical code sections that improve performance by disabling interrupts and taking advantage of the unprotected pipeline. If an NMI occurs during that time, the unprotected code cannot be returned to and keep the execution sequence intact. That code execution will be corrupted.

    Q3. To do this, the best way will be to study the EXC_dispatch and learn from the CPU & Instruction Set Reference Guide. Technically, it is possible, but it is a very difficult thing that is obvious not well documented. That means you will either have to search the TI Wiki Pages and these forums for possible answers, or try things to get it to work well - which is not a safe thing to do.

    Q4. This does not sounds like a good idea. It is not completely clear what you are asking due to a typo and possible words missing. But dynamically changing an instruction to SWE does not sound like a good idea to me.

    Regards,
    RandyP

  • Hi RandyP:

    many thanks for your reply,

    we are using OMAP-L138 Low-Power Applications Processor, ( 300-MHz ARM926EJ-S™ RISC MPU, 300-MHz C674x VLIW DSP), whether this chip has the limitation you mentioned in Q2 ?

    I noticed from http://www.linux-c6x.org/wiki/index.php/Linux-c6x_2.0_Release, that linux 2.6.34 currently can running on C6x processor, whether we can debug application with gdb or gdb/gdbserver on this envrionment ?  

     

    If C6000 architecture is an unprotected pipeline, execution may be corrupted after returning from NMI.
    how it instrument breakpoint ?

    as I know gdb will place a invalid instruction at the address of the breakpoint if so when the breakpoint is hit, how it can safely return from breakpoint ?

    Thanks in advance.

  • Qin Yungao,

    If you want to use Linux with the DSP of the OMAP-L138, you will want to post your question on the E2E Linux forum. I have never heard of anyone wanting to use Linux on the DSP side of the OMAP-L138, but many people use Linux on the ARM926 side of the OMAP-L138. I recommend against doing this, but it is my understanding that there is an embedded version of Linux that does run on the C674x DSP. You may find information on this on the TI Wiki Pages or elsewhere on the E2E forums.

    If you want to learn how to use the TI-supplied CCS debugger, please look to the training material on the TI Wiki Pages. You can search for "OMAPl138 training" (no quotes) to find a workshop that has been archived onto the TI Wiki Pages for you to access. This will show you how to use the tools.

    Regards,
    RandyP

  • Hi RandyP:

    Thanks for you prompt reply and suggestions. I will redirect my qurestion related to linux to E2E Linux forum.