KSDK2.0  phyAddr hardcoded in ethernetif.c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KSDK2.0  phyAddr hardcoded in ethernetif.c

585 Views
manfredschnell
Contributor IV

Hello,

 

we use KSDK2.0 with K64 and LWIP.

In file "ethernetif.c" the address of the external Ethernet Phy is hardcoded to 0 in serveral functions.

We use the switching Phy KSZ8863MLL. To get access to the complete Phy information I have to use "phyAddr" = 1 and "phyAddr" = 2.

 

--> The address of external Phy should be managed globally for the whole Ethernet IF.

 

Best regards

Manfred

Labels (1)
0 Kudos
3 Replies

313 Views
isaacavila
NXP Employee
NXP Employee

Hello Manfred,

In fact, in ethernetif.c file, only low_level_init and low_level_output functions are using PHY_xxx functions in which it is necessary to specify phy address.

In your case that phy address should not be always set to zero, you can use MACROs for both adresses and then, use any of these values to select the correct address:

uint32_t phyAddr = PHY_ADDRESS_ONE;

and everything should be working well, except for PHY_Init function that is not using this phyAddr variable and instead of it, it is using a hardcoded 0 value in its initialization, so you can replace it for:

PHY_Init(ENET, phyAddr, sysClock);

And all functions should be using phyAddr according to this macro definition.

I hope this can help you!

Best Regards,

Isaac

0 Kudos

313 Views
manfredschnell
Contributor IV

Hello Isaac,

thanks for your reply.

I changed the sources.

It should be changed in the KSDK files, too.

The underlying hardware has the ability to submit the phy address, so the "Phy"-Drivers should have a parameter phyAddr. Then user can choose phy-address according to the phy in application.

Best regards

Manfed

0 Kudos

313 Views
isaacavila
NXP Employee
NXP Employee

Hello Manfred,

I already reported this issue to development team, this is the reference for this improvement: KPSDK-9990.

As soon as any feedback is provided, I will let you know it!

Regards,

Isaac

0 Kudos