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.

CCS/EK-TM4C1294XL: IntDefaultHandler?

Part Number: EK-TM4C1294XL


Tool/software: Code Composer Studio

I am trying to create a small program sending data via UDP.

I have the following setup code. More or less directly copied in from my version of udp_echo. Where it works!

    //Timer 0A
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_ONE_SHOT);
    TimerLoadSet(TIMER0_BASE, TIMER_A, 600); //15 µs at 120 MHz

    //Timer 0B
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_ONE_SHOT);
    TimerLoadSet(TIMER0_BASE, TIMER_B, 600); //15 µs at 120 MHz

    //Timer 1A
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
    TimerConfigure(TIMER1_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_ONE_SHOT);

    TimerIntRegister(TIMER0_BASE, TIMER_A, Timer0AIntHandler);
    TimerIntRegister(TIMER0_BASE, TIMER_B, Timer0BIntHandler);
    TimerIntRegister(TIMER1_BASE, TIMER_A, Timer1AIntHandler);

    IntMasterEnable();

    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    IntEnable(INT_TIMER0A);
    TimerIntEnable(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
    IntEnable(INT_TIMER0B);
    TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
    IntEnable(INT_TIMER1A);

    //LAN
    MAP_FlashUserGet(&ui32User0, &ui32User1);
    if((ui32User0 == 0xffffffff) || (ui32User1 == 0xffffffff))
    {
    }

    pui8MACArray[0] = ((ui32User0 >>  0) & 0xff);
    pui8MACArray[1] = ((ui32User0 >>  8) & 0xff);
    pui8MACArray[2] = ((ui32User0 >> 16) & 0xff);
    pui8MACArray[3] = ((ui32User1 >>  0) & 0xff);
    pui8MACArray[4] = ((ui32User1 >>  8) & 0xff);
    pui8MACArray[5] = ((ui32User1 >> 16) & 0xff);

    //
    // Initialize the lwIP library, using static address.
    //
    lwIPInit(g_ui32SysClock, pui8MACArray, 0xA9FE0775, 0xFFFFFF00, 0xFFFFFF00, IPADDR_USE_STATIC);  //STATIC);

    pcb = udp_new();
    if (pcb != NULL)
       GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_1,0x02);


    if (udp_bind(pcb, IP_ADDR_ANY, ActivePort) ==ERR_OK)
    {
      GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0,0x01);
    }

    udp_recv(pcb, udp_incomming, NULL);  //


After this setup. the program as a temporary test enters an infinite loop doing nothing except toggling a GPIO pin. No further code accessing LAN interface, allocating transmit buffers or anything!

The program starts OK, but after about two seconds, the program jumps to IntDefaultHandler for an eternal loop doing absolutely nothing.

The two sec. delay indicates some timeout, I do not have a handler for. But which one may that be?

All three times are used as one-shots, and they are never started in this reduced code.

Pin 0 and 1 both go on indicating the setup comes through with no errors.

The udp_echo was run from Windows, as it was apparently created for that. This project was created under Ubuntu and is run from there.

  • Hello Ja Hv,

    There is probably an Ethernet Interrupt handler you are missing. I would say look at the startup_ccs.c file for your working project and see which Ethernet handler is used and then add that to the startup_ccs.c for your new project.

    For example in two TivaWare examples I see EthernetIntHandler and lwIPEthernetIntHandler. EthernetIntHandler was defined in the application file, but lwIPEthernetIntHandler is defined in an lwIP library file. Maybe it is the lwIPEthernetIntHandler that is missing for you.

  • You may be on to something.

    I can now see, that my error only comes if I have run the lwIPInit statement. This one somehow initiates an interrupt after some time.

    In the udp_echo project there are two interrupt  handlers in the 'user' code. One for a sys tick and one for some lwIP thing. Both are somehow forward external linked in the lwIP module.

    Apparently in my project the linker can not see my handlers so they are ignored. Breakpoints in them not possible.

    I can see there are some mentioning of those external handlers in various files under udp_echo (Windows), but not in my from scratch created (Linux).

    How to tell the compiler or linker, that the code for the handlers are to be found at a higher level (user code), not lower?

    Isn't this what is somewhere called spaghetti code?(calls from low levels to main.c?) I once had to modify a Delphi project left by a colleague, because he had used those back calls a lot and almost caused compiler/linker crash.

  • OK, created a completely new project under Windows. Then copied all code and settings manually.

    The code now has problems wit allocating memory for UDP transmission, but the interrupts run.

  • Ja Hv said:
    The code now has problems wit allocating memory for UDP transmission, but the interrupts run.

    Check your Stack and Heap settings. I often forget to transfer those for new projects!

    Glad the interrupts are running!