#zephyr S32K148EVB #ethernet #Enet_ip
I would like to use net_if ,ethernet APIs and create a application where i can send and receive net package in loopback manner.
I can see the driver apis in zephyr but cannot see much use of it in any sample application or not doing in loopback manner. I would like to design any of below sample application. the major gap for me is receiving the package.
-enet
-net_if.
One more hint i would like to make similar project to s32k1 SDK/Eth_InternalLoopback_S32k148 project
Hello @keykur ,
This use case seems best suited for a low-level API approach (i.e., working directly with the Ethernet driver). However, due to how the ethernet_api is designed in Zephyr, Ethernet MAC drivers submit received frames directly to the Zephyr TCP/IP stack. As a result, it's necessary to interact with the stack itself rather than just the driver.
From what I’ve found, the packet socket API appears to be the most appropriate solution for this scenario:
https://docs.zephyrproject.org/3.7.0/samples/net/sockets/packet/README.html#packet-socket
Additionally, Zephyr provides a traffic capture API, which can also be used to observe Ethernet frames:
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/capture/capture.c
This capture API is primarily intended for monitoring and analysis, rather than for processing frames as part of the application logic. Therefore, for active send/receive use cases, the packet socket API is likely the better fit.
Best regards,
Pavel
I can see how to configure TX callback. but nothign for rx. so i would like a callback or the point of execution in zephyr where does it goes when we receive a pkt.