imxrt1061 enet communication error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imxrt1061 enet communication error

1,571 Views
yubobo0622
Contributor I
我现在正在做enet模块的通信功能,目前出现两个疑问和问题;
 
第一:如何启用RT1061 dma模式进行enet模块的收发数据;
 
第二,因为我在sdk中没有找到关于enet模块的dma方式通信的例程,所以采用了SDK安装包下面 driver_examples\enet\txrx_ptp1588_transfer 的例程方式来实现;
 
程序配置如下:
关于缓冲区大小和长度的定义如下:
 

/*******************************************************************************
* Definitions
******************************************************************************/
#define EXAMPLE_ENET ENET
#define EXAMPLE_PHY 0x00U
#define CORE_CLK_FREQ CLOCK_GetFreq(kCLOCK_AhbClk)
#define ENET_RXBD_NUM (4)
#define ENET_TXBD_NUM (4)
#define ENET_RXBUFF_SIZE (ENET_FRAME_MAX_FRAMELEN)
#define ENET_TXBUFF_SIZE (ENET_FRAME_MAX_FRAMELEN)
#define ENET_DATA_LENGTH (1000)
#define ENET_TRANSMIT_DATA_NUM (20)
#ifndef APP_ENET_BUFF_ALIGNMENT
#define APP_ENET_BUFF_ALIGNMENT ENET_BUFF_ALIGNMENT
#endif

 
关于rxBuffDescrip和txBuffDescrip定义如下:
/*******************************************************************************
* Variables
******************************************************************************/
/*! @brief Buffer descriptors should be in non-cacheable region and should be align to "ENET_BUFF_ALIGNMENT". */
AT_NONCACHEABLE_SECTION_ALIGN(enet_rx_bd_struct_t g_rxBuffDescrip[ENET_RXBD_NUM], ENET_BUFF_ALIGNMENT);
AT_NONCACHEABLE_SECTION_ALIGN(enet_tx_bd_struct_t g_txBuffDescrip[ENET_TXBD_NUM], ENET_BUFF_ALIGNMENT);
/*! @brief The data buffers can be in cacheable region or in non-cacheable region.
* If use cacheable region, the alignment size should be the maximum size of "CACHE LINE SIZE" and "ENET_BUFF_ALIGNMENT"
* If use non-cache region, the alignment size is the "ENET_BUFF_ALIGNMENT".
*/
SDK_ALIGN(uint8_t g_rxDataBuff[ENET_RXBD_NUM][SDK_SIZEALIGN(ENET_RXBUFF_SIZE, APP_ENET_BUFF_ALIGNMENT)],
APP_ENET_BUFF_ALIGNMENT);
SDK_ALIGN(uint8_t g_txDataBuff[ENET_TXBD_NUM][SDK_SIZEALIGN(ENET_TXBUFF_SIZE, APP_ENET_BUFF_ALIGNMENT)],
APP_ENET_BUFF_ALIGNMENT);
 
通过上述配置和测试,出现错误如下:
 
微信图片_20201207170532.png

然而enet模块还是可以与下位机进行收发数据;
我的接受数据接口如下:
2020-12-08 151921.bmp

 针对对齐错误我做过如下测试:

微信图片_20201208152027.png

 在上述接口中添加上面的地址对其验证代码,发现没有进入断点,说明地址是8个字节对齐的!

 

请工程师帮我看看问题,谢谢!

Labels (1)
0 Kudos
3 Replies

1,544 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
非常感谢使用NXP产品,很高兴为你提供技术支持!
1) 如何启用RT1061 dma模式进行enet模块的收发数据;
-- ENET内部集成了DMA(uDMA)无需额外配置。
所有我不知道你所说的DMA是指怎么样的一种操作呢?!
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos

1,540 Views
yubobo0622
Contributor I

非常感谢你的回复!

我想采用cpu的DMA 主要是完成ENET 模块数据的收发操作,比如和伺服通信时发送数据和接受数据。

第二个问题是:

我目前采用的是轮训的方式来通信数据,会产生RxAglin 对齐错误和RxFCS 错误,请帮我分析下如何解决这个问题。

谢谢你!

0 Kudos

1,502 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
抱歉回复晚了。
1)我想采用cpu的DMA 主要是完成ENET 模块数据的收发操作,比如和伺服通信时发送数据和接受数据。
-- 这个方式很难实现,ENET已经内部集成了uDMA对发生与接收进行了优化,其次ENET的只支持两个DMA request不是针对发生和接收功能的。
2)信息太少,我建议你给你提供更多关于第二个问题的背介绍。
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos