I have problem with ROM_UpdateEthernet as well. I wrote the program followed what you discussed here. configured ethernet controller. get MAC address from flash and set it. Then, disabled all interrupts. However, I tried to LM Flash programmer program flash via ethernet. it always attempt connect. in LM Flash Programmer, I entered clinet MAC address. do I need to enter client ip address? I tried many times. there is only once, I successfully programmed flash. In that case, i entered an IP address. I tried to program the flash again. it never succeed anymore. If it programmed once, it means the program should be fine. there mush be something I did not get it right. Could be the IP address of the board I did not entered correctly? if it is, how can I know the board IP address. I know the board is boardcasting BOOTP at the beginning.
The code I wrote is shown below.
int main(void) {
unsigned char pucMACArray[6];
unsigned char pucMACAddr2[6];
unsigned long ulUser0, ulUser1;
//
// Configure the Ethernet RX/TX pins
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
ROM_FlashUserGet(&ulUser0, &ulUser1);
pucMACArray[0] = ((ulUser0 >> 0) & 0xff);
pucMACArray[1] = ((ulUser0 >> 8) & 0xff);
pucMACArray[2] = ((ulUser0 >> 16) & 0xff);
pucMACArray[3] = ((ulUser1 >> 0) & 0xff);
pucMACArray[4] = ((ulUser1 >> 8) & 0xff);
pucMACArray[5] = ((ulUser1 >> 16) & 0xff);
//
// Initialize ethernet clock
//
ROM_EthernetInitExpClk(ETH_BASE, ROM_SysCtlClockGet());
//
// Configure Ethernet peripheral
//
ROM_EthernetConfigSet(ETH_BASE, ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN | ETH_CFG_TX_PADEN);
//
// Program the MAC address into the Ethernet controller.
//
ROM_EthernetMACAddrSet(ETH_BASE, (unsigned char*) pucMACArray);
//
// Enable Ethernet peripheral
//
ROM_EthernetEnable(ETH_BASE);
//
// Disable Interrupts
//
ROM_SysTickIntDisable();
ROM_SysTickDisable();
HWREG(NVIC_DIS0) = 0xffffffff;
HWREG(NVIC_DIS1) = 0xffffffff;
//
// Return control to the boot loader. This is a call to the SVC
// handler in the boot loader, or to the ROM if available.
//
ROM_UpdateEthernet(ROM_SysCtlClockGet());
return 0;
}
then I monitored using wireshark, it shows following info
No. Time Source Destination Protocol Length Info
223 26.102619000 0.0.0.0 255.255.255.255 BOOTP 342 Boot Request from 00:1a:b6:00:02:81 (TexasIns_00:02:81)
Anyone has idea why it is always attempting to connect. it did connect and program once and only once.
Please helps
Thanks in advance