I'm trying to port a Stellaris project over to Tivaware, and I'm running into a problem with getting lwiplib initialized. I'm using Tivaware 2.1.4.178.
emac.c, located in TivaWare\driverlib is using incorrect memory locations for the ethernet controller. According to the datasheet, the ethernet controller starts at 0x400E.C000. However, emac.c is using the SYSCLT_PERIPH_EPHY0 #define (located in TivaWare\Driverlib\sysctl.h). SYSCTL_PERIPH_EPHY0 is defined as 0xF000.3000
Here's the function that is causing problems in ema.c
void EMACPHYConfigSet(uint32_t ui32Base, uint32_t ui32Config) { // // Write the Ethernet PHY configuration to the peripheral configuration // register. // HWREG(ui32Base + EMAC_O_PC) = ui32Config; // // If using the internal PHY, reset it to ensure that new configuration is // latched there. // if((ui32Config & EMAC_PHY_TYPE_MASK) == EMAC_PHY_TYPE_INTERNAL) { SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0); while(!SysCtlPeripheralReady(SYSCTL_PERIPH_EPHY0)) { // // Wait for the PHY reset to complete. // } // // Delay a bit longer to ensure that the PHY reset has completed. // SysCtlDelay(10000); } // // If using an external RMII PHY, we must set 2 bits in the Ethernet MAC // Clock Configuration Register. // if((ui32Config & EMAC_PHY_TYPE_MASK) == EMAC_PHY_TYPE_EXTERNAL_RMII) { // // Select and enable the external clock from the RMII PHY. // HWREG(EMAC0_BASE + EMAC_O_CC) |= EMAC_CC_CLKEN; } else { // // Disable the external clock. // HWREG(EMAC0_BASE + EMAC_O_CC) &= ~EMAC_CC_CLKEN; } // // Reset the MAC regardless of whether the PHY connection changed or not. // EMACReset(EMAC0_BASE); SysCtlDelay(1000); }
All of the SYSCTL_PERIPH #defines are all located in 0xF000.XXXX memory area, which should be reserved, according to the datasheet.
My code is getting hung up in the "wait for PHY reset to complete" spin-wait loop.