Change IP address locks app in thread besides "root"

I am using NET+OS version 7.4.2 and Connect Core 9P 9215.
I have a Digi Example Application to “changeIpAddress” that toggles the IP Address between two different values.
It works fine in the example application.
A summary of it uses the following calls:

/******************************************************************************************************/
/
Get current configuration settings. */
HANDLE_ERROR(customizeIamGetStaticConfig(interface, &ipParams));

/* Set IP Address.  */
ccode = inet_pton(AF_INET, address, &ipParams.ipAddress.addr.ipv4.sin_addr);
if (ccode != 1)
{
    printf ("%s is not a valid IP address.

", address);
return;
}

/* Write the new configuration to NVRAM. */
HANDLE_ERROR(customizeIamSetStaticConfig(interface, &ipParams))

/* Get the method used to set the current IP address. */
HANDLE_ERROR(naIamGetCurrentMethod(interface, &method));
 
/* Restart IAM. */
HANDLE_ERROR(naIamRelease(interface, method));

/*******************************************************************************************************/

It also works fine when I use it in my application from within the “root” thread.
However when I run from another thread it locks up my application.

I know there are other threads on changing the IP address, however I have not seen one that
addresses the problem I am experiencing.

Any ideas on why it these calls need to be through the root thread?

Thanks in advance.

Regards,

Adam

Here is some new information.
I loaded an image.bin instead of using debugger.
I thought it locked up when writing the IP back into NVRAM.
However I now see it will lock up when GET the IP address with:
customizeIamGetStaticConfig(BP_ETH_INTERFACE, &ipParams);

Again it works exactly as expected when called through the root application thread instead of a separate application thread that I start.

Also, I am using the External Peripheral Interface bus in 8-bit mode to control some external UARTS.
I doubt that should make a difference but thought I should include that information.

There is a white paper Digi published on how to do this with Neots 7.x/ Treck TCP/IP stack properly. I’m not sure where it is posted. I can try to attach it to the post here

Attachment din’t work so I’ve uploaded it here for now:
http://rapidshare.com/files/378219364/ip_address_whitepaper.zip.html

Leonid,

Oops. This is embarrassing. The problem turns out I was blowing the stack for the separate thread. It is a simple thread so I only allocated 2048 for it. I increased to 4096 and things are working as expected now. I guess I ignored this statement from the API at my own risk:

“Digi strongly recommends a minimum thread stack_size of 8kbytes.”

BTW, thanks for the white paper. Where do I find these on the WEB site? I see some white papers for at:
www.digi.com/learningcenter/literature/whitepapers.jsp

But not this one nor really any for NET+OS and embedded modules.
Is there another location where you keep the literature for the embedded module / NET+OS developers.

Regards,

Adam

One place would be: http://www.digi.com/learningcenter/literature/whitepapers.jsp
There could be also more in the support section for the particular Netos versio like this for example:
http://www.digi.com/support/productdetl.jsp?pid=3510&osvid=165&tp=3&s=375&tp2=0