K64F ENET Autochecksum ICMP incorrect

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

K64F ENET Autochecksum ICMP incorrect

4,781 次查看
JHinkle
Senior Contributor I

I'm porting the ENET driver I wrote and had running on a K60F12 Tower board about 4 years ago to a FRDM-K64F board to prove out the software on the K64F micro.

I have ENET_TACC set for both PROCHK and IPCHK (auto calc and insert checksum into IP header and known protocol headers (UDP, TCP, ICMP).

The K60 micro properly inserted the checksum in all 4 instances (IP, TCP, UDP, and ICMP).

The issue I am trying to resolve is that the calculated checksum for a ICMP packet is being calculated incorrectly (verified by wireshark).

The IP and UDP checksums are correct - have not tested TCP yet.

The only requirement I'm aware of to have the ICMP checksum calculated properly and inserted into the packet is that the ICMP header's checksum is ZERO when delivered to the ENET.

Has silicon changed in this area from the K60F mask to the K64F mask?

Is this a known issue?

I don't want to resort to manually calculating the headers checksums if I don't have to.

Any info in this area is appreciated.

Thanks in advance for your reply.

Joe

0 项奖励
回复
3 回复数

1,641 次查看
JHinkle
Senior Contributor I

This whole post should be ignored / removed.

My problem -- I solved it.

0 项奖励
回复

1,641 次查看
JHinkle
Senior Contributor I

Did some more testing ...

The K64F documentation says the the protocol checksum is done based on 16 bit size elements.  If the last byte of the protocol part of the message was not a full 16 bits it pads the last byte as zero.

As a hunch, I manually forced a ZERO after the last byte of the IP message (IP is 60 bytes long) so IP_Pointer + 60 ... I placed a zero.

Now the checksum is correctly generated.

Is this a known issue with the K64F as user software should not need to place that terminating zero?

Thanks for any comments.

Joe

0 项奖励
回复

1,641 次查看
JHinkle
Senior Contributor I

Before someone asks -- PINS is also set in the Enhanced Buffer flag.

Joe

0 项奖励
回复