Tool/software: Code Composer Studio
Hi
I have a slightly complex problem ...
My project is capable of switching between static IP and dynamic IP perfectly.
lwIPNetworkConfigChange(0, 0, 0, IPADDR_USE_DHCP);
or
lwIPNetworkConfigChange(DEF_Ip, DEF_Mask, DEF_Gateway,IPADDR_USE_STATIC);
Then I implemented in my code a routine for firmware update through the ethernet port.
while(1)
{
//...
if(g_bFirmwareUpdate == 0x72)
{
ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_PIN_1);
SoftwareUpdateBegin(g_ui32SysClock);
}
}
However, after that, I noticed that every time I try to change from static to dynamic IP, my code goes into FaultISR.
Debugging the code, I noticed that it fails to access the function "mem_malloc()", located in "mem.c" just before line 77.
The big question would be: Why did it work well before enabling ethernet firmware upgrade? And what changed to make the code crash after that?
Remember that if I have static IP, the firmware update works correctly ...
I am not getting a solution to this problem, but I believe it may have something related to port 68 used by DHCP and BOOTP.
Looking at the example "boot_emac_flash" it is possible to change the ports used during the upgrade in the file "bl_emac.c"
//***************************************************************************** // // The UDP ports used by the BOOTP protocol. // //***************************************************************************** #define BOOTP_SERVER_PORT 67 #define BOOTP_CLIENT_PORT 68 //***************************************************************************** // // The UDP port for the TFTP server. // //***************************************************************************** #define TFTP_PORT 69
I'm really not sure if this is really the problem... But is there any way to change these ports without using the "boot_emac_flash" initializer in my project?
Or if my suspicions are wrong, can anyone see what other cause this problem could have?
Thanks!

