K60 Ethernet not sending packets

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

K60 Ethernet not sending packets

跳至解决方案
857 次查看
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

标签 (1)
0 项奖励
1 解答
642 次查看
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 项奖励
3 回复数
643 次查看
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 项奖励
642 次查看
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

642 次查看
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 项奖励