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

644件の閲覧回数
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 返答(返信)

630件の閲覧回数
nxf77486
NXP Employee
NXP Employee

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 件の賞賛

619件の閲覧回数
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 件の賞賛

597件の閲覧回数
nxf77486
NXP Employee
NXP Employee

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 件の賞賛

579件の閲覧回数
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 件の賞賛