Tool/software: TI-RTOS
Hi,
I want to assign network IP address dynamically from user application. for these i have created the code below for updating the IP address. This is working well when this can be done in Network hook function. But its not working when we are updating from user application in middle of execution.
i am using below tool version.
tirtos_tivac_2_16_01_14
ndk_2_25_00_09
bios_6_45_02_31
Here is my code for updating IP address :
void Ip_Address_Update(IPLOCAL *stIpLocalAddr)
{
CI_IPNET NA;
CI_ROUTE RT;
HANDLE hCfgIpAddr;
/* Setup manual IP address */
bzero(&NA, sizeof(NA));
NA.IPAddr = inet_addr(stIpLocalAddr->IPAddr);
NA.IPMask = inet_addr(stIpLocalAddr->IPMask);
strcpy(NA.Domain, stIpLocalAddr->Domain);
NA.NetType = 0;
/* get the current static IP entry */
CfgGetEntry(0, CFGTAG_IPNET, 1, 1, &hCfgIpAddr);
/* remove the current static IP entry */
CfgRemoveEntry(0, hCfgIpAddr);
/* add a new static IP entry */
CfgAddEntry(0, CFGTAG_IPNET, 1, 0,sizeof(CI_IPNET), (UINT8 *)&NA, 0);
/*
* Add the default gateway. Since it is the default, the
* destination address and mask are both zero (we go ahead
* and show the assignment for clarity).
*/
bzero(&RT, sizeof(RT));
RT.IPDestAddr = 0;
RT.IPDestMask = 0;
RT.IPGateAddr = inet_addr(stIpLocalAddr->IPGateAddr);
CfgAddEntry(hCfgIpAddr, CFGTAG_ROUTE, 0, 0, sizeof(CI_ROUTE), (UINT8 *)&RT, 0);
}
when i am adding it in Hook function, its perfectly working fine. see the snapshot below.
See the below error when i am updating from user application & task is getting terminated from due to stack overflow.
Here i am using GPIO interrupt to update the IP Address. when GPIO is set high, interrupt handler will be invoked and post the event for pending task to perform the IP address update.
Can you anyone help me solve this issue?
Regards
Bala