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.

NDK2.0 Interrupts and events.

Other Parts Discussed in Thread: OMAPL138

Hi,

I'm developing a network application on omap L-138 and using ndk 2.

I'd like to design my transmission and receiving task thread to work on interrupts or events coming up from the ndk layers and build my own ISR's.

I've read in NDK User's Guide and NDK Programmers Guide, that Stack Event object responds to the ndk network scheduler about the incoming Rx/Tx events/interrupts, but I didn't find any public API's for custom use. There'are actually 2 API's for file descriptor management, fdSelect(), and fdPoll(), but it is written in the guide that the fdPoll() call is actually more effective that the fdSelect(). and it works in polling mode, not the interrupt.

Is there any effective way to catch up events in the NDK?

Anatoly.

  • I would rephrase my question:

    I need to know when a buffer or a packet is sent or received.

    How should I sign my own  callback that will respond to these events in the NDK 2?

    Thank you.

  • Anybody have an idea?

  • I'm looking into this now.

    Alan

  • If you're not already using the latest NDK and NSP products, I recommend that you upgrade to NDK 2.20.05.33 available here:

         http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/2_20_05_33/index_FDS.html

    and to NSP 1.00.00.09 available here:

        http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/nsp_1_00_00_09/index_FDS.html

    You can override the default tx and rx ethernet interrupts by copying the NSP's "ti/drv/omapl138/ethdriver.c" file into you project.

    Your versions of the APIs defined in this file will then be used in the build rather than the ones in the library.

    The tx and rx ethernet packet interrupt handlers are "HwTxInt" and "HwRxInt" respectively.

    You can add calls to your application-specific functions within these functions. Beware that these are ISRs, so you don't want to spend too much time in them.

    I hope this helps.

    Alan

  • Thank you.

    I have seen these ISR's and the driver, but I'd like not to intervene the original NDK sources.

    The thing I want is to catch the socket events, raised by Tx/Rx interrupts in the low layer driver, being catched by the stack event inside the NDK. Is it possible?

    TMS320C6000_TCP_IP_Stack_Library_Architecture_Overview says there'e a global semaphore the NETCTRL waits on, which is signaled via HAL (low layer driver) on interrupt.

    I'd like to pend to this semaphore, but I just didn't find the reference to it in the code. Can you help with this?

  • I have another question related to this issue.

    In NDK call NC_SystemOpen() configuration includes the operation mode field : NC_OPMODE_POLLING or NC_OPMODE_INTERRUPT.

    If the NETCTRL  is pending on a semaphore, which is being signaled from the HAL(via interrupt),it seems like the polling case here.

    What is the difference for the end user choosing these options for buffer transmitting case?

     

  • I'm searching for the possibilities and features in the NDK2.0 for making my application a real-time friendly as much as possible.

    I want to block the transmitting task thread while the data is being transferred through the EMAC hardware, which needs no CPU or our SW intervention, and we can utilize these periods of time for our needs in other application threads (non network ones).

    How can I get the access to the semaphore which handles the stack event for network scheduler inside the NDK layers? When exactly this semaphore is fired, what are the exact operations it releases?

    Anatoly.

  • Anatoly,

    That semaphore is meant for internal stack usage, and using it for what you are trying to do has never been tested.  Having said that, you can experiment with pending on that semaphore but this is not supported.

    The semaphore is stored in the global variable stkEvent that's declared and initialized during NC_SystemOpen(), in netctrl.c

    // Static Event Object
    STKEVENT  stkEvent;

    ...

    // Create the event semaphore
    if( OpMode==NC_OPMODE_INTERRUPT && !(hSem = SemCreate(0)) )
        return(NC_OPEN_EVENTINIT_FAILED);

    // Initialize our Event object
    STKEVENT_init( &stkEvent, hSem );

    It can be accessed like this:

        stkEvent.hSemEvent

    You can experiment with pending on that semaphore and see if it gives you the desired result.

    Steve

  • So is it possible to block the transmitting task thread while the data is being transferred through the EMAC hardware in the NDK 2?