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.