Have you added ETH_NET_DEVICE_INIT In your code?
Do you have CONFIG_NET_IPV4=y set in your application?
What sample are you using?
You can have a look at enc28j60 code, that is an SPI ethernet device as well.
From: users@... <users@...> On Behalf Of m.vermeulen via lists.zephyrproject.org
Sent: Wednesday, June 24, 2020 3:40 PM
Subject: [EXT] [Zephyr-users] Custom Ethernet driver and IPv4 #ipv4 #ethernet #networking
Caution: EXT Email
I am working to implement a driver for a SPI Ethernet controller.
The code is being called at initialization, but I am stuck at testing the driver. I would like to use the Net Shell, so net ping xxx.xxx.xxx.xxx for example. Unfortunately, I notice that the code fails in net_icmpv4_send_echo_request() when checking iface->config.ip.ipv4.
Do I need to take extra steps to use IPv4 over my custom ethernet driver, beside enabling the driver and net shell? I could image I would have to bind my ethernet interface to the network stack somewhere, but I haven't found exactly where.