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.

Problem in NDK in Target board TM4C1294NCPDT

Other Parts Discussed in Thread: TM4C1294NCPDT

Hi Experts,

I am using NDK module for TM4C129NCPDT  target board and TM4c129x evolution kit. Below is the snippet of code. What I found is that the code is working fine in evolution kit but in the target board it seems the NDK is not been initialized properly. What is the cause for this ?( Please find the log snippet) Please notes the difference between the evolution kit and target kit is ... the MAC address is already configured in the board but in the target board I have set in function EK_TM4C1294XL_initEMAC(). 

uint32_t ulUser0, ulUser1;
ulUser0 = 0x00c7d352;
ulUser1 = 0x0060be06;

LOG SNIPPET:


Using MAC address in flash ulUser0 c7d352, ulUser0 60be05

Service Status: DHCPC : Enabled : : 000
Service Status: DHCPC : Enabled : Running : 000

1439251200 ................// First trace... 

1439251201  taskService Status: DHCPC : Enabled : Fault : 002

CODE SNIPPET:

Int main(void)
{

setIpAddress( "192.168.1.155"); //for http for local
setHostName("someaddress.com");
setHttpPortNr(8080);

Board_initGeneral();
Board_initGPIO();
Board_initEMAC();//----------------- Calls EK_TM4C1294XL_initEMAC
Board_initSDSPI();

//Set system clock
if(!systemClockSet) {
systemClockSet = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); // 120000000); 120 Mhz
}

/* Call board init functions */
//Board_initGeneral();
/* Create a Semaphore object for task lock*/
taskLock = Semaphore_create(1, NULL, NULL);

BIOS_start(); ----------------- reads the Configurations files(*.cfg) and Spans netIPAddrHook
return (0);
}

void EK_TM4C1294XL_initEMAC(void)
{
uint32_t ulUser0, ulUser1;
ulUser0 = 0x00c7d352;
ulUser1 = 0x0060be06;
FlashUserSet(ulUser0, ulUser1);
/* Get the MAC address */
FlashUserGet(&ulUser0, &ulUser1); //52:d3:c7:06:be:60
if ((ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff)) {
System_printf("\nUsing MAC address in flash ulUser0 %x, ulUser0 %x",ulUser0,ulUser1);
/*
* Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
* address needed to program the hardware registers, then program the MAC
* address into the Ethernet Controller registers.
*/
macAddress[0] = ((ulUser0 >> 0) & 0xff);
macAddress[1] = ((ulUser0 >> 8) & 0xff);
macAddress[2] = ((ulUser0 >> 16) & 0xff);
macAddress[3] = ((ulUser1 >> 0) & 0xff);
macAddress[4] = ((ulUser1 >> 8) & 0xff);
macAddress[5] = ((ulUser1 >> 16) & 0xff);
}
else if (macAddress[0] == 0xff && macAddress[1] == 0xff &&
macAddress[2] == 0xff && macAddress[3] == 0xff &&
macAddress[4] == 0xff && macAddress[5] == 0xff) {

macAddress[0] = ((ulUser0 >> 0) & 0xff);
macAddress[1] = ((ulUser0 >> 8) & 0xff);
macAddress[2] = ((ulUser0 >> 16) & 0xff);
macAddress[3] = ((ulUser1 >> 0) & 0xff);
macAddress[4] = ((ulUser1 >> 8) & 0xff);
macAddress[5] = ((ulUser1 >> 16) & 0xff);
System_printf("\nSet MAC address in flash, %x, %x\n",ulUser0, ulUser1 );
//System_abort("Change the macAddress variable to match your boards MAC sticker");
}

GPIOPinConfigure(GPIO_PF0_EN0LED0); /* EK_TM4C1294XL_USR_D3 */
GPIOPinConfigure(GPIO_PF4_EN0LED1); /* EK_TM4C1294XL_USR_D4 */
GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_4);


/* Once EMAC_init is called, EMAC_config cannot be changed */
EMAC_init();
}


Snippet of CFG files

/* ================ NDK configuration ================ */
var Ndk = xdc.loadPackage('ti.ndk.config');
var Global = xdc.useModule('ti.ndk.config.Global');
var Tcp = xdc.useModule('ti.ndk.config.Tcp');

Global.IPv6 = false;
Global.stackLibType = Global.MIN;
Global.networkIPAddrHook = "&netIPAddrHook";

/* automatically call fdOpen/CloseSession for our sockets Task */
Global.autoOpenCloseFD = true;

Global.pktNumFrameBufs = 10;
Global.memRawPageCount = 6;
Global.ndkThreadStackSize = 4096;
Global.lowTaskStackSize = 2048;
Global.normTaskStackSize = 4096;
Global.highTaskStackSize = 8192;
Tcp.transmitBufSize = 2048;
Tcp.receiveBufSize = 2048;

__________________________
void netIPAddrHook(unsigned int IPAddr, unsigned int IfIdx, unsigned int fAdd)
{
static Task_Handle taskHandle;
Task_Params taskParams;
Error_Block eb;
logg("create httpProcTask", __FUNCTION__);flush();
if (fAdd && !taskHandle) {
Error_init(&eb);

Task_Params_init(&taskParams);
taskParams.stackSize = 32*1024;
taskParams.priority = 1;
taskHandle = Task_create((Task_FuncPtr)httpProc, &taskParams, &eb);
if (taskHandle == NULL) {
//System_printf("\nnetIPAddrHook: Failed to create httpProcTask\n");System_flush();
logg("failed to create httpProcTask", __FUNCTION__);
}
}
}

  • I did some digging to track down the source of the " taskService Status: DHCPC : Enabled : Fault : 002" report.
    I believe this is indicating that the DHCP server declined the request for an IP address (see DHCPDECLINE case in ProcessMain() in nettools/dhcps/dhcps.c).
    Is it possible that your router isn't configured to recognize this MAC address?

    Alan
  • Thank you so much Alan. I will check the same.

    Regards,

    Satish
  • Thanks Alan,
    You are right I have not set the proper MAC address, the data reg 0,1 are 0xFFFFFFFF. Now the system is not reporting DHCPC Fault 002.
    But I am facing new kind of issue "TcpTimeoutRexmt: Retransmit Timeout".
    I want to reiterate that the code is working fine in DK-TM4c129x development kit. But the same code with same configuration is not working in the target board (which uses TM4c1294NCPDT).
    The question is :
    1. Evenif the configurations are same. Why the target board is not able to establish the connection. Do I need to add more configuration to the target board ?
    2. Do you have any other pointers to resolve this issue ?

    Below is the snippet:
    FAILURE SCENARIO:

    Using MAC address in flash ulUser0 8307f6, ulUser0 d6c3d3
    Network Added: If-1:192.168.1.2

    1439251201 Http: Sending HTTP Request
    1439251201 Http: connecting http ip 192.168.1.155 port 8080.000
    TcpTimeoutRexmt: Retransmit Timeout
    00075.000 TcpTimeoutKeep: Keep Timeout

    SUCCESS SCENARIO:

    Using MAC address in flash

    mountSD:Drive 0 is mountedService Status: DHCPC : Enabled : : 000
    Service Status: DHCPC : Enabled : Running : 000

    Network Added: If-1:192.168.1.156
    Service Status: DHCPC : Enabled : Running : 017

    1439251211 Http: Sending HTTP Request
    1439251211 Http: connecting http ip 192.168.1.155 port 8080
    1439251211 Http: connect successful
  • Satish,

    Did this get resolved? If not, please open a new thread on the new failure mode and mark this thread answered for the original issue.

    Alan
  • Hi Alan,

    The problem is not yet resolved. I have opened a new thread.
    Thank you for the mail.

    Regards,

    Satish