Part Number: LAUNCHXL2-RM57L
Other Parts Discussed in Thread: DP83630, HALCOGEN
Hi,
I am using Hercules RM57Lx Launchpad Development Kit and I want use Ethernet Protocol. I am new to Ethernet so I decided first by using MDIO module to read the Phy ID in DP83630, but I can't read phy id.
I am using Halcogen to generate code and My configuration in Halcogen is
- In driver enabled tap enabled the EMAC
- In pinmux tap selected MII Check box
- In GCM tap VCLK3 is 25MHZ
This is the code I use to read the Phy id.
int main(void)
{
/* USER CODE BEGIN (3) */
muxInit();
volatile uint32 phyID=0U;
volatile uint32 delay = 0xFFFU;
uint32 phyIdReadCount = 0xFFFFU;
hdkif_t *hdkif;
hdkif_t hdkif_data;
rxch_t *rxch;
uint32 retVal = EMAC_ERR_OK;
uint32 emacBase = 0U;
hdkif = &hdkif_data;
EMACInstConfig(hdkif);
MDIOInit(hdkif->mdio_base, MDIO_FREQ_INPUT, MDIO_FREQ_OUTPUT);
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "LDRA Tool issue" */
while(delay != 0U)
{
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "LDRA Tool issue" */
delay--;
}
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "LDRA Tool issue" */
while ((phyID == 0U) && (phyIdReadCount > 0U)) {
phyID = PhyIDGet(hdkif->mdio_base,hdkif->phy_addr);
phyIdReadCount--;
}
/* USER CODE END */
return 0;
}
