Tool/software: TI-RTOS
Hopefully this is a simple question. I'm trying to have a static IP Address, but the microcontroller needs to read it from the EEPROM. When I try to run the program, the firmware crashes just after I set *LocalIPAddr to the string containing the IP Address. By crash, I mean it compiles and runs, but a problem occurs during runtime, and it terminates using the abort function in exit.c .
Specifically I am using this code to convert the value from the EEPROM to a string, and setting *LocalIPAddr to that string. In the last line of code, if I replace *addressString with "192.168.3.5" instead, it works, so I'm pretty sure I'm just making a stupid mistake dealing with the pointers, or I'm doing something wrong in the formatting that I'm missing.
void readIPAddr(void)
{
uint32_t temp[1];
char address[4];
char addressString[17];
EEPROMRead(temp, 100, sizeof(temp));
address[0] = temp[0]&255;
address[1] = (temp[0] >> 8) & 255;
address[2] = (temp[0] >> 16) & 255;
address[3] = (temp[0] >> 24) & 255;
sprintf(addressString, "%u.%u.%u.%u",address[3],address[2],address[1],address[0]);
*LocalIPAddr = *addressString;
temp[0] = temp[0];
}
readIPAddr is called by the Stack thread begin hook, under TI-RTOS > Products > NDK > Networking > Stack Hook Functions