K60 Ethernet not sending packets

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

K60 Ethernet not sending packets

Jump to solution
808 Views
marlonsmith
Contributor IV

Hi everyone,

I'm writing an Ethernet driver for the K60 and a custom board.  When I attempt to send a packet, there is no activity on any of the RMII lines.

The external PHY provides a 50MHz clock for the MAC.  I define one receive buffer and one transmit buffer, and descriptors for both.  Before sending I copy data into the TX buffer and set the ready flag, then I set ENET_TDAR to begin transmission.

After the transmission attempt, EIR reads as 0, and ECR reads as 0xf0000002.  It looks like the chip is not even trying to send the packet, but I've read all through the datasheet and I can't figure out what's going wrong.

Any help is much appreciated, thanks!

Marlon

Labels (1)
0 Kudos
1 Solution
593 Views
marlonsmith
Contributor IV

I figured this out eventually.  I was not quite setting all the right bits in the buffer descriptor to enable transmission.

View solution in original post

0 Kudos
3 Replies
594 Views
marlonsmith
Contributor IV

I figured this out eventually.  I was not quite setting all the right bits in the buffer descriptor to enable transmission.

0 Kudos
593 Views
mjbcswitzerland
Specialist V

Marlon

You MUST have 2 Tx buffers otherwise you will get multiple transmissions of the single buffer (see errata).

Have you respected buffer descriptor boundary alignments, otherwise it won't be able to operate?

Take the uTasker code and simply run the K60 in its VisualStudio based simulator - then step through the Ethernet initialisation so see how it configures it (and the reasons for doing things) and then follow how its Ethernet emulator operates in order to see how the Ethernet controller functions in the device. This will save you a lot of time re-developing code that is available from many sources already.

You can also use Coldfire code as reference since the Ethernet controller in the Kinetis is compatible with it in its basic mode - you will however want to use its enhanced mode to make use of its powerful checksum offloading features.

Regards

Mark

593 Views
marlonsmith
Contributor IV

Hi Mark,

I've looked through the uTasker code that you sent for my other question.  As far as I can tell I'm setting all the registers correctly.  The buffer descriptors are aligned on 16 bit boundaries.

My development environment is Linux using gcc and Eclipse.  Maybe I'll see if I can get Visual Studio running in a virtual machine.

Thanks for the help

Marlon

0 Kudos