Other Parts Discussed in Thread: LMFLASHPROGRAMMER
Hi,
Boot_serial sits at 0x0 and an application starts at 0x4000.
What I am trying to do is once the application starts it accesses the Unix server to get it's own assigned IP and server IP before lwip_init() is called.
So, What I did modified ParseBOOTPReply() to retrieve IPs.
//
// Extract our IP address from the response.
//
*((uint32_t *)(void *)(&uip_hostaddr)) = psBOOTP->ui32YIAddr;
//
// Save a copy of the server assigned IP for lwip initialization
//
BOOTP_SERVER_ASSIGNED_IP = psBOOTP->ui32YIAddr;
UARTprintf("BOOTP Assigned IP=%d \n",BOOTP_SERVER_ASSIGNED_IP);
//
// Extract the server address from the response.
//
*((uint32_t *)(void *)(&g_sServerAddr)) = psBOOTP->ui32SIAddr;
Once the application starts it calls lwipinit() and it calls ConfigureEent() and UpdateBOOTP()
ConfigureEnet();
UpdateBOOTP(); // call routine to perform BOOTP and
// // attain server assigned IP address
BOOTP_SERVER_ASSIGNED_IP = ntohl(BOOTP_SERVER_ASSIGNED_IP); // translate received network byte
//
// Initialize lwIP.
//
// lwIPInit(g_ui32SysClock, pui8MAC, 0, 0, 0, IPADDR_USE_DHCP);
lwIPInit(g_ui32SysClock, pui8MAC, BOOTP_SERVER_ASSIGNED_IP, 0, 0, IPADDR_USE_STATIC);
This application has no issues to get board's IP, as it uses either flash or rom-based bootlaoder+DHCP.
However, if two functions are called to retrieve IPs using BOOOTP the application gets stuck.
Even I tried to start the application at 0x00 without bootloader to see if the above modules can get Ips,but it does not let me success.
Can you give me tips, helps, and anythings?
Regards,
Jin