How to check received Eth frames using MCAL drivers?

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

How to check received Eth frames using MCAL drivers?

1,251 次查看
Lambert_Yang
NXP Employee
NXP Employee

Hi.

This question exists both in MPC5777C MCAL4.0 or MCAL4.3.

When I want to check the received Eth frames, I used to check them in function EthIf_RxIndication. But this way is kind of weird. EthIf_RxIndication is defined in Ethif_Cbk.c which is a source file of MCAL drivers. That means I have to add my codes in Eclipse plugin codes, which is a bad way for porting.

Compared with the CAN module, similar functions like CanIf_RxIndication are only declared in Canif_Cbk.h using extern and there isn't a Canif_Cbk.c in MCAL drivers to define them either. So I can implement CanIf_RxIndication in my file and also check received CAN frames there.

So what is a better way to check received Eth frames using MCAL drivers?

标记 (2)
0 项奖励
回复
3 回复数

1,177 次查看
namnguyenviet
NXP Employee
NXP Employee

Hi Lambert Yang,

EthIf and CanIf are all stubs component in MCAL driver packages, which means their existence of source files (if have) only in order to avoid compile errors and component testing. Therefore, it's not mandatory to add source files and define Interface API like an empty function (like EthIf), or avoid implement source files and using "extern" keyword (like CanIf)

Normally when testing Eth driver, or create Eth sample application, in order to checking receive frame, we often don't add EthIf_Cbk.c into source list for compiling, and declare and implement EthIf_RxIndication in user's file (maybe main.c or other common file)

0 项奖励
回复

1,177 次查看
Lambert_Yang
NXP Employee
NXP Employee

Thanks, Nam. Sorry, I mistake you for Hung.

0 项奖励
回复

1,177 次查看
Lambert_Yang
NXP Employee
NXP Employee

I see. Thanks Hung.

0 项奖励
回复