I have been tracking down an issue which appears on only a handful of builds of our product. We have seen an issue where Ethernet packets are sent out of the EMAC on the dm6435 with incorrect checksums. This might happen at a rate as high as 1 in every 10,000 packets. We are using the TI NDK v1.94.1, with the standard dm643x EMAC Packet Driver.
This issue only appears when we are also acquiring images from an onboard CMOS imager, using the CCDC and VPFE to transfer image data into DDR2 memory.
We have run several tests which seem to vary the behavior to some extent:
1) We have disabled interrupts during the call to HwPktTxNext, this did not make the issue occur any more/less often.
2) We have tried calling OEMCacheCleanSynch prior to the call to OEMCacheClean to see if another cache sync operation might be interfering with the EDMA driver’s, but this also did not change the equation.
3) We have tried adding a 1us delay between the OEMCacheCleanSynch call and the code block which adds the transmit descriptor to the queue. This causes the issue to occur much less frequently ( 1 in 10 million ), but it does not go away.
4) We have tried moving the OEMCacheCleanSynch call to earlier in the function ( before the transmit descriptor is being filled out). This cause the issue to occur much much less frequently ( 1 in 100 million ), but it does not completely go away.
5) We have tried adding a dummy read after the OEMCacheCleanSynch operation of 4 bytes from the beginning of the packet, and so far we have run for 25 million cycles without incident.
Generally this issue does not seem to present itself in all builds of this product, but certain builds have shown this issue. At this point, we are unsure what might be different about each of these builds, but they are populated with the same hardware and should be completely equivalent.
We would like to confidently resolve this issue, and we were hoping to get some input from you as it relates to cache coherency issues.
1) Is there any possibility that after a Cache Clean operation is triggered, and a read from the status indicates that it has completed, that the cache has not been written out to DDR2 memory yet? Would a very active DMA from the Video Port increase the likelihood of this?
2) If this situation is possible, what is the best way to resolve it? Would a dummy read back from a cacheable DDR2 address resolve this?
Thanks for your help,
Dale Peterson