FNET and KSZ8895 without MDC/MDIO

cancel
Showing results for 
Search instead for 
Did you mean: 

FNET and KSZ8895 without MDC/MDIO

1,121 Views
weblar
Contributor V

I'm trying to bring up FNET on an MK60FN1M0XXX15 device, interfacing to a KSZ8895 ethernet switch.

I've configured the FNET stack correctly for our CPU and I've installed the relevant interrupt vectors as well as updating the configuration flags to indicate that vectors are not in RAM.

When calling the following function:

fnet_netif_init(FNET_CPU_ETH0_IF, &hw_addr, 6);


I get a hard fault following the auto-negotiation phase (fnet_fec.c, fnet_fec_init, line 400) and when trying to set the HW address (fnet_netif.c, line 304) the _fnet_netif_set_hw_addr() function returns with FNET_ERR with ultimately results in no interface being initialized.

Would this be indicative of a hardware issue? For example, bad connections between the Kinetis and the switch? Our hardware engineer has NOT connected the MDC/MDIO signals from the Kinetis to the KSZ8895 - are these necessary for correct operation?

Thanks in advance

Labels (1)
7 Replies

428 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi weblar,

MDIO nad MDC must connect from the Kinetis to the KSZ8895. ENET module use these pins to set the PHY, include RESET, SPEED and so on.

Regards,

Jing

0 Kudos

428 Views
weblar
Contributor V

jingpan‌ thank you for your reply. To confirm, without connecting the MDC/MDIO signals, I will fail to get a network interface via FNET because the `fnet_netif_init` function uses the MDC/MDIO pins for communication with the KSZ8895?

Is the KSZ8895 known to work ok with the Kinetis K60 range and FNET? butok‌, are you able to advise please?

EDIT: Also, I need to add that I need the KSZ8895 to operate in MAC-to-MAC mode. 

0 Kudos

428 Views
mjbcswitzerland
Specialist V


Hi

Note that the uTasker project supports the KSZ8863, which is a 3 port version of the switch. It uses the MDIO interface to realise the SMI mode of communication, which allows access to all internal registers but also SPI or I2C are possible (also having full internal register access). I do have a board with the device using I2C which simply polls the link state to get information about its connection type.

If SPI is connected you won't have any restrictions either.

As discussed in the networking document (link below) it integrates tail-tagging features of the device (including inter-operation with this mode and TCP/IP checksum off-loading, which requires some manipulation of the frames to allow it to work and take advantage of the Kinetis Ethernet's offloading features - which is a major performance advantage).
This allows the switch ports to be used as multiple individual (isolated) Ethernet interfaces to make the board appear as multiple isolated ones even though the Kinetis has only a single Ethernet controller (one can define which physical interfaces belongs to which networks or logical interface, or allow switch operation on individual networks too).
For basic applications it is also possible to not do any configuration to get switch operation since it will default to auto-negotiation switch mode, so communication is already possible.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K60:
- http://www.utasker.com/kinetis/TWR-K60N512.html
- http://www.utasker.com/kinetis/TWR-K60D100M.html
- http://www.utasker.com/kinetis/TWR-K60F120M.html
- http://www.utasker.com/kinetis/ELZET80_NET-KBED.html
- http://www.utasker.com/kinetis/ELZET80_NET-K60.html

Networking: http://www.utasker.com/docs/uTasker/uTaskerNetworking.pdf

Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M


For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

0 Kudos

428 Views
weblar
Contributor V

Hi Mark,

Thanks for your response and the uTasker links.

You mentioned that you've worked with the KSZ8863, did you have to perform anything special when configuring the device? I have since realised that I haven't written to the START_SWITCH bit of the CHIP_ID_0 register. Given that I'm using SPI mode, the datasheet indicates that the switch does not automatically start when using SPI mode - not starting the switch definitely isn't helping things!

My thoughts are that as and when I enable the switch, the default configuration should be enough to allow things to work out-the-box if you will.

Thanks.

428 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi weblar,

Since FNET is not supported by nxp, I have no ideals about this protocol stack. But I believe there must be a PHY init code in FNET. So what you must to do is not only connect MDIO/MDC, but also do some config to port KSZ8895. IEEE-802.3 has defined some basic register in PHY. But each chip has there own special define. Sometimes this can not be ignored.

So if you don't config it, K60 will not know how to work with LSZ8895.

Regards,

Jing

0 Kudos

428 Views
weblar
Contributor V

jingpan‌ thank you for your response.

As mentioned in my previous comment, the KSZ8895 is running in MAC-to-MAC mode. The configuration is such that the KSZ8895 is configured for RMII (using strapping resistors) so therefore I do not think that we need the MDIO/MDC (the KSZ documentation seems to indicate this) but we do have SPI access to the device to configure alternate registers.

0 Kudos

428 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi weblar,

If you have configed PHY by other way, I think MDIO/MDC is not a must work.

Regards,

Jing

0 Kudos