Mattia Tosolini

Migrate ENET application from MK60DN256 (Rev 2.x) to MK60DN256Z (Rev 1.x)

Discussion created by Mattia Tosolini on Nov 21, 2017
Latest reply on Nov 23, 2017 by Mattia Tosolini

Hello everyone!

I am trying to migrate a simple application using ENET driver from a MK60DN256 (Rev 2.x) to a MK60DN256Z (Rev 1.x).

I came across what I suspect is a known issue about this driver and the Buffer Descriptor: the driver of the DEMO I have got from a generated SDK 2.2 (LWIP ping baremetal) uses the DBSWP functionality from the ENET_ECR register, which is a new functionality added in the 2.x release of the microprocessor I am using.

What I am trying to do now (at the present with little success) is manually disable the DBSWP bit from the ENET_ECR register and swap structure and the endian-ness of _enet_rx_bd_struct.

The migration guide AN4445 says that I have to change the structure from (2.x):

 

typedef struct
{
   uint16_t length;   /* transfer length */
   uint16_t status;   /* control and status */
   uint8_t *data;      /* buffer address */
} NBUF;

 

to (1.x):

 

typedef struct
{
   uint16_t status;   /* control and status */
   uint16_t length;   /* transfer length */
   uint8_t *data;      /* buffer address */
} NBUF;

 

I also tried to follow some other forum discussions in order to manually swap the endian-ness of the structure content (like bit masks defines).

I am working on it from fiew days now and I think I am missing something (or I am doing something wrong, or something highly discouraged), but I need to find out a solution.

Do you have any suggestions or a driver version already compatible with my micro revision?

 

In attachment the original version of the driver modules I am working on.

Attachments

Outcomes