Question
How can I switch the Ethernet from ETH0 (LAN8670) to ETH1 (LAN8650 based on SPI) in AEK-COM-10BASET?
Hello,
I am experiencing some issues when using ETH0 (LAN8670). As a test I want to use ETH1 to use LAN8650 via SPI communication.
How can I use ETH1 when calling FreeRTOS_recvfrom(), FreeRTOS_sendto(), etc?
I changed SPC5_USE_ETH0 as FALSE and SPC5_USE_ETH1 as TRUE but still I can’t use ETH1, I do not see any packet from ETH1’s port of Evaluation board via Wireshark in the connected PC.
Questions;
- Is there additional #define to change if I want to use ETH1 (through SPI) but not ETH0 (through MAC)?
- Or do I need to call different FreeRTOS API functions?
Currently I am calling some Ethernet related functions like below.
UdpRxInfo.xRXSocket = FreeRTOS_socket(FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP);
FreeRTOS_setsockopt(UdpRxInfo.xRXSocket, 0, FREERTOS_SO_RCVTIMEO, &xReceiveTimeOut, sizeof(xReceiveTimeOut));
UdpRxInfo.xBindAddress.sin_addr = FreeRTOS_inet_addr("192.168.0.22"); // use Specific IP to receive
UdpRxInfo.xBindAddress.sin_port = FreeRTOS_htons(XcpPortNum); // use Specific Port to receive
FreeRTOS_bind(UdpRxInfo.xRXSocket, &UdpRxInfo.xBindAddress, sizeof(UdpRxInfo.xBindAddress));
socklen_t xAddressLength = sizeof( xBindAddress );
// RX
int nRet = FreeRTOS_recvfrom(
xSocket,
rx_buffer,
sizeof(rx_buffer),
0,
&xBindAddress, //NULL,
&xAddressLength //NULL
);
// TX
FreeRTOS_sendto(
xSocket,
tx_payload,
uTxLen,
0,
&xBindAddress,
sizeof(xBindAddress)
);
