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.

SYS/BIOS interrupt changed to CSL interrupt on NDK helloworld example

Other Parts Discussed in Thread: SYSBIOS

Hello,

I plan to add a ethernet function to my project for debugging. I am checking helloworld example in mcsdk_2_01_02_06\examples\ndk\helloWorld folde\evmc6678l folder.

All interrupts in my current project are implemented and verified by CSL APIs.

However, the interrupt in helloworld example looks to be implemented by SYS/BIOS.

I want only small modification to current project. I need to implement ethernet interrupt by CSL APIs.

But I wasn't able to where the interrupt is initialized. 

How can I change SYS/BIOS interrupt to CSL APIs on helloworld project?

  • Hi Yoonsun,

    The interrupt is configured in .CFG(BIOS configuration file) file . You can remove it from there and update the code do interrupt configuration using CSL.

    Thank you.
    Regards,
    Rajasekaran K
  • Hello Raja,

    I checked the eventId of helloworld_evmc6678l project by ROV.
    EventId 48 is assigned to EmacRxPktISR function.

    I checked helloWorld.cfg file but did not find out interrupt configuration for eventId 48.
    And I did not find out where the function EmacRxPktISR is either.
  • You would get that ISR routine from NDK library.
    C:\ti\pdk_C6678_1_1_2_6\packages\ti\transport\ndk\nimu\src\nimu_eth.c
  • Hi Titus,

    I modified C:\ti\pdk_C6678_1_1_2_6\packages\ti\transport\ndk\nimu\src\nimu_eth.c file as below

    I did ping test with new nimu_eth.c and original helloWorld project.

    First, it looked good ping return.

    But it did not response for ping anymore after some time later.

    If i changed to nimu_eth.c to original code, there was no problem. Thus I think test environment has no problem.

    How can I debug nimu_eth.c code?

    #if 0 // original

    platform_write ("Ethernet eventId : %d and vectId (Interrupt) : %d \n", eventId, vectId);

    /* Register our ISR handle for this event */
    EventCombiner_dispatchPlug (eventId, (EventCombiner_FuncPtr)EmacRxPktISR, (UArg)ptr_net_device, TRUE);
    EventCombiner_enableEvent(eventId);

    /* Map the event id to hardware interrupt 7. */
    Hwi_eventMap(vectId, eventId >> 5);

    /* Enable interrupt */
    Hwi_enableInterrupt(vectId);

    #else //new code

    intcHndl = CSL_intcOpen (&intcObj, eventId, &vectId , NULL);
    if (intcHndl == NULL)
    {
    platform_write ("Failed!!!! Ethernet eventId : %d and vectId (Interrupt) : %d \n", eventId, vectId);
    return -1;
    }
    platform_write ("Ethernet eventId : %d and vectId (Interrupt) : %d \n", eventId, vectId);

    EventRecord.handler = (CSL_IntcEventHandler)&EmacRxPktISR;
    EventRecord.arg = ptr_net_device;

    if (CSL_intcPlugEventHandler(intcHndl, &EventRecord) != CSL_SOK)
    {
    printf("Error: GEM-INTC Plug event handler failed\n");
    return -1;
    }

    /* Enabling the events. */
    if (CSL_intcHwControl(intcHndl, CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)
    {
    printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failed\n");
    return -1;
    }

    #endif

  • Hi,

    How can I debug nimu_eth.c code?

    After loading the "hello workd" program, pause the debug session and set "hw break point" in "nimu_eth.c" and then it would stop when it hits that break point.
  • Hi Titus,

    Is there no example NDK with CSL APIs?

    I modified just Hwi functions to CSL APIs then did ping test.

    I got good response from c6678, but it did not response anymore after some time.

    Most of case, there was no error message, just no response.
    But sometimes I saw 'Invalid Packet' or 'Illegal call to llExit()'

    I tried to find out where I mis-changed in nimu_eth.c, but I couldn't.
    Is possible to use NDK with CSL interrupt?
  • Hi,
    We have used CSL APIs only for NDK library.

    #include <ti/csl/csl_cpsgmiiAux.h
    #include <ti/csl/cslr_cpsgmii.h>

    What do you mean by CSL API ?
  • Hello Titus,

    I am sorry for uncertain expression. I meant csl_intc functions for NDK.

    I imported project 'nimu_eth_evmc6678l' and modified SYSBIOS interrupt functions to CSL interrupt functions in nimu_eth.c file.

    I rebuilt nimu_eth_evmc6678l then rebuilt my project for ping test.

    I received good result just for first 40~100 pings.

    After some time(40 ~ 100 pings) later, there was no response from board.

    I checked if EmacRxPktISR was executed or not when ping arrived by set hw breakpoint in EmacRxPktISR function.

    When there was no ping response, the EmacRxPktISR was not called.(I confirmed Emac was called when first some ping test.)

     I inserted modified nimu_eth.c file below.

    nimu_eth.c

  • Hi Yoonsun,
    May I know that why do you want to use CSL API based interrupts and don't want SYS/BIOS based interrupt ?
    I think, for this, RTOS team could answer in better.
  • Hi Titus,

    I have verified code with CSL based interrupt and need to add ethernet function.
    Thus I thought that it would be easier way to change interrupt method of helloWorld project if migration was not complex.
    Anyway thanks for your support. I will check a little more.