ENET Rx Buffer Descriptors are not setup properly in SDK 2.11.0

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

ENET Rx Buffer Descriptors are not setup properly in SDK 2.11.0

1,228 次查看
lh_dan
Contributor III

Porting a K65 project to SDK 2.11.0, I was having issues with receiving packets over ethernet and discovered that the Rx Buffer Descriptors are not setup properly. In fsl_enet.c ENET_SetRxBufferDescriptors(), the control register is never initialized when using the new zero-copy buffer allocation method in enet_ethernetif_kinetis.c.

                if (config->rxBuffAlloc == NULL)
                {
                    curBuffDescrip->buffer = (uint8_t *)((uint32_t)&rxBuffer[count * rxBuffSizeAlign]);
                    /* Initializes the buffer descriptors with empty bit. */
                    curBuffDescrip->control = ENET_BUFFDESCRIPTOR_RX_EMPTY_MASK;
                }

Because rxBuffAlloc is defined, moving the initialization outside of this conditional solves the issue.

               if (config->rxBuffAlloc == NULL)
                {
                    curBuffDescrip->buffer = (uint8_t *)((uint32_t)&rxBuffer[count * rxBuffSizeAlign]);
                }

                /* Initializes the buffer descriptors with empty bit. */
                curBuffDescrip->control = ENET_BUFFDESCRIPTOR_RX_EMPTY_MASK;
0 项奖励
4 回复数

1,214 次查看
nxf77486
NXP TechSupport
NXP TechSupport

Hello @lh_dan ,

 

Thank you in advance for your information but can you please help me with some extra information?

  1. This is an SDK example, and the example is not working properly? Please let me know what example of the SDK you are testing.
0 项奖励

1,203 次查看
lh_dan
Contributor III

nxf77486

I did not try this with a SDK example but with the port of one of my projects. I would assume that any example could have a similar issue as the BD control is never initialized. However, if the memory used by the BD is lucky enough to be zero'ed at startup I would guess that everything would seem to work.

0 项奖励

1,181 次查看
nxf77486
NXP TechSupport
NXP TechSupport

Hello @lh_dan ,

 

I will recommend to test and example of the SDK just to make sure that this problem is or not included inside the SDK example and to find a solution to this problem. Please also let me know if you have any other question I will be happy to assist you.

0 项奖励

1,163 次查看
lh_dan
Contributor III

Since all of the examples use fsl_enet.c, I am fairly certain that they have the same issue. The control register is not initialized when config->rxBuffAlloc is not NULL. This is obvious. As far as reproducing though it is hardware dependent. If the RAM used by the buffer descriptor defaults to zero it would seem to work. Please look at the code and verify what I have stated.

 

0 项奖励